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: <de...@us...> - 2003-09-02 08:42:49
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv9006/test/reflux
Modified Files:
TestINP.java
Log Message:
Correction bug 797184
Amelioration lecture format reflux/telemac
Index: TestINP.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestINP.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TestINP.java 22 Aug 2003 15:51:13 -0000 1.7
--- TestINP.java 2 Sep 2003 08:41:25 -0000 1.8
***************
*** 96,110 ****
H2dRefluxBordIndexGeneral bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1430, 1421, _t.getBords());
! assertEquals(H2dBordType.SOLIDE, bord.getBord());
bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1412, 1403, _t.getBords());
! assertEquals(H2dBordType.SOLIDE, bord.getBord());
! itemp= new int[] { 1430, 1421, 1412, 1403, 1394 };
! for (int i= itemp.length - 1; i > 0; i--) {
! cl= getForIndex(tabCl, itemp[i]);
! assertEquals(H2dClType.PERMANENT, cl.getRugositeType());
! assertEquals(3d, cl.getRugosite(), eps_);
!
! }
//H2dElement[] elems=t.getMaillage().getElts();
--- 96,107 ----
H2dRefluxBordIndexGeneral bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1430, 1421, _t.getBords());
! assertEquals(H2dBordType.SOLIDE_FROTTEMENT, bord.getBord());
! assertEquals(H2dClType.PERMANENT, bord.getRugositeType());
! assertEquals(3d, bord.getRugosite(), eps_);
bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1412, 1403, _t.getBords());
! assertEquals(H2dBordType.SOLIDE_FROTTEMENT, bord.getBord());
! assertEquals(H2dClType.PERMANENT, bord.getRugositeType());
! assertEquals(3d, bord.getRugosite(), eps_);
//H2dElement[] elems=t.getMaillage().getElts();
***************
*** 122,126 ****
assertEquals(prTemp.getVariableType(), H2dVariableType.VISCOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.01, eps_);
--- 119,123 ----
assertEquals(prTemp.getVariableType(), H2dVariableType.VISCOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.01, eps_);
***************
*** 128,134 ****
assertEquals(prTemp.getVariableType(), H2dVariableType.RUGOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.025, eps_);
prTemp= propelem[2];
--- 125,132 ----
assertEquals(prTemp.getVariableType(), H2dVariableType.RUGOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.025, eps_);
+ assertEquals(prTemp.getPermanentValueForIndex(1), 0.025, eps_);
prTemp= propelem[2];
***************
*** 137,141 ****
H2dVariableType.ALPHA_LONGUEUR_MELANGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.0, eps_);
--- 135,139 ----
H2dVariableType.ALPHA_LONGUEUR_MELANGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.0, eps_);
***************
*** 143,150 ****
prTemp= propelem[3];
assertEquals(prTemp.getVariableType(), H2dVariableType.PERTE_CHARGE);
! assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 792);
! assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(), 0.0, eps_);
for (int i= 790; i >= 0; i--) {
--- 141,149 ----
prTemp= propelem[3];
assertEquals(prTemp.getVariableType(), H2dVariableType.PERTE_CHARGE);
! assertEquals(0,prTemp.getValeurTransitoireNb());
! assertEquals(792,prTemp.getPermanentSpecifieNb());
! assertEquals(0,prTemp.getValeurLibreNb());
! assertEquals(0.0,prTemp.getDefaultValue(), eps_);
! assertEquals(0.0,prTemp.getPermanentValueForIndex(0), eps_);
for (int i= 790; i >= 0; i--) {
***************
*** 210,214 ****
FileOperationSynthese syntheseR=
INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, null);
! INPInterface r=(INPInterface)syntheseR.getSource();
if (syntheseR.containsMessages())
syntheseR.getAnalyze().toAnalyze().printResume();
--- 209,213 ----
FileOperationSynthese syntheseR=
INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, null);
! INPInterface r= (INPInterface)syntheseR.getSource();
if (syntheseR.containsMessages())
syntheseR.getAnalyze().toAnalyze().printResume();
***************
*** 243,250 ****
assertEquals(1, maillageBord.getBordNb());
H2dRefluxBordManager mng= param.getBords();
! assertEquals(mng.getFrontiereBordNb(), 1);
! H2dRefluxBordManager.BordParFrontiere frontiere0= mng.getFrontiereBord(0);
! assertEquals(1, frontiere0.getBordNb());
! assertTrue(frontiere0.getBord(0).isUnique());
}
--- 242,252 ----
assertEquals(1, maillageBord.getBordNb());
H2dRefluxBordManager mng= param.getBords();
! assertEquals(mng.getFrontiereNb(), 1);
! H2dRefluxBordManager.BordParFrontiere frontiere0= mng.getFrontiereBords(0);
! assertEquals(2, frontiere0.getBordNb());
! assertEquals(H2dBordType.SOLIDE, frontiere0.getBord(0).getType());
! assertEquals(
! H2dBordType.SOLIDE_FROTTEMENT,
! frontiere0.getBord(1).getType());
}
***************
*** 265,281 ****
return;
}
!
! FileOperationSynthese syntheseR= INPFileFormat.getInstance().getLastINPVersionImpl().read(
! f,
! null);
! INPInterface inpInter=(INPInterface)syntheseR.getSource();
DodicoAnalyze infos= syntheseR.getAnalyze().toAnalyze();
if (infos != null)
infos.printResume();
! if (inpInter != null) {
! System.out.println(inpInter.getTypeProjet().toString());
! DodicoLib.printFields(inpInter, false);
! }
}
--- 267,290 ----
return;
}
! INPFileFormat.INPVersion version=
! INPFileFormat.getInstance().getLastINPVersionImpl();
! FileOperationSynthese syntheseR= version.read(f, new ProgressionTestAdapter());
! INPInterface inpInter= (INPInterface)syntheseR.getSource();
DodicoAnalyze infos= syntheseR.getAnalyze().toAnalyze();
if (infos != null)
infos.printResume();
! if ((infos != null) && (infos.containsFatalError()))
! return;
! fileName= (String)arg.get("-o");
! if (fileName == null)
! fileName= (String)arg.get("-out");
! if (fileName == null)
! return;
! f= new File(fileName);
! long t1= System.currentTimeMillis();
! version.write(f, inpInter, new ProgressionTestAdapter());
! long t2= System.currentTimeMillis();
! System.out.println("temps ecriture " + (t2 - t1));
}
|
|
From: <de...@us...> - 2003-09-02 08:42:24
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv9006/reflux
Modified Files:
DParametresReflux.java
Log Message:
Correction bug 797184
Amelioration lecture format reflux/telemac
Index: DParametresReflux.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/DParametresReflux.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DParametresReflux.java 18 Mar 2003 13:37:18 -0000 1.2
--- DParametresReflux.java 2 Sep 2003 08:41:24 -0000 1.3
***************
*** 1049,1052 ****
--- 1049,1054 ----
// Nombre de pas de temps
file.writeInteger(pTs.length);
+ // System.out.println("nbPasTemps "+pTs.length);
+ // System.out.println("nbEvolution "+pTs[0].valeursDegresLibertes.length);
file.writeRecord();
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv8754
Modified Files:
DodicoAnalyze.java DodicoDoubleDoubleSortedList.java
DodicoLib.java
Added Files:
DodicoArrayList.java
Log Message:
DodicoArrayList : classe etendant ArrayList et offrant la
methode setSize()
Modif mineure
--- NEW FILE: DodicoArrayList.java ---
(This appears to be a binary file; contents omitted.)
Index: DodicoAnalyze.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoAnalyze.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DodicoAnalyze.java 22 Aug 2003 15:51:11 -0000 1.5
--- DodicoAnalyze.java 2 Sep 2003 08:39:16 -0000 1.6
***************
*** 90,93 ****
--- 90,96 ----
}
+ /**
+ * Renvoie une chaine formatee contenant toutes les erreurs de l'analyse.
+ */
public String getResume(String _prefix) {
String prefix=_prefix == null?DodicoLib.EMPTY_STRING:_prefix;
***************
*** 173,177 ****
IOException _e,
DodicoAnalyze.Editor _analyze) {
! _analyze.addError("Erreur d'entrée/sortie");
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
--- 176,180 ----
IOException _e,
DodicoAnalyze.Editor _analyze) {
! _analyze.addFatalError("Erreur d'entrée/sortie");
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
***************
*** 183,187 ****
DodicoAnalyze.Editor _analyze,
FortranReader _l) {
! _analyze.addError("Format du champ incorrect", _l);
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
--- 186,190 ----
DodicoAnalyze.Editor _analyze,
FortranReader _l) {
! _analyze.addFatalError("Format du champ incorrect", _l);
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
***************
*** 192,196 ****
IllegalArgumentException _e,
DodicoAnalyze.Editor _analyze) {
! _analyze.addError("Erreur interne d'argument");
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
--- 195,199 ----
IllegalArgumentException _e,
DodicoAnalyze.Editor _analyze) {
! _analyze.addFatalError("Erreur interne d'argument");
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
***************
*** 201,205 ****
Exception _e,
DodicoAnalyze.Editor _analyze) {
! _analyze.addError("Erreur à l'exécution");
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
--- 204,208 ----
Exception _e,
DodicoAnalyze.Editor _analyze) {
! _analyze.addFatalError("Erreur à l'exécution");
_analyze.addInfo(_e.getMessage());
if (DodicoLib.DEBUG)
***************
*** 240,244 ****
_bufferStockage.append(DodicoLib.ESPACE+
"Ligne "
! + (t > 0 ? Integer.toHexString(t) : DodicoLib.EMPTY_STRING)
+ ": "
+ element.getMessage());
--- 243,247 ----
_bufferStockage.append(DodicoLib.ESPACE+
"Ligne "
! + (t > 0 ? Integer.toString(t) : DodicoLib.EMPTY_STRING)
+ ": "
+ element.getMessage());
Index: DodicoDoubleDoubleSortedList.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoDoubleDoubleSortedList.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DodicoDoubleDoubleSortedList.java 4 Jul 2003 08:11:42 -0000 1.1
--- DodicoDoubleDoubleSortedList.java 2 Sep 2003 08:39:16 -0000 1.2
***************
*** 31,34 ****
--- 31,39 ----
return indexOfKey(_key)>=0;
}
+
+ public void ensureCapacity(int _c){
+ t_.ensureCapacity(_c);
+ val_.ensureCapacity(_c);
+ }
/**
Index: DodicoLib.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoLib.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** DodicoLib.java 22 Aug 2003 15:51:11 -0000 1.11
--- DodicoLib.java 2 Sep 2003 08:39:16 -0000 1.12
***************
*** 642,653 ****
return rf;
}
!
!
! public static int findInt(int[] _array,int _intToSearch){
! int n=_array.length-1;
for (int i= n; i >= 0; i--) {
! if(_array[i]==_intToSearch) return i;
}
return -1;
}
--- 642,666 ----
return rf;
}
!
! public static int findInt(int[] _array, int _intToSearch) {
! int n= _array.length - 1;
for (int i= n; i >= 0; i--) {
! if (_array[i] == _intToSearch)
! return i;
}
return -1;
+ }
+
+ /**
+ * Recherche dans le tableau la chaine finissant par _end. Commence
+ * la recherche de la fin du tableau.
+ */
+ public static String findStringEndWith(String[] _tab, String _end) {
+ for (int i= _tab.length - 1; i >= 0; i--) {
+ String s= _tab[i];
+ if (s.endsWith(_end))
+ return s;
+ }
+ return null;
}
|
|
From: <de...@us...> - 2003-09-02 08:37:36
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d
In directory sc8-pr-cvs1:/tmp/cvs-serv8494
Modified Files:
H2dBord.java H2dEvolution.java
H2dEvolutionFrontiereLiquide.java H2dMaillage.java
H2dMaillageFrontiere.java H2dProprieteElementaire.java
H2dProprieteNodale.java
Log Message:
Nouvelle version de support pour le metier Hydraulique 2d
Index: H2dBord.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBord.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dBord.java 22 Aug 2003 15:51:12 -0000 1.3
--- H2dBord.java 2 Sep 2003 08:37:22 -0000 1.4
***************
*** 9,12 ****
--- 9,14 ----
package org.fudaa.dodico.h2d;
+ import gnu.trove.TIntIterator;
+
import org.fudaa.dodico.h2d.type.H2dBordType;
***************
*** 48,51 ****
--- 50,102 ----
+ type_;
}
+
+ public static final class BordIndexIterator{
+ private int nbPt_;
+ private H2dBord bd_;
+ private int indexEnCours_;
+ private int indexFinal_;
+ public BordIndexIterator(){
+ }
+
+ public BordIndexIterator(int _nbPt,H2dBord _b){
+ set(_nbPt,_b);
+ }
+
+ public final void set(int _nbPt,H2dBord _b){
+ nbPt_=_nbPt;
+ bd_=_b;
+ if(_b.isUnique()){
+ indexEnCours_=0;
+ indexFinal_=nbPt_-1;
+ }
+ else if(_b.idxDeb_>_b.idxFin_){
+ indexEnCours_=_b.idxDeb_;
+ indexFinal_=nbPt_+_b.idxFin_;
+ }
+ else
+ {
+ indexEnCours_=_b.idxDeb_;
+ indexFinal_=_b.idxFin_;
+ }
+ }
+
+ public boolean hasNext(){
+ return indexEnCours_<=indexFinal_;
+ }
+
+ public int next(){
+ if(indexEnCours_>indexFinal_) throw new IllegalAccessError("iterateur termine");
+ int r=(indexEnCours_<nbPt_)?indexEnCours_:indexEnCours_-nbPt_;
+ indexEnCours_++;
+ return r;
+ }
+
+
+ }
+
+ public BordIndexIterator createIterator(int _nb){
+ return new BordIndexIterator(_nb,this);
+ }
+
/**
***************
*** 83,86 ****
--- 134,149 ----
public int getIdxFrontiere() {
return IdxmaillageFrontiere_;
+ }
+
+ public int getNPointInBord(int _nbPoint) {
+ if (idxFin_> idxDeb_)
+ return idxFin_- idxDeb_+ 1;
+ else {
+ return idxFin_
+ + 1
+ + _nbPoint
+ - idxDeb_;
+ }
+
}
Index: H2dEvolution.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dEvolution.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dEvolution.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dEvolution.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 10,13 ****
--- 10,14 ----
import org.fudaa.dodico.commun.DodicoDoubleDoubleSortedList;
+ import org.fudaa.dodico.commun.DodicoLib;
/**
***************
*** 15,20 ****
* @version $Id$
*/
! public class H2dEvolution
! {
String nom_;
String unite_;
--- 16,20 ----
* @version $Id$
*/
! public class H2dEvolution {
String nom_;
String unite_;
***************
*** 24,78 ****
*
*/
! public H2dEvolution()
! {
! list_ = new DodicoDoubleDoubleSortedList();
}
! public H2dEvolution(int _n)
! {
! list_ = new DodicoDoubleDoubleSortedList(_n);
}
! public H2dEvolution(String _nom)
! {
this();
! nom_ = _nom;
}
! public void add(double t_, double _value)
! {
list_.put(t_, _value);
}
! public int getPasTempNb()
! {
return list_.size();
}
! public double getPasDeTemps(int _index)
! {
return list_.getKeyAtIndex(_index);
}
! public double getQuickPasDeTemps(int _index)
! {
return list_.getQuickKeyAtIndex(_index);
}
! public double getValue(int _index)
! {
return list_.getValueAtIndex(_index);
}
! public double getQuickValue(int _index)
! {
return list_.getQuickValueAtIndex(_index);
}
/**
*
*/
! public String getNom()
! {
return nom_;
}
--- 24,72 ----
*
*/
! public H2dEvolution() {
! list_= new DodicoDoubleDoubleSortedList();
}
! public H2dEvolution(int _n) {
! list_= new DodicoDoubleDoubleSortedList(_n);
}
! public H2dEvolution(String _nom) {
this();
! nom_= _nom;
}
! protected void add(double t_, double _value) {
list_.put(t_, _value);
}
! public int getPasTempNb() {
return list_.size();
}
! public double getPasDeTemps(int _index) {
return list_.getKeyAtIndex(_index);
}
! public double getQuickPasDeTemps(int _index) {
return list_.getQuickKeyAtIndex(_index);
}
! public double getValue(int _index) {
return list_.getValueAtIndex(_index);
}
! public double getQuickValue(int _index) {
return list_.getQuickValueAtIndex(_index);
}
+ protected void ensureCapacity(int _c) {
+ list_.ensureCapacity(_c);
+ }
+
/**
*
*/
! public String getNom() {
return nom_;
}
***************
*** 81,86 ****
*
*/
! public String getUnite()
! {
return unite_;
}
--- 75,79 ----
*
*/
! public String getUnite() {
return unite_;
}
***************
*** 89,95 ****
*
*/
! public void setNom(String _string)
! {
! nom_ = _string;
}
--- 82,87 ----
*
*/
! public void setNom(String _string) {
! nom_= _string;
}
***************
*** 97,103 ****
*
*/
! public void setUnite(String _string)
! {
! unite_ = _string;
}
--- 89,127 ----
*
*/
! public void setUnite(String _string) {
! unite_= _string;
! }
!
! /**
! *
! */
! public String toString() {
! return nom_
! + DodicoLib.ESPACE
! + "nb= "
! + list_.size()
! + " unite= "
! + unite_;
! }
!
! public String getDescriptionTotale() {
! StringBuffer b= new StringBuffer();
! b.append(toString()).append(DodicoLib.LINE_SEP);
! StringBuffer t= new StringBuffer();
! StringBuffer v= new StringBuffer();
!
! for (int i= 0; i < list_.size(); i++) {
! if (i > 0) {
! t.append(",");
! v.append(",");
! }
! t.append(list_.getQuickKeyAtIndex(i));
! v.append(list_.getQuickValueAtIndex(i));
! }
! b.append("temps=[").append(t.toString()).append("]").append(
! DodicoLib.LINE_SEP);
! b.append("valeurs=[").append(v.toString()).append("]").append(
! DodicoLib.LINE_SEP);
! return b.toString();
}
Index: H2dEvolutionFrontiereLiquide.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dEvolutionFrontiereLiquide.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dEvolutionFrontiereLiquide.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dEvolutionFrontiereLiquide.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 55,59 ****
*
*/
! public void setIndexFrontiere(int _i)
{
indexFrontiere_ = _i;
--- 55,59 ----
*
*/
! protected void setIndexFrontiere(int _i)
{
indexFrontiere_ = _i;
Index: H2dMaillage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** H2dMaillage.java 22 Aug 2003 15:51:12 -0000 1.4
--- H2dMaillage.java 2 Sep 2003 08:37:22 -0000 1.5
***************
*** 308,313 ****
int n= elts_.length;
if (_inter != null) {
- _inter.setProgression(0);
_inter.setDesc("Recherche des aretes de contours");
}
TIntArrayList segment= new TIntArrayList(pts_.length * 6 * 2);
--- 308,313 ----
int n= elts_.length;
if (_inter != null) {
_inter.setDesc("Recherche des aretes de contours");
+ _inter.setProgression(0);
}
TIntArrayList segment= new TIntArrayList(pts_.length * 6 * 2);
Index: H2dMaillageFrontiere.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillageFrontiere.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dMaillageFrontiere.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dMaillageFrontiere.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 46,49 ****
--- 46,61 ----
}
+ /**
+ * Renvoie le nombre totals de point des frontieres.
+ */
+ public int getTotalPtNb(){
+ int r=0;
+ for(int i=bords_.length-1;i>=0;i--){
+ r+=bords_[i].length;
+ }
+ return r;
+
+ }
+
/**
Index: H2dProprieteElementaire.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dProprieteElementaire.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dProprieteElementaire.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dProprieteElementaire.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 9,24 ****
package org.fudaa.dodico.h2d;
- import org.fudaa.dodico.h2d.type.H2dVariableType;
-
import gnu.trove.TIntArrayList;
import gnu.trove.TIntDoubleHashMap;
import gnu.trove.TIntObjectHashMap;
/**
* @author deniger
* @version $Id$
*/
! public class H2dProprieteElementaire extends H2dProprieteNodale
! {
TIntArrayList indiceLibre_;
TIntObjectHashMap indiceTransitoireEvolution_;
--- 9,24 ----
package org.fudaa.dodico.h2d;
import gnu.trove.TIntArrayList;
import gnu.trove.TIntDoubleHashMap;
import gnu.trove.TIntObjectHashMap;
+ import org.fudaa.dodico.h2d.type.H2dClType;
+ import org.fudaa.dodico.h2d.type.H2dVariableType;
+
/**
* @author deniger
* @version $Id$
*/
! public class H2dProprieteElementaire extends H2dProprieteNodale {
TIntArrayList indiceLibre_;
TIntObjectHashMap indiceTransitoireEvolution_;
***************
*** 27,47 ****
*
*/
! public H2dProprieteElementaire(String _nom,H2dVariableType _varType,TIntArrayList _indiceLibre,TIntDoubleHashMap _indiceFixeValeur,TIntObjectHashMap _indiceTransitoireEvolution)
! {
! super(_varType,_nom);
! indiceLibre_=_indiceLibre;
indiceLibre_.sort();
! indicePermanentValeur_=_indiceFixeValeur;
! indiceTransitoireEvolution_=_indiceTransitoireEvolution;
}
!
! public int getValeurTransitoireNb()
! {
return indiceTransitoireEvolution_.size();
}
!
! public int getValeurLibreNb()
! {
! return indiceLibre_.size();
}
--- 27,70 ----
*
*/
! public H2dProprieteElementaire(
! String _nom,
! H2dVariableType _varType,
! TIntArrayList _indiceLibre,
! TIntDoubleHashMap _indiceFixeValeur,
! TIntObjectHashMap _indiceTransitoireEvolution) {
! super(_varType, _nom);
! indiceLibre_= _indiceLibre;
indiceLibre_.sort();
! indicePermanentValeur_= _indiceFixeValeur;
! indiceTransitoireEvolution_= _indiceTransitoireEvolution;
}
!
! public int getValeurTransitoireNb() {
return indiceTransitoireEvolution_.size();
}
!
!
! public int getValeurLibreNb() {
! return indiceLibre_ == null ? 0 : indiceLibre_.size();
! }
!
! /**
! * Renvoie le type de variable pour l'element d'indice i.
! * @return permanent si non transitoire et non libre.
! */
! public H2dClType getTypeForEltIdx(int _i) {
! if ((indiceTransitoireEvolution_ != null)
! && (indiceTransitoireEvolution_.contains(_i)))
! return H2dClType.TRANSITOIRE;
! else if ((indiceLibre_ != null) && (indiceLibre_.binarySearch(_i) >= 0))
! return H2dClType.LIBRE;
! return H2dClType.PERMANENT;
! }
!
!
! public H2dEvolution getTransitoireEvol(int _eltIdx) {
! if (indiceTransitoireEvolution_ != null)
! return (H2dEvolution)indiceTransitoireEvolution_.get(_eltIdx);
! return null;
}
Index: H2dProprieteNodale.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dProprieteNodale.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dProprieteNodale.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dProprieteNodale.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 19,114 ****
* @version $Id$
*/
! public class H2dProprieteNodale
! {
! String nom_;
! H2dVariableType variableType_;
! String unite_;
! double defaultValue_;
! TIntDoubleHashMap indicePermanentValeur_;
! /**
! *
! */
! public H2dProprieteNodale(String _nom)
! {
! nom_ = _nom;
! }
! public H2dProprieteNodale(H2dVariableType _var)
! {
! variableType_ = _var;
! nom_ = variableType_.getNom();
! }
!
! public H2dProprieteNodale(H2dVariableType _var,String _nom)
! {
! variableType_ = _var;
! if(_nom==null)
! {
!
! nom_ = variableType_.getNom();
! }
! else
! {
! nom_=_nom;
}
}
! public void computeFixe()
! {
! if (indicePermanentValeur_.size() != 0)
! {
! TSameDouble test = new TSameDouble();
! indicePermanentValeur_.forEachValue(test);
! if (test.isPermanent())
! {
! defaultValue_ = test.getPermanentValue();
! indicePermanentValeur_.clear();
! }
!
}
}
! public static class TSameDouble implements TDoubleProcedure
! {
! private boolean r = true;
! private boolean first = true;
! private double value;
! public boolean isPermanent()
! {
! return r;
! }
! public double getPermanentValue()
! {
! return value;
}
! public boolean execute(double _d)
! {
! if (first)
! {
! value = _d;
! first = false;
! return true;
! }
! else
! {
! if (_d != value)
! {
! r=false;
! return false;
! }
! else
! return true;
}
}
! }
!
! public double getPermanentValueForIndex(int _i)
! {
! return indicePermanentValeur_.get(_i);
}
--- 19,90 ----
* @version $Id$
*/
! public class H2dProprieteNodale {
! public static class TSameDouble implements TDoubleProcedure {
! private boolean first= true;
! private boolean r= true;
! private double value;
! public boolean execute(double _d) {
! if (first) {
! value= _d;
! first= false;
! return true;
! } else {
! if (_d != value) {
! r= false;
! return false;
! } else
! return true;
}
}
! public double getPermanentValue() {
! return value;
}
+ public boolean isPermanent() {
+ return r;
+ }
}
+ double defaultValue_;
+ TIntDoubleHashMap indicePermanentValeur_;
+ String nom_;
+ String unite_;
+ H2dVariableType variableType_;
! public H2dProprieteNodale(H2dVariableType _var) {
! variableType_= _var;
! nom_= variableType_.getNom();
! }
! public H2dProprieteNodale(H2dVariableType _var, String _nom) {
! variableType_= _var;
! if (_nom == null) {
! nom_= variableType_.getNom();
! } else {
! nom_= _nom;
}
+ }
! /**
! *
! */
! public H2dProprieteNodale(String _nom) {
! nom_= _nom;
! }
!
! public void computeFixe() {
! if (indicePermanentValeur_.size() != 0) {
! TSameDouble test= new TSameDouble();
! indicePermanentValeur_.forEachValue(test);
! if (test.isPermanent()) {
! defaultValue_= test.getPermanentValue();
! indicePermanentValeur_.clear();
}
+
}
!
}
***************
*** 116,121 ****
*
*/
! public double getDefaultValue()
! {
return defaultValue_;
}
--- 92,96 ----
*
*/
! public double getDefaultValue() {
return defaultValue_;
}
***************
*** 124,130 ****
*
*/
! public int getPermanentNb()
! {
! return indicePermanentValeur_.size();
}
--- 99,104 ----
*
*/
! public String getNom() {
! return nom_;
}
***************
*** 132,138 ****
*
*/
! public String getNom()
! {
! return nom_;
}
--- 106,120 ----
*
*/
! public int getPermanentSpecifieNb() {
! return indicePermanentValeur_.size();
! }
!
! public double getPermanentValueForIndex(int _i) {
! if ((indicePermanentValeur_ != null) && (indicePermanentValeur_.size()>0)){
! return indicePermanentValeur_.get(_i);
! }
! else{
! return defaultValue_;
! }
}
***************
*** 140,145 ****
*
*/
! public String getUnite()
! {
return unite_;
}
--- 122,126 ----
*
*/
! public String getUnite() {
return unite_;
}
***************
*** 148,153 ****
*
*/
! public H2dVariableType getVariableType()
! {
return variableType_;
}
--- 129,133 ----
*
*/
! public H2dVariableType getVariableType() {
return variableType_;
}
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type
In directory sc8-pr-cvs1:/tmp/cvs-serv8494/type
Modified Files:
H2dBordType.java H2dMethodeResolutionType.java
H2dProjetType.java H2dSchemaResolutionType.java
Log Message:
Nouvelle version de support pour le metier Hydraulique 2d
Index: H2dBordType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dBordType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dBordType.java 18 Aug 2003 11:05:19 -0000 1.2
--- H2dBordType.java 2 Sep 2003 08:37:23 -0000 1.3
***************
*** 23,26 ****
--- 23,27 ----
public static H2dBordType SOLIDE=new H2dBordType(1,DodicoLib.geti18n("Solide"));
+ public static H2dBordType SOLIDE_FROTTEMENT=new H2dBordType(1,DodicoLib.geti18n("Solide frottement"));
public static H2dBordType LIQUIDE=new H2dBordType(2,DodicoLib.geti18n("Liquide"));
public static H2dBordType LIQUIDE_DEBIT_IMPOSE=new H2dBordType(3,DodicoLib.geti18n("Liquide débit imposé"));
Index: H2dMethodeResolutionType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dMethodeResolutionType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dMethodeResolutionType.java 4 Jul 2003 13:13:45 -0000 1.1
--- H2dMethodeResolutionType.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 22,26 ****
{
! public static H2dMethodeResolutionType LINEAIRE=new H2dMethodeResolutionType(1,DodicoLib.geti18n("Linéaire"),"LINAIRE");
public static H2dMethodeResolutionType NEWTON_RAPHSON=new H2dMethodeResolutionType(2,DodicoLib.geti18n("Newton Raphson"),"NEWTON");
public static H2dMethodeResolutionType NEWTON_RAPHSON_BCD=new H2dMethodeResolutionType(3,DodicoLib.geti18n("Newton Raphson banc découvrant"),"NEWTON_BCD");
--- 22,26 ----
{
! public static H2dMethodeResolutionType LINEAIRE=new H2dMethodeResolutionType(1,DodicoLib.geti18n("Linéaire"),"LINEAIRE");
public static H2dMethodeResolutionType NEWTON_RAPHSON=new H2dMethodeResolutionType(2,DodicoLib.geti18n("Newton Raphson"),"NEWTON");
public static H2dMethodeResolutionType NEWTON_RAPHSON_BCD=new H2dMethodeResolutionType(3,DodicoLib.geti18n("Newton Raphson banc découvrant"),"NEWTON_BCD");
***************
*** 56,59 ****
--- 56,66 ----
}
+
+ /**
+ *
+ */
+ public String getRefluxId() {
+ return refluxId_;
+ }
}
Index: H2dProjetType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dProjetType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dProjetType.java 4 Jul 2003 13:13:45 -0000 1.1
--- H2dProjetType.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 64,67 ****
--- 64,71 ----
refluxId_ = _refluxId;
}
+
+ public String getRefluxId(){
+ return refluxId_;
+ }
}
Index: H2dSchemaResolutionType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dSchemaResolutionType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dSchemaResolutionType.java 4 Jul 2003 13:13:45 -0000 1.1
--- H2dSchemaResolutionType.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 67,70 ****
--- 67,74 ----
return methodeList_.contains(_methode);
}
+
+ public String getRefluxId(){
+ return refluxId_;
+ }
}
|
|
From: <de...@us...> - 2003-09-02 08:37:34
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv8494/reflux
Modified Files:
H2dRefluxBordIndexGeneral.java H2dRefluxBordManager.java
H2dRefluxConditionLimite.java
H2dRefluxConditionLimiteMutable.java H2dRefluxParametres.java
H2dRefluxSourceInterface.java
Removed Files:
H2dRefluxParametresCalcul.java
Log Message:
Nouvelle version de support pour le metier Hydraulique 2d
Index: H2dRefluxBordIndexGeneral.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxBordIndexGeneral.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dRefluxBordIndexGeneral.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dRefluxBordIndexGeneral.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 9,15 ****
--- 9,21 ----
package org.fudaa.dodico.h2d.reflux;
+ import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.h2d.H2dEvolution;
import org.fudaa.dodico.h2d.type.H2dBordType;
+ import org.fudaa.dodico.h2d.type.H2dClType;
/**
+ * Une classe pour definir un bord pour les fichiers e-s de reflux (inp).
+ * Classe mal foutu ( contient des données de bord avec frottement
+ * pour tous les types de bords).
* @author deniger
* @version $Id$
***************
*** 17,22 ****
public class H2dRefluxBordIndexGeneral {
private int[] index_;
! private H2dBordType bord_;
/**
--- 23,60 ----
public class H2dRefluxBordIndexGeneral {
+ /**
+ * Renvoie un bord contenant l'indice _i1 en partant de la fin du tableau.
+ * @return null si aucun bord.
+ */
+ public static H2dRefluxBordIndexGeneral findBordWithIndex(
+ int _i1,
+ H2dRefluxBordIndexGeneral[] _bords) {
+ int n= _bords.length - 1;
+ for (int i= n; i >= 0; i--) {
+ H2dRefluxBordIndexGeneral general= _bords[i];
+ if (general.containsIndex(_i1))
+ return general;
+ }
+ return null;
+ }
+
+ public static H2dRefluxBordIndexGeneral findBordWithIndex(
+ int _i1,
+ int _i2,
+ H2dRefluxBordIndexGeneral[] _bords) {
+ int n= _bords.length - 1;
+ for (int i= n; i >= 0; i--) {
+ H2dRefluxBordIndexGeneral general= _bords[i];
+ if (general.containsIndex(_i1) && general.containsIndex(_i2))
+ return general;
+ }
+ return null;
+ }
+ H2dBordType bord_;
+
private int[] index_;
! double rugosite_;
! H2dEvolution rugositeTransitoireCourbe_;
! H2dClType rugositeType_;
/**
***************
*** 27,30 ****
--- 65,81 ----
}
+ public H2dRefluxBordIndexGeneral(H2dBordType _b) {
+ bord_= (_b == null ? H2dBordType.SOLIDE : _b);
+ }
+
+ public boolean containsIndex(int _i) {
+ int n= index_.length - 1;
+ for (int i= n; i >= 0; i--) {
+ if (index_[i] == _i)
+ return true;
+ }
+ return false;
+ }
+
/**
*
***************
*** 44,49 ****
--- 95,125 ----
*
*/
+ public double getRugosite() {
+ return rugosite_;
+ }
+
+ /**
+ *
+ */
+ public H2dEvolution getRugositeTransitoireCourbe() {
+ return rugositeTransitoireCourbe_;
+ }
+
+ /**
+ *
+ */
+ public H2dClType getRugositeType() {
+ return rugositeType_;
+ }
+
+ /**
+ *
+ */
public void setBord(H2dBordType _type) {
bord_= _type;
+ if (bord_ != H2dBordType.SOLIDE_FROTTEMENT) {
+ rugositeTransitoireCourbe_= null;
+ rugositeType_= null;
+ }
}
***************
*** 55,95 ****
}
! public boolean containsIndex(int _i) {
! int n= index_.length - 1;
! for (int i= n; i >= 0; i--) {
! if (index_[i] == _i)
! return true;
! }
! return false;
}
! public static H2dRefluxBordIndexGeneral findBordWithIndex(
! int _i1,
! int _i2,
! H2dRefluxBordIndexGeneral[] _bords) {
! int n= _bords.length - 1;
! for (int i= n; i >= 0; i--) {
! H2dRefluxBordIndexGeneral general= _bords[i];
! if (general.containsIndex(_i1) && general.containsIndex(_i2))
! return general;
! }
! return null;
}
!
/**
! * Renvoie un bord contenant l'indice _i1 en partant de la fin du tableau.
! * @return null si aucun bord.
*/
! public static H2dRefluxBordIndexGeneral findBordWithIndex(
! int _i1,
! H2dRefluxBordIndexGeneral[] _bords) {
! int n= _bords.length - 1;
! for (int i= n; i >= 0; i--) {
! H2dRefluxBordIndexGeneral general= _bords[i];
! if (general.containsIndex(_i1))
! return general;
}
- return null;
}
!
}
--- 131,185 ----
}
! public String toString() {
!
! String r=
! "bord " + bord_ + DodicoLib.ESPACE + DodicoLib._printObject(index_, true);
! if (bord_ == H2dBordType.SOLIDE_FROTTEMENT)
! r += DodicoLib.ESPACE
! + "rugosite ( "
! + rugositeType_
! + ", "
! + rugosite_
! + ", "
! + rugositeTransitoireCourbe_
! + ")";
! return r;
!
}
! /**
! * Ne met a jour que si le bord est de type SOLIDE_FROTTEMENT et
! * que la condition est H2dClType.PERMANENT
! */
! public void setRugosite(double _d) {
! if ((bord_ == H2dBordType.SOLIDE_FROTTEMENT)
! && (rugositeType_ == H2dClType.PERMANENT))
! rugosite_= _d;
}
!
/**
! * Ne met a jour que si le bord est de type SOLIDE_FROTTEMENT
*/
! public void setRugositeTransitoireCourbe(H2dEvolution _evolution) {
! if (bord_ == H2dBordType.SOLIDE_FROTTEMENT)
! rugositeTransitoireCourbe_= _evolution;
! }
!
! /**
! * Affecte la valeur type_ et met a jour les autres donnees
! * (valeur rugosite, evolution transitoire...).
! */
! public void setRugositeType(H2dClType _type) {
! if (bord_ == H2dBordType.SOLIDE_FROTTEMENT) {
! rugositeType_= _type;
! if (rugositeType_ == H2dClType.LIBRE) {
! rugosite_= 0d;
! rugositeTransitoireCourbe_= null;
! } else if (rugositeType_ == H2dClType.PERMANENT) {
! rugositeTransitoireCourbe_= null;
! } else if (rugositeType_ == H2dClType.TRANSITOIRE) {
! rugosite_= 0;
}
}
! }
}
Index: H2dRefluxBordManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxBordManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dRefluxBordManager.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dRefluxBordManager.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 9,13 ****
--- 9,18 ----
package org.fudaa.dodico.h2d.reflux;
+ import gnu.trove.TIntIterator;
+ import gnu.trove.TIntObjectHashMap;
+ import gnu.trove.TIntObjectIterator;
+
import java.util.ArrayList;
+ import java.util.List;
import org.fudaa.dodico.commun.DodicoAnalyze;
***************
*** 15,20 ****
--- 20,27 ----
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dBordMutable;
+ import org.fudaa.dodico.h2d.H2dEvolution;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.type.H2dBordType;
+ import org.fudaa.dodico.h2d.type.H2dClType;
/**
***************
*** 32,43 ****
protected H2dRefluxBordManager() {}
! public int getFrontiereBordNb() {
return bordByFrontiere_.length;
}
! public BordParFrontiere getFrontiereBord(int _i) {
return bordByFrontiere_[_i];
}
public static H2dRefluxBordManager init(
H2dMaillageFrontiere _maillageBord,
--- 39,93 ----
protected H2dRefluxBordManager() {}
! public int getFrontiereNb() {
return bordByFrontiere_.length;
}
! public BordParFrontiere getFrontiereBords(int _i) {
return bordByFrontiere_[_i];
}
+ /**
+ * Renvoie le nombre de bord elementaire contenu par ce manager.
+ */
+ public int getTotalBordElementNb() {
+ int r= 0;
+ for (int i= bordByFrontiere_.length - 1; i >= 0; i--) {
+ r += bordByFrontiere_[i].getBordNb();
+ }
+ return r;
+ }
+
+ public H2dRefluxBordIndexGeneral[] getRefluxBord() {
+ int n= bordByFrontiere_.length;
+ ArrayList r= new ArrayList();
+ for (int i= 0; i < n; i++) {
+ r.addAll(bordByFrontiere_[i].getRefluxIndexGeneralBords());
+ }
+ n= r.size();
+ System.out.println("taille des bords reflux "+n);
+ if (n > 0) {
+ H2dRefluxBordIndexGeneral[] rfinal= new H2dRefluxBordIndexGeneral[n];
+ r.toArray(rfinal);
+ return rfinal;
+ }
+ return null;
+ }
+
+ /**
+ * Renvoie le bord en prenant dans l'indice general.
+ */
+ public H2dBord getBordFromGeneralIdx(int _generalIdx) {
+ int n= bordByFrontiere_.length;
+ int shiftL= 0;
+ for (int i= 0; i < n; i++) {
+ if (_generalIdx < (shiftL + bordByFrontiere_[i].getBordNb())) {
+ return bordByFrontiere_[i].getBord(_generalIdx - shiftL);
+ } else {
+ shiftL += bordByFrontiere_[i].getBordNb();
+ }
+ }
+ return null;
+ }
+
public static H2dRefluxBordManager init(
H2dMaillageFrontiere _maillageBord,
***************
*** 46,79 ****
H2dRefluxBordManager r= new H2dRefluxBordManager();
r.maillageBord_= _maillageBord;
!
int ptId;
H2dBordMutable bordEnCours= null;
H2dBordMutable firstBord= null;
r.bordByFrontiere_= new BordParFrontiere[_maillageBord.getBordNb()];
int n= _maillageBord.getBordNb();
! for (int i= 0; i < n; i++) {
! ArrayList bords= new ArrayList();
! bordEnCours= null;
! firstBord= null;
! int nbPt= _maillageBord.getPtNbForBord(i);
! //On prend que les points milieux.
! for (int j= 1; j < nbPt; j += 2) {
! ptId= _maillageBord.getPtIdxForBord(i, j);
! H2dRefluxBordIndexGeneral bord=
! H2dRefluxBordIndexGeneral.findBordWithIndex(ptId, _bordInit);
! H2dBordType bordType=
! bord == null ? H2dBordType.SOLIDE : bord.getBord();
! if (bordEnCours == null) {
! bordEnCours= new H2dBordMutable();
! bordEnCours.setIdxmaillageFrontiere(i);
! bordEnCours.setIdxDeb(j - 1);
! bordEnCours.setIdxFin(j + 1);
! bordEnCours.setType(bordType);
! firstBord= bordEnCours;
! bords.add(bordEnCours);
! } else {
! if (bordType == bordEnCours.getType()) {
! bordEnCours.setIdxFin(j + 1);
! } else {
bordEnCours= new H2dBordMutable();
bordEnCours.setIdxmaillageFrontiere(i);
--- 96,131 ----
H2dRefluxBordManager r= new H2dRefluxBordManager();
r.maillageBord_= _maillageBord;
!
int ptId;
H2dBordMutable bordEnCours= null;
H2dBordMutable firstBord= null;
r.bordByFrontiere_= new BordParFrontiere[_maillageBord.getBordNb()];
+ //le nb de frontiere
int n= _maillageBord.getBordNb();
! //Si des bords sont specifie on traite le tout. Sinon que des bords uniques
! if (_bordInit != null) {
! for (int i= 0; i < n; i++) {
! ArrayList bords= new ArrayList();
! TIntObjectHashMap indexPtMilieuRugosite= new TIntObjectHashMap();
! bordEnCours= null;
! firstBord= null;
! int nbPt= _maillageBord.getPtNbForBord(i);
! //On prend que les points milieux.
! for (int j= 1; j < nbPt; j += 2) {
! ptId= _maillageBord.getPtIdxForBord(i, j);
! H2dRefluxBordIndexGeneral bord=
! H2dRefluxBordIndexGeneral.findBordWithIndex(ptId, _bordInit);
! H2dBordType bordType=
! bord == null ? H2dBordType.SOLIDE : bord.getBord();
! if (bordType == H2dBordType.SOLIDE_FROTTEMENT) {
! System.out.println("bord frottement trouve");
! indexPtMilieuRugosite.put(
! j,
! new BordRugositeValeurs(
! bord.getRugositeType(),
! bord.getRugosite(),
! bord.getRugositeTransitoireCourbe()));
! }
! if (bordEnCours == null) {
bordEnCours= new H2dBordMutable();
bordEnCours.setIdxmaillageFrontiere(i);
***************
*** 81,120 ****
bordEnCours.setIdxFin(j + 1);
bordEnCours.setType(bordType);
bords.add(bordEnCours);
}
}
! }
! if (bordEnCours.getIdxFin() != nbPt) {
! if (_analyze != null) {
! _analyze.addFatalError(
! DodicoLib.geti18n(
! "Détermination des bords impossible :erreur dans les indexs"));
}
! new Throwable().printStackTrace();
! return null;
! } else {
! bordEnCours.setIdxFin(0);
}
! if ((bordEnCours != firstBord)
! && (bordEnCours.getType() == firstBord.getType())) {
! firstBord.setIdxDeb(bordEnCours.getIdxDeb());
! bords.remove(bordEnCours);
}
- r.bordByFrontiere_[i]= r.createFrontiereBord(bords, i);
}
return r;
}
! private BordParFrontiere createFrontiereBord(ArrayList _bords, int _fIdx) {
! return new BordParFrontiere(_bords, _fIdx);
}
public class BordParFrontiere {
! ArrayList bords_;
! int maillageBordIdx_;
! protected BordParFrontiere(ArrayList _bords, int _maillageindex) {
bords_= _bords;
maillageBordIdx_= _maillageindex;
}
--- 133,279 ----
bordEnCours.setIdxFin(j + 1);
bordEnCours.setType(bordType);
+ firstBord= bordEnCours;
bords.add(bordEnCours);
+ } else {
+ if (bordType == bordEnCours.getType()) {
+ bordEnCours.setIdxFin(j + 1);
+ } else {
+ bordEnCours= new H2dBordMutable();
+ bordEnCours.setIdxmaillageFrontiere(i);
+ bordEnCours.setIdxDeb(j - 1);
+ bordEnCours.setIdxFin(j + 1);
+ bordEnCours.setType(bordType);
+ bords.add(bordEnCours);
+ }
}
}
! if (bordEnCours.getIdxFin() != nbPt) {
! if (_analyze != null) {
! _analyze.addFatalError(
! DodicoLib.geti18n(
! "Détermination des bords impossible :erreur dans les indexs"));
! }
! new Throwable().printStackTrace();
! return null;
! } else {
! bordEnCours.setIdxFin(0);
}
! if ((bordEnCours != firstBord)
! && (bordEnCours.getType() == firstBord.getType())) {
! firstBord.setIdxDeb(bordEnCours.getIdxDeb());
! bords.remove(bordEnCours);
! }
! r.bordByFrontiere_[i]=
! r.createFrontiereBord(bords, i, indexPtMilieuRugosite);
}
! //bord unique
! } else {
! for (int i= 0; i < n; i++) {
! r.bordByFrontiere_[i]=
! r.createFrontiereBord(createBordDefautUniqueBord(), i);
}
}
return r;
}
! private static H2dBordMutable createBordDefautUniqueBord() {
! H2dBordMutable r= new H2dBordMutable();
! r.setIdxDeb(0);
! r.setIdxFin(0);
! r.setType(H2dBordType.SOLIDE);
! return r;
! }
!
! private BordParFrontiere createFrontiereBord(
! ArrayList _bords,
! int _fIdx,
! TIntObjectHashMap _indexPtMilieuRugosite) {
! return new BordParFrontiere(_bords, _fIdx, _indexPtMilieuRugosite);
! }
!
! private BordParFrontiere createFrontiereBord(
! H2dBordMutable _bord,
! int _fIdx) {
! return new BordParFrontiere(_bord, _fIdx);
}
public class BordParFrontiere {
! private ArrayList bords_;
! private int maillageBordIdx_;
! private TIntObjectHashMap indexMilieuRugosite_;
! protected BordParFrontiere(
! ArrayList _bords,
! int _maillageindex,
! TIntObjectHashMap _indexPtMilieuRugosite) {
bords_= _bords;
maillageBordIdx_= _maillageindex;
+ if ((_indexPtMilieuRugosite != null)
+ && (_indexPtMilieuRugosite.size() > 0)) {
+ indexMilieuRugosite_= _indexPtMilieuRugosite;
+ }
+ }
+
+ protected BordParFrontiere(H2dBordMutable _m, int _maillageindex) {
+ bords_= new ArrayList(10);
+ bords_.add(_m);
+ maillageBordIdx_= _maillageindex;
+ }
+
+ public List getRefluxIndexGeneralBords() {
+ ArrayList l= new ArrayList();
+ int n= bords_.size();
+ H2dRefluxBordIndexGeneral bidxGene;
+ int[] idx;
+ for (int i= 0; i < n; i++) {
+ H2dBord b= getBord(i);
+ H2dBordType bType= b.getType();
+ if (bType != H2dBordType.SOLIDE) {
+ //cas bord simple
+ if (bType != H2dBordType.SOLIDE_FROTTEMENT) {
+ int deb= b.getIdxDeb();
+ int fin= b.getIdxFin();
+ for (int j= deb; j < fin; j += 2) {
+ bidxGene= new H2dRefluxBordIndexGeneral(bType);
+ idx= new int[3];
+ idx[0]= maillageBord_.getPtIdxForBord(maillageBordIdx_, j);
+ idx[1]= maillageBord_.getPtIdxForBord(maillageBordIdx_, j + 1);
+ idx[2]= maillageBord_.getPtIdxForBord(maillageBordIdx_, j + 2);
+ bidxGene.setIndex(idx);
+ l.add(bidxGene);
+ }
+ //bord avec rugosite
+ } else {
+ int deb= b.getIdxDeb() + 1;
+ int fin= b.getIdxFin();
+ for (int j= deb; j < fin; j += 2) {
+ bidxGene= new H2dRefluxBordIndexGeneral(bType);
+ BordRugositeValeurs v=
+ (BordRugositeValeurs)indexMilieuRugosite_.get(j);
+ if (v == null) {
+ //a voir
+ System.out.println("probleme rugosite non trouve");
+ bidxGene.setRugositeType(H2dClType.PERMANENT);
+ bidxGene.setRugosite(0);
+ } else {
+ bidxGene.setRugositeType(v.getType());
+ bidxGene.setRugosite(v.getValue());
+ bidxGene.setRugositeTransitoireCourbe(v.getEvolution());
+ }
+ idx= new int[3];
+ idx[0]= maillageBord_.getPtIdxForBord(maillageBordIdx_, j - 1);
+ idx[1]= maillageBord_.getPtIdxForBord(maillageBordIdx_, j);
+ idx[2]= maillageBord_.getPtIdxForBord(maillageBordIdx_, j + 1);
+ bidxGene.setIndex(idx);
+ l.add(bidxGene);
+ }
+ }
+ }
+ }
+ return l;
+ }
+
+ public BordRugositeValeurs getRugositeValeurs(int _j) {
+ return (BordRugositeValeurs)indexMilieuRugosite_.get(_j);
}
***************
*** 127,129 ****
}
}
! }
\ No newline at end of file
--- 286,351 ----
}
}
!
! public static class BordRugositeValeurs {
! double value_;
! H2dClType type_;
! H2dEvolution evolution_;
!
! public BordRugositeValeurs(
! H2dClType _t,
! double _value,
! H2dEvolution _evol) {
! setType(_t);
! setValue(_value);
! setEvolution(_evol);
! }
!
! /**
! *
! */
! public H2dEvolution getEvolution() {
! return evolution_;
! }
!
! /**
! *
! */
! public H2dClType getType() {
! return type_;
! }
!
! /**
! *
! */
! public double getValue() {
! return value_;
! }
!
! /**
! *
! */
! protected final void setEvolution(H2dEvolution _evolution) {
! if (type_ == H2dClType.TRANSITOIRE)
! evolution_= _evolution;
! }
!
! /**
! *
! */
! protected final void setType(H2dClType _type) {
! type_= _type;
! if ((type_ == H2dClType.PERMANENT) || (type_ == H2dClType.LIBRE)) {
! evolution_= null;
! }
! }
!
! /**
! *
! */
! protected final void setValue(double _d) {
! if (type_ == H2dClType.PERMANENT)
! value_= _d;
! }
!
! }
! }
Index: H2dRefluxConditionLimite.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxConditionLimite.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dRefluxConditionLimite.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dRefluxConditionLimite.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 12,15 ****
--- 12,16 ----
import org.fudaa.dodico.h2d.H2dEvolution;
import org.fudaa.dodico.h2d.type.H2dClType;
+ import org.fudaa.dodico.h2d.type.H2dVariableType;
/**
***************
*** 26,32 ****
H2dEvolution qTransitoireCourbe_;
double q_;
- double rugosite_;
- H2dClType rugositeType_;
- H2dEvolution rugositeTransitoireCourbe_;
/**
--- 27,30 ----
***************
*** 41,44 ****
--- 39,54 ----
}
+ public H2dEvolution getEvolution(H2dVariableType _v) {
+ if (_v == H2dVariableType.VITESSE_U)
+ return uTransitoireCourbe_;
+ else if (_v == H2dVariableType.VITESSE_V)
+ return vTransitoireCourbe_;
+ else if (_v == H2dVariableType.COTE_EAU)
+ return hTransitoireCourbe_;
+ else if (_v == H2dVariableType.DEBIT)
+ return qTransitoireCourbe_;
+ return null;
+ }
+
/**
*
***************
*** 88,112 ****
public H2dEvolution getQTransitoireCourbe() {
return qTransitoireCourbe_;
- }
-
- /**
- * 1/Strickler
- */
- public double getRugosite() {
- return rugosite_;
- }
-
- /**
- *
- */
- public H2dEvolution getRugositeTransitoireCourbe() {
- return rugositeTransitoireCourbe_;
- }
-
- /**
- *
- */
- public H2dClType getRugositeType() {
- return rugositeType_;
}
--- 98,101 ----
Index: H2dRefluxConditionLimiteMutable.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxConditionLimiteMutable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dRefluxConditionLimiteMutable.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dRefluxConditionLimiteMutable.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 144,172 ****
}
- /**
- *
- */
- public void setRugosite(double _d)
- {
- rugosite_ = _d;
- }
-
- /**
- *
- */
- public void setRugositeTransitoireCourbe(H2dEvolution _evolution)
- {
- rugositeTransitoireCourbe_ = _evolution;
- }
-
- /**
- *
- */
- public void setRugositeType(H2dClType _type)
- {
- rugositeType_ = _type;
- }
-
-
-
}
--- 144,146 ----
Index: H2dRefluxParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxParametres.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dRefluxParametres.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dRefluxParametres.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 19,30 ****
--- 19,36 ----
import org.fudaa.dodico.h2d.H2dBordMutable;
import org.fudaa.dodico.h2d.H2dConditionLimite;
+ import org.fudaa.dodico.h2d.H2dGroupePasTemps;
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.H2dParametres;
+ import org.fudaa.dodico.h2d.H2dProprieteElementaire;
import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.reflux.io.INPInterface;
/**
+ * Classe contenant les parametres de base.
+ * Notation:
+ * cl: condition limite
+ * pn: propriete nodale.
* @author deniger
* @version $Id$
***************
*** 33,36 ****
--- 39,44 ----
H2dRefluxConditionLimite[] cls_;
+ H2dGroupePasTemps[] gptTemps_;
+ H2dProprieteElementaire[] propEls_;
DicoParams dicoParams_;
H2dRefluxBordManager bords_;
***************
*** 46,53 ****
--- 54,111 ----
return dicoParams_;
}
+
+ public INPFileFormat.INPVersion getVersion(){
+ return (INPFileFormat.INPVersion)dicoParams_.getDicoFileFormatVersion();
+ }
public H2dRefluxConditionLimite getRefluxCL(int _bordIdx) {
return cls_[_bordIdx];
}
+
+ public H2dRefluxConditionLimite[] getRefluxClTableau(){
+ H2dRefluxConditionLimite[] r=new H2dRefluxConditionLimite[cls_.length];
+ System.arraycopy(cls_, 0, r, 0, cls_.length);
+ return r;
+ }
+
+ public int getProprietesElementairesNb(){
+ return propEls_.length;
+ }
+
+ public H2dProprieteElementaire getProprieteElementaire(int _i){
+ return propEls_[_i];
+ }
+
+ public H2dProprieteElementaire[] getProprieteElementaireTab(){
+ H2dProprieteElementaire[] r=new H2dProprieteElementaire[propEls_.length];
+ System.arraycopy(propEls_, 0, r, 0, propEls_.length);
+ return r;
+ }
+
+
+ public int getGroupePasTempsNb(){
+ return gptTemps_.length;
+ }
+
+ public H2dGroupePasTemps getGroupePasTemps(int _i){
+ return gptTemps_[_i];
+ }
+
+ public H2dGroupePasTemps[] getGroupePasTempsTab(){
+ H2dGroupePasTemps[] r=new H2dGroupePasTemps[gptTemps_.length];
+ System.arraycopy(gptTemps_, 0, r, 0, gptTemps_.length);
+ return r;
+ }
+
+
+ //DEBUG A Continuer
+ public boolean contientPnTransitoire(){
+ return false;
+ }
+
+ //DEBUG A Continuer
+ public boolean contientClTransitoire(){
+ return false;
+ }
public static H2dRefluxParametres init(
***************
*** 63,71 ****
H2dRefluxParametres r= new H2dRefluxParametres(_inter.getMaillage());
r.dicoParams_= new DicoParams(_inter.getEntiteValue(), _ft);
H2dRefluxConditionLimite[] initCl= _inter.getConditionLimite();
if (_prog != null) {
_prog.setProgression(20);
}
! Arrays.sort(initCl, new H2dConditionLimite.ComparatorIdxPt());
int[] ptFrontiereIdx= r.maillage_.getPtsFrontiere().getArray();
if (ptFrontiereIdx.length != initCl.length) {
--- 121,135 ----
H2dRefluxParametres r= new H2dRefluxParametres(_inter.getMaillage());
r.dicoParams_= new DicoParams(_inter.getEntiteValue(), _ft);
+
+ //Classement de cl
H2dRefluxConditionLimite[] initCl= _inter.getConditionLimite();
if (_prog != null) {
_prog.setProgression(20);
}
! if (initCl == null) {
! _analyze.addFatalError(DodicoLib.geti18n("Conditions limites nulles"));
! return null;
! }
!
int[] ptFrontiereIdx= r.maillage_.getPtsFrontiere().getArray();
if (ptFrontiereIdx.length != initCl.length) {
***************
*** 94,97 ****
--- 158,163 ----
_prog.setProgression(60);
}
+
+ //Classement de bord
r.bords_=
H2dRefluxBordManager.init(
***************
*** 99,102 ****
--- 165,176 ----
_inter.getBords(),
_analyze);
+
+ //sauv des prop elementaires
+ r.propEls_=_inter.getPropElementaires();
+
+ //sauv groupe pas de temps
+ r.gptTemps_=_inter.getGroupePasTemps();
+
+
if (_prog != null) {
_prog.setProgression(100);
Index: H2dRefluxSourceInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxSourceInterface.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dRefluxSourceInterface.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dRefluxSourceInterface.java 2 Sep 2003 08:37:23 -0000 1.2
***************
*** 47,56 ****
/**
*/
! public int getNbCLTransitoires();
/**
* @return
*/
! public int getNbPNTransitoires();
/**
*
--- 47,56 ----
/**
*/
! // public int getNbCLTransitoires();
/**
* @return
*/
! //public int getNbPNTransitoires();
/**
*
***************
*** 76,80 ****
/**
! *
*/
public H2dRefluxConditionLimite[] getConditionLimite();
--- 76,80 ----
/**
! * Renvoie les conditions limites rangees dans l'ordre des indices.
*/
public H2dRefluxConditionLimite[] getConditionLimite();
--- H2dRefluxParametresCalcul.java DELETED ---
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv7810/tr/telemac
Modified Files:
TrDicoProjet.java TrTelemacImplHelper.java
TrTelemacParametres.java TrTelemacProjet.java
Added Files:
TrTelemacExport.java TrTelemacFilleVisu.java
Log Message:
tr: ajout de l'export pour le maillage
gestion affichage maillage
commun modif mineure
--- NEW FILE: TrTelemacExport.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: TrTelemacFilleVisu.java ---
(This appears to be a binary file; contents omitted.)
Index: TrDicoProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrDicoProjet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TrDicoProjet.java 19 Aug 2003 07:48:40 -0000 1.3
--- TrDicoProjet.java 22 Aug 2003 16:02:24 -0000 1.4
***************
*** 15,18 ****
--- 15,19 ----
import org.fudaa.dodico.dico.DicoCasFileFormatVersion;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
+ import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat;
import org.fudaa.fudaa.dico.FDicoParams;
***************
*** 65,69 ****
public String getID()
{
! return FileFormatSoftware.DICO_IS.name;
}
--- 66,70 ----
public String getID()
{
! return TelemacDicoFileFormat.DICO_PROJET_ID;
}
Index: TrTelemacImplHelper.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacImplHelper.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrTelemacImplHelper.java 19 Aug 2003 07:48:40 -0000 1.4
--- TrTelemacImplHelper.java 22 Aug 2003 16:02:26 -0000 1.5
***************
*** 17,24 ****
--- 17,27 ----
import org.fudaa.dodico.dico.DicoCasFileFormat;
import org.fudaa.dodico.dico.DicoCasFileFormatVersion;
+ import org.fudaa.dodico.dico.DicoLanguage;
import org.fudaa.dodico.dico.DicoModelAbstract;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
+ import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.telemac.TelemacDicoManager;
import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
+ import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat;
import org.fudaa.fudaa.dico.FDicoChooserPanel;
***************
*** 31,93 ****
* @version $Id$
*/
! public class TrTelemacImplHelper extends TrImplHelper
! {
! public TrTelemacImplHelper(TrImplementation _impl)
! {
super(_impl);
}
! public void ouvrir(File _f)
! {
_ouvrir(_f);
}
! public void ouvrir()
! {
! final File fic = impl_.ouvrirFileChooser(null, "Télémac Fichier cas");
! if (fic != null)
! {
_ouvrir(fic);
}
}
! private void _ouvrir(final File _fic)
! {
! if (_fic != null)
! {
! new BuTaskOperation(impl_, "import fichier cas")
! {
! public void act()
! {
! TrTelemacProjet projet =
! TrTelemacProjet.init(
! _fic,
! (Telemac2dFileFormat.TelemacVersion)Telemac2dFileFormat.getInstance().getLastVersionImpl(),
! new ProgressionBuAdapter(this),
! getImpl());
! setProgression(90);
! if (projet != null)
! {
! getImpl().addProjet(projet);
}
}
}
- .start();
}
! }
! public void ouvrirDico()
! {
! FDicoChooserPanel s=new FDicoChooserPanel(TelemacDicoManager.getINSTANCE());
! int r = s.afficheModale(impl_.getFrame(), "Choix fichier dico");
! if (s.isOkResponse(r))
! {
! _ouvrir(
s.getSelectedFile(),
! s.getFileFormatSelected(),
! s.getVersionSelected(),
! s.getLanguageSelected());
}
--- 34,93 ----
* @version $Id$
*/
! public class TrTelemacImplHelper extends TrImplHelper {
! public TrTelemacImplHelper(TrImplementation _impl) {
super(_impl);
}
! public void ouvrir(File _f) {
_ouvrir(_f);
}
! public void ouvrir() {
! final File fic= impl_.ouvrirFileChooser(null, "Télémac Fichier cas");
! if (fic != null) {
_ouvrir(fic);
}
}
! private void _ouvrir(final File _fic) {
! _ouvrir(_fic,DicoLanguage.getCurrentID());
! }
!
! private void _ouvrir(final File _fic,final int _language) {
! if (_fic != null) {
! new BuTaskOperation(impl_, "import fichier cas") {
! public void act() {
! TrTelemacProjet projet=
! TrTelemacProjet.init(
! _fic,
! (Telemac2dFileFormat.TelemacVersion)Telemac2dFileFormat
! .getInstance()
! .getLastVersionImpl(_language),
! new ProgressionBuAdapter(this),
! getImpl());
! setProgression(90);
! if (projet != null) {
! getImpl().addProjet(projet);
! }
}
}
+ .start();
}
}
!
!
! public void ouvrirDico() {
! FDicoChooserPanel s=
! new FDicoChooserPanel(TelemacDicoManager.getINSTANCE());
! int r= s.afficheModale(impl_.getFrame(), "Choix fichier dico");
! if (s.isOkResponse(r)) {
! _ouvrir(
s.getSelectedFile(),
! s.getFileFormatSelected(),
! s.getVersionSelected(),
! s.getLanguageSelected());
}
***************
*** 99,125 ****
final DicoCasFileFormat _ft,
final String _v,
! final int _language)
! {
! if (_fic != null)
! {
! new BuTaskOperation(impl_, "import fichier cas pour " + _ft.getName())
! {
! public void act()
! {
! DicoCasFileFormatVersion version=_ft.getVersionImpl(_v,_language);
!
! DicoModelAbstract m =_ft.getLastVersionImpl().getDico();
if (m == null)
getImpl().error(
"INTERNE Impossible de créer le modele du dictionnaire");
! else
! {
! TrDicoProjet projet = TrDicoProjet.init(_fic,version,new ProgressionBuAdapter(this), getImpl());
! setProgression(90);
! if (projet != null)
! {
! getImpl().addProjet(projet);
! }
}
}
}
--- 99,127 ----
final DicoCasFileFormat _ft,
final String _v,
! final int _language) {
! if (_fic != null) {
! if(_ft==Telemac2dFileFormat.getInstance()){
! _ouvrir(_fic, _language);
! return;
! }
! new BuTaskOperation(impl_, "import fichier cas pour " + _ft.getName()) {
! public void act() {
! DicoCasFileFormatVersion version= _ft.getVersionImpl(_v, _language);
! DicoModelAbstract m= version.getDico();
if (m == null)
getImpl().error(
"INTERNE Impossible de créer le modele du dictionnaire");
! else {
! TrDicoProjet projet=
! TrDicoProjet.init(
! _fic,
! version,
! new ProgressionBuAdapter(this),
! getImpl());
! setProgression(90);
! if (projet != null) {
! getImpl().addProjet(projet);
}
+ }
}
}
***************
*** 131,136 ****
*
*/
! public String getID()
! {
return FileFormatSoftware.TELEMAC_IS.name;
}
--- 133,137 ----
*
*/
! public String getSoftwareID() {
return FileFormatSoftware.TELEMAC_IS.name;
}
***************
*** 139,151 ****
*
*/
! public BuMenuItem[] getMenuItemsOuvrir()
! {
! BuMenuItem r0 = new BuMenuItem("Projet dico");
! r0.setActionCommand(impl_.PREF_OUVRIR + FileFormatSoftware.TELEMAC_IS.name);
! BuMenuItem r =
new BuMenuItem(
FudaaResource.FUDAA.getToolIcon("appli/reflux"),
"Projet Reflux");
! r.setActionCommand(impl_.PREF_OUVRIR + FileFormatSoftware.TELEMAC_IS.name);
return new BuMenuItem[] { r0, r };
}
--- 140,153 ----
*
*/
! public BuMenuItem[] getMenuItemsOuvrir() {
! BuMenuItem r0= new BuMenuItem("Projet dico");
! r0.setActionCommand(
! impl_.PREF_OUVRIR
! + TelemacDicoFileFormat.DICO_PROJET_ID);
! BuMenuItem r=
new BuMenuItem(
FudaaResource.FUDAA.getToolIcon("appli/reflux"),
"Projet Reflux");
! r.setActionCommand(impl_.PREF_OUVRIR + FileFormatSoftware.REFLUX_IS.name);
return new BuMenuItem[] { r0, r };
}
Index: TrTelemacParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacParametres.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrTelemacParametres.java 19 Aug 2003 07:48:40 -0000 1.4
--- TrTelemacParametres.java 22 Aug 2003 16:02:26 -0000 1.5
***************
*** 12,24 ****
import java.util.Map;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormatVersion;
import org.fudaa.dodico.dico.DicoCasInterface;
import org.fudaa.dodico.dico.DicoEntiteFile;
- import org.fudaa.dodico.dunes.io.DunesInterface;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dParametres;
! import org.fudaa.dodico.reflux.io.CorEleBthInterface;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
--- 12,26 ----
import java.util.Map;
+ import com.memoire.bu.BuMainPanel;
+
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormatVersion;
import org.fudaa.dodico.dico.DicoCasInterface;
import org.fudaa.dodico.dico.DicoEntiteFile;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dParametres;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacParametres;
! import org.fudaa.dodico.telemac.io.SerafinAdapter;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
***************
*** 27,33 ****
import org.fudaa.dodico.telemac.io.TelemacLiquideInterface;
- import org.fudaa.fudaa.commun.FudaaUI;
import org.fudaa.fudaa.dico.FDicoParams;
import org.fudaa.fudaa.tr.TrLib;
/**
--- 29,37 ----
import org.fudaa.dodico.telemac.io.TelemacLiquideInterface;
import org.fudaa.fudaa.dico.FDicoParams;
+ import org.fudaa.fudaa.tr.TrImplementation;
import org.fudaa.fudaa.tr.TrLib;
+ import org.fudaa.fudaa.tr.TrParametres;
+ import org.fudaa.fudaa.tr.TrThreadListener;
/**
***************
*** 35,48 ****
* @version $Id$
*/
! public class TrTelemacParametres extends FDicoParams implements H2dParametres{
! H2dMaillage maillage_;
protected TrTelemacParametres(
File _file,
DicoCasFileFormatVersion _ft,
! Map _initialSetValues,
! long _timeloaded) {
! super(_file, _ft, _initialSetValues, _timeloaded);
}
--- 39,53 ----
* @version $Id$
*/
! public class TrTelemacParametres extends FDicoParams implements TrParametres {
! H2dTelemacParametres params_;
! boolean geometrieLoaded_;
! boolean allLoaded_;
protected TrTelemacParametres(
File _file,
DicoCasFileFormatVersion _ft,
! Map _initialSetValues) {
! super(_file, _ft, _initialSetValues);
}
***************
*** 51,59 ****
Telemac2dFileFormat.TelemacVersion _ft,
ProgressionInterface _progress,
! FudaaUI _ui) {
! FileOperationSynthese op= new FileOperationSynthese();
! DicoCasInterface inter= _ft.readCas(_file, op, _progress);
if (_ui != null)
! _ui.manageErrorOperation(op);
if (inter == null)
return null;
--- 56,64 ----
Telemac2dFileFormat.TelemacVersion _ft,
ProgressionInterface _progress,
! TrImplementation _ui) {
! FileOperationSynthese op= _ft.read(_file, _progress);
! DicoCasInterface inter= (DicoCasInterface)op.getSource();
if (_ui != null)
! _ui.manageErrorOperationAndIsFatal(op);
if (inter == null)
return null;
***************
*** 66,81 ****
}
TrTelemacParametres r=
! new TrTelemacParametres(_file, _ft, inter.getInputs(), op.getOpTime());
r.setUI(_ui);
return r;
}
- public CorEleBthInterface createCorEleBthInterface(ProgressionInterface _prog) {
- CorEleBthInterface r= null;
- if (maillage_ == null)
- loadGeometrie(_prog);
- return r;
- }
-
public boolean isValide() {
return dicoParams_.isValide();
--- 71,79 ----
}
TrTelemacParametres r=
! new TrTelemacParametres(_file, _ft, inter.getInputs());
r.setUI(_ui);
return r;
}
public boolean isValide() {
return dicoParams_.isValide();
***************
*** 90,107 ****
}
! public boolean loadAll(ProgressionInterface _prg) {
! return loadGeometrie(_prg)
! && loadConditionsLimite(_prg)
! && loadConditionsLimiteLiquide(_prg);
}
! public boolean loadGeometrie(ProgressionInterface _prg) {
! if (maillage_ != null) {
ui_.error(
"Maillage deja present",
TrLib.geti18n("Un maillage est déjà présent."));
! return false;
}
-
DicoEntiteFile entFile=
dicoParams_.getFileEntite(
--- 88,135 ----
}
! private void _loadAll(ProgressionInterface _prg) {
! loadGeometrie(_prg);
! loadConditionsLimite(_prg);
! loadConditionsLimiteLiquide(_prg);
!
}
! public void loadGeometrie(ProgressionInterface _prg) {
! loadGeometrie(_prg, null);
! }
!
! public void loadAll(ProgressionInterface _prg) {
! loadAll(_prg, null);
! }
!
! public synchronized void loadGeometrie(
! ProgressionInterface _prg,
! TrThreadListener _th) {
! if (!geometrieLoaded_) {
! _loadGeometrie(_prg);
! geometrieLoaded_= true;
! }
! if (_th != null)
! _th.threadIsFinish();
! }
!
! public synchronized void loadAll(
! ProgressionInterface _prg,
! TrThreadListener _th) {
! if (!allLoaded_) {
! _loadAll(_prg);
! allLoaded_= true;
! }
! if (_th != null)
! _th.threadIsFinish();
! }
!
! public synchronized void _loadGeometrie(ProgressionInterface _prg) {
! if (params_ != null) {
ui_.error(
"Maillage deja present",
TrLib.geti18n("Un maillage est déjà présent."));
! return;
}
DicoEntiteFile entFile=
dicoParams_.getFileEntite(
***************
*** 111,125 ****
"Fichier de maillage",
TrLib.geti18n("Définition du fichier géométrie non trouvée."));
! return false;
}
! FileOperationSynthese op= new FileOperationSynthese();
! SerafinInterface sInter=
getTelemacFileFormatVersion().getDefaultSerafinFormat().read(
getFile(entFile),
- op,
_prg);
! ui_.manageErrorOperation(op);
if (sInter == null)
! return false;
String fond=
getTelemacFileFormatVersion().getDefaultSerafinFormat().getVariableFond();
--- 139,157 ----
"Fichier de maillage",
TrLib.geti18n("Définition du fichier géométrie non trouvée."));
! return;
}
! BuMainPanel pn= ((TrImplementation)ui_).getMainPanel();
! pn.setMessage("Lecture maillage");
! FileOperationSynthese op=
getTelemacFileFormatVersion().getDefaultSerafinFormat().read(
getFile(entFile),
_prg);
! SerafinInterface sInter= (SerafinInterface)op.getSource();
! ui_.manageErrorOperationAndIsFatal(op);
!
if (sInter == null)
! return;
! pn.setProgression(50);
! pn.setMessage("Recherche variable fond");
String fond=
getTelemacFileFormatVersion().getDefaultSerafinFormat().getVariableFond();
***************
*** 128,132 ****
//pour l'instant
ui_.error("Maillage", "bathymétrie non trouvée variable FOND ou es-tu ?");
! return false;
}
int nbPasTemps= sInter.getNbPasDeTemps();
--- 160,164 ----
//pour l'instant
ui_.error("Maillage", "bathymétrie non trouvée variable FOND ou es-tu ?");
! return;
}
int nbPasTemps= sInter.getNbPasDeTemps();
***************
*** 134,148 ****
System.out.println("la variable à t=0 sera prise");
}
! //DEBUG A CONTINUER
! // double[] fondValues = sInter.getDonnees(0, numVariable);
! // projet_.maillage = sInter.getMaillage();
! // return H2dLib.setBathymetrie(projet_.maillage, fondValues);
! maillage_= sInter.getMaillage();
! H2dMaillage.computeBord(maillage_, sInter.getPtsFrontiere(), _prg);
!
! return true;
}
! public boolean loadConditionsLimite(ProgressionInterface _prg) {
DicoEntiteFile entFile=
dicoParams_.getFileEntite(
--- 166,182 ----
System.out.println("la variable à t=0 sera prise");
}
! SerafinAdapter.majFond(sInter, numVariable, 0);
! pn.setProgression(70);
! pn.setMessage("Recherche des bords");
! H2dMaillage.computeBord(
! sInter.getMaillage(),
! sInter.getPtsFrontiere(),
! _prg);
! params_= new H2dTelemacParametres(sInter.getMaillage());
! pn.setProgression(0);
! return;
}
! private boolean loadConditionsLimite(ProgressionInterface _prg) {
DicoEntiteFile entFile=
dicoParams_.getFileEntite(
***************
*** 155,165 ****
return false;
}
! FileOperationSynthese op= new FileOperationSynthese();
! TelemacCLInterface inter=
getTelemacFileFormatVersion().getDefaultTelemacCLFormat().read(
getFile(entFile),
- op,
_prg);
! ui_.manageErrorOperation(op);
if (inter == null)
return false;
--- 189,198 ----
return false;
}
! FileOperationSynthese op=
getTelemacFileFormatVersion().getDefaultTelemacCLFormat().read(
getFile(entFile),
_prg);
! TelemacCLInterface inter= (TelemacCLInterface)op.getSource();
! ui_.manageErrorOperationAndIsFatal(op);
if (inter == null)
return false;
***************
*** 180,184 ****
}
! public boolean loadConditionsLimiteLiquide(ProgressionInterface _prg) {
DicoEntiteFile entFile=
dicoParams_.getFileEntite(
--- 213,217 ----
}
! private boolean loadConditionsLimiteLiquide(ProgressionInterface _prg) {
DicoEntiteFile entFile=
dicoParams_.getFileEntite(
***************
*** 191,201 ****
return false;
}
! FileOperationSynthese op= new FileOperationSynthese();
! TelemacLiquideInterface inter=
getTelemacFileFormatVersion().getDefaultTelemacLiquideFormat().read(
getFile(entFile),
- op,
_prg);
! ui_.manageErrorOperation(op);
if (inter == null)
return false;
--- 224,233 ----
return false;
}
! FileOperationSynthese op=
getTelemacFileFormatVersion().getDefaultTelemacLiquideFormat().read(
getFile(entFile),
_prg);
! TelemacLiquideInterface inter= (TelemacLiquideInterface)op.getSource();
! ui_.manageErrorOperationAndIsFatal(op);
if (inter == null)
return false;
***************
*** 205,209 ****
}
! public boolean loadFond(ProgressionInterface _prg) {
ui_.error("Programme", "non supporté pour l'instant");
return false;
--- 237,241 ----
}
! private boolean loadFond(ProgressionInterface _prg) {
ui_.error("Programme", "non supporté pour l'instant");
return false;
***************
*** 213,218 ****
return getMainFile();
}
-
-
/**
--- 245,248 ----
***************
*** 221,225 ****
*/
public H2dMaillage getMaillage() {
! return maillage_;
}
--- 251,279 ----
*/
public H2dMaillage getMaillage() {
! if (params_ == null)
! return null;
! return params_.getMaillage();
! }
!
! public H2dTelemacParametres getTelemacParametres() {
! return params_;
! }
!
! public H2dParametres getParametres() {
! return getTelemacParametres();
! }
!
! /**
! *
! */
! public boolean isAllLoaded() {
! return allLoaded_;
! }
!
! /**
! *
! */
! public boolean isGeometrieLoaded() {
! return geometrieLoaded_;
}
Index: TrTelemacProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacProjet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrTelemacProjet.java 19 Aug 2003 07:48:40 -0000 1.4
--- TrTelemacProjet.java 22 Aug 2003 16:02:26 -0000 1.5
***************
*** 9,16 ****
package org.fudaa.fudaa.tr.telemac;
import java.io.File;
import org.fudaa.dodico.commun.ProgressionInterface;
- import org.fudaa.dodico.dunes.io.DunesInterface;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
--- 9,25 ----
package org.fudaa.fudaa.tr.telemac;
+ import java.awt.Dimension;
+ import java.awt.event.ActionEvent;
import java.io.File;
+ import javax.swing.JButton;
+ import javax.swing.JMenuBar;
+
+ import com.memoire.bu.BuButton;
+ import com.memoire.bu.BuResource;
+ import com.memoire.bu.BuTaskOperation;
+
+ import org.fudaa.dodico.commun.ProgressionBuAdapter;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
***************
*** 19,25 ****
import org.fudaa.fudaa.dico.FDicoParams;
import org.fudaa.fudaa.dico.FDicoProjetAbstract;
- import org.fudaa.fudaa.tr.TrExport;
import org.fudaa.fudaa.tr.TrImplementation;
import org.fudaa.fudaa.tr.TrProjet;
/**
--- 28,34 ----
import org.fudaa.fudaa.dico.FDicoParams;
import org.fudaa.fudaa.dico.FDicoProjetAbstract;
import org.fudaa.fudaa.tr.TrImplementation;
import org.fudaa.fudaa.tr.TrProjet;
+ import org.fudaa.fudaa.tr.TrThreadListener;
/**
***************
*** 29,32 ****
--- 38,42 ----
public class TrTelemacProjet extends FDicoProjetAbstract implements TrProjet {
TrTelemacParametres params_;
+ TrTelemacFilleVisu visu_;
public TrTelemacProjet(TrTelemacParametres _params, TrImplementation _impl) {
***************
*** 59,62 ****
--- 69,82 ----
}
+ protected void buildEntiteFille() {
+ super.buildEntiteFille();
+ JMenuBar menu= entiteFille_.getJMenuBar();
+ JButton bt= new BuButton("Visualiser");
+ bt.addActionListener(this);
+ bt.setIcon(BuResource.BU.getIcon("voir"));
+ bt.setActionCommand("VOIR");
+ menu.add(bt);
+ }
+
/**
*
***************
*** 72,80 ****
return params_.getFDicoParams();
}
!
/**
*
*/
! public void export(String _actionCommand) {new TrExport(params_).export(_actionCommand);}
}
--- 92,146 ----
return params_.getFDicoParams();
}
!
! private void activeVisu() {
! if (visu_ == null) {
! if (!params_.isAllLoaded()) {
! final TrThreadListener l= new TrThreadListener() {
! public void threadIsFinish() {
! initVisu();
! }
! };
! new BuTaskOperation(getImpl(),"Chargement fichiers"){
! public void act()
! {
! params_.loadAll(new ProgressionBuAdapter(this), l);
! }
! }.start();
! }
! else initVisu();
!
! } else
! getImpl().activateInternalFrame(visu_);
! }
!
! void initVisu() {
! if (visu_ != null)
! return;
! visu_=
! new TrTelemacFilleVisu(
! (TrImplementation)getImpl(),
! params_.getTelemacParametres());
! Dimension dim= getImpl().getMainPanel().getDesktop().getSize();
! visu_.setSize((int) (dim.getWidth() * 0.8), (int) (dim.getHeight() * 0.8));
! visu_.setLocation(10, 10);
! getImpl().addInternalFrame(visu_);
! }
!
/**
*
*/
! public void export(String _actionCommand) {
! new TrTelemacExport(params_).export(_actionCommand);
! }
!
! /**
! *
! */
! public void actionPerformed(ActionEvent e) {
! if ("VOIR".equals(e.getActionCommand())) {
! activeVisu();
! } else
! super.actionPerformed(e);
! }
}
|
|
From: <de...@us...> - 2003-08-23 03:52:30
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/commun
Modified Files:
DodicoAnalyze.java DodicoLib.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
Index: DodicoAnalyze.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoAnalyze.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DodicoAnalyze.java 4 Jul 2003 08:11:42 -0000 1.4
--- DodicoAnalyze.java 22 Aug 2003 15:51:11 -0000 1.5
***************
*** 20,30 ****
* Cette classe sert a transmettre les informations d'une operation de lecture
* ou d'ecriture. Les informations et les erreurs de l'operation sont stockées
! * avec eventuellement leur numero de ligne et un identifiant ( a modifier ...).
*
* @author deniger
* @version $Id$
*/
! public class DodicoAnalyze
! {
private DodicoAnalyze.Field[] errors_;
[...1054 lines suppressed...]
*
*/
! public void setDesc(String _string) {
desc_= _string;
+ }
+
+ /**
+ *
+ */
+ public String getResource() {
+ return ressource_;
+ }
+
+ /**
+ *
+ */
+ public void setResource(String _string) {
+ ressource_= _string;
}
Index: DodicoLib.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoLib.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** DodicoLib.java 18 Aug 2003 11:05:19 -0000 1.10
--- DodicoLib.java 22 Aug 2003 15:51:11 -0000 1.11
***************
*** 65,68 ****
--- 65,69 ----
public final static String DIX= "10";
public final static String SEP_LINE= "\n";
+ public final static String ESPACE= " ";
private DodicoLib() {}
***************
*** 640,643 ****
--- 641,653 ----
Arrays.sort(rf);
return rf;
+ }
+
+
+ public static int findInt(int[] _array,int _intToSearch){
+ int n=_array.length-1;
+ for (int i= n; i >= 0; i--) {
+ if(_array[i]==_intToSearch) return i;
+ }
+ return -1;
}
|
|
From: <de...@us...> - 2003-08-23 02:40:22
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/h2d
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/test/h2d
Modified Files:
TestMaillage.java
Added Files:
TestTransformationCorEleBthSerafin.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
--- NEW FILE: TestTransformationCorEleBthSerafin.java ---
(This appears to be a binary file; contents omitted.)
Index: TestMaillage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/h2d/TestMaillage.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestMaillage.java 18 Aug 2003 11:05:20 -0000 1.3
--- TestMaillage.java 22 Aug 2003 15:51:13 -0000 1.4
***************
*** 19,23 ****
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dMaillage;
! import org.fudaa.dodico.h2d.H2dMaillageBord;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dSegment;
--- 19,23 ----
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dMaillage;
! import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dSegment;
***************
*** 53,57 ****
}
! private void initMaillage() {
H2dPoint[] pts= new H2dPoint[9];
pts[0]= new H2dPoint(0, 0, 15);
--- 53,57 ----
}
! public static H2dMaillage createMaillage() {
H2dPoint[] pts= new H2dPoint[9];
pts[0]= new H2dPoint(0, 0, 15);
***************
*** 74,81 ****
elt[7]= new H2dElement(new int[] { 7, 8, 5 });
elt[8]= new H2dElement(new int[] { 6, 5, 8 });
! mail_= new H2dMaillage(pts, elt);
}
private void initMaillageT6() {
H2dPoint[] pts= new H2dPoint[27];
pts[0]= new H2dPoint(0, 0, 15);
--- 74,90 ----
elt[7]= new H2dElement(new int[] { 7, 8, 5 });
elt[8]= new H2dElement(new int[] { 6, 5, 8 });
! return new H2dMaillage(pts, elt);
!
}
+ private void initMaillage() {
+ mail_= createMaillage();
+ }
+
private void initMaillageT6() {
+ mail_=createMaillageT6();
+ }
+
+ public static H2dMaillage createMaillageT6() {
H2dPoint[] pts= new H2dPoint[27];
pts[0]= new H2dPoint(0, 0, 15);
***************
*** 145,150 ****
elt[7]= new H2dElement(new int[] { 7, 24, 8, 25, 5, 22 });
elt[8]= new H2dElement(new int[] { 6, 18, 5, 25, 8, 26 });
! mail_= new H2dMaillage(pts, elt);
!
}
--- 154,158 ----
elt[7]= new H2dElement(new int[] { 7, 24, 8, 25, 5, 22 });
elt[8]= new H2dElement(new int[] { 6, 18, 5, 25, 8, 26 });
! return new H2dMaillage(pts, elt);
}
***************
*** 211,215 ****
public void _testBordCommun() {
! H2dMaillageBord bord= mail_.getPtsFrontiere();
assertEquals(bord.getBordNb(), 2);
int[] eltContains4= mail_.getEltIdxContainsPtIdx(4);
--- 219,223 ----
public void _testBordCommun() {
! H2dMaillageFrontiere bord= mail_.getPtsFrontiere();
assertEquals(bord.getBordNb(), 2);
int[] eltContains4= mail_.getEltIdxContainsPtIdx(4);
***************
*** 235,252 ****
}
-
- public void testBordV2() {
- initMaillage();
- mail_.computeBordV2(null);
- _testBordCommun();
- }
-
- public void testBordV2T6() {
- initMaillageT6();
- mail_.computeBordV2(null);
- _testBordCommunT6();
- }
-
-
public void testBord() {
initMaillage();
--- 243,246 ----
***************
*** 262,266 ****
public void _testBordCommunT6() {
! H2dMaillageBord bord= mail_.getPtsFrontiere();
assertEquals(bord.getBordNb(), 2);
int[] eltContains4= mail_.getEltIdxContainsPtIdx(4);
--- 256,260 ----
public void _testBordCommunT6() {
! H2dMaillageFrontiere bord= mail_.getPtsFrontiere();
assertEquals(bord.getBordNb(), 2);
int[] eltContains4= mail_.getEltIdxContainsPtIdx(4);
***************
*** 360,365 ****
--- 354,361 ----
initMaillageT6();
TIntIntHashMap T6T3Corresp= new TIntIntHashMap(mail_.getPtsNb() / 2);
+ System.out.println("element type " + mail_.getEltType());
H2dMaillage temp= mail_.maillageT6enT3(progress_, T6T3Corresp);
+ assertNotNull(temp);
temp.isSame(mail_);
assertEquals(9, T6T3Corresp.size());
***************
*** 415,418 ****
--- 411,415 ----
initMaillageT6();
H2dMaillage temp= mail_.maillageT6en4T3(progress_);
+ assertNotNull(temp);
assertEquals(36, temp.getEltNb());
H2dElement t= temp.getElement(0);
***************
*** 440,443 ****
--- 437,451 ----
assertEquals(t.getPtIndex(1), 25);
assertEquals(t.getPtIndex(2), 26);
+ }
+
+ public void TestShiftElement(){
+ H2dElement el=new H2dElement(new int[]{1,2,3,4,5});
+ H2dElement n=H2dElement.ShiftLeftElementIndex(el);
+ assertEquals(n.getPtNb(), 5);
+ assertEquals(n.getPtIndex(0), 2);
+ assertEquals(n.getPtIndex(1), 3);
+ assertEquals(n.getPtIndex(2), 4);
+ assertEquals(n.getPtIndex(3), 5);
+ assertEquals(n.getPtIndex(4), 1);
}
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/test/reflux
Modified Files:
TestCorEleBth.java TestDunes.java TestINP.java
Added Files:
TestRefluxParametres.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
--- NEW FILE: TestRefluxParametres.java ---
(This appears to be a binary file; contents omitted.)
Index: TestCorEleBth.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestCorEleBth.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TestCorEleBth.java 18 Aug 2003 11:05:20 -0000 1.7
--- TestCorEleBth.java 22 Aug 2003 15:51:13 -0000 1.8
***************
*** 18,21 ****
--- 18,22 ----
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dMaillage;
+ import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.dodico.reflux.io.CorEleBthFileFormat;
import org.fudaa.dodico.reflux.io.CorEleBthInterface;
***************
*** 40,44 ****
H2dMaillage maill= t.getMaillage();
assertNotNull(maill);
! assertEquals(maill.getEltType(), H2dElement.T6);
//H2dPoint[] pts= maill.getPts();
assertEquals(maill.getPtsNb(), 1791);
--- 41,45 ----
H2dMaillage maill= t.getMaillage();
assertNotNull(maill);
! assertEquals(maill.getEltType(), H2dElementType.T6);
//H2dPoint[] pts= maill.getPts();
assertEquals(maill.getPtsNb(), 1791);
***************
*** 136,145 ****
CorEleBthInterface t= null;
reader=
! CorEleBthFileFormat.getInstance().getLastVersionImpl().createReader();
reader.setIn(cor, ele, bth);
reader.setProgressReceiver(new ProgressionBuAdapter(null));
! FileOperationSynthese op= new FileOperationSynthese();
! t= reader.read(op);
! DodicoAnalyze analyse= op.getAnalyze();
printAnalyze("FICHIERS cor,ele,bth", analyse);
H2dMaillage mail= t.getMaillage();
--- 137,146 ----
CorEleBthInterface t= null;
reader=
! CorEleBthFileFormat.getInstance().getLastVersionImpl().createCorEleBthReader();
reader.setIn(cor, ele, bth);
reader.setProgressReceiver(new ProgressionBuAdapter(null));
! FileOperationSynthese op= reader.read();
! t= (CorEleBthInterface)op.getSource();
! DodicoAnalyze analyse= op.getAnalyze().toAnalyze();
printAnalyze("FICHIERS cor,ele,bth", analyse);
H2dMaillage mail= t.getMaillage();
***************
*** 169,179 ****
}
CorEleBthWriter w= null;
! w= CorEleBthFileFormat.getInstance().getLastVersionImpl().createWriter();
w.setFile(corOut, eleOut, bthOut);
w.setProgressReceiver(new ProgressionBuAdapter(null));
- FileOperationSynthese opW= new FileOperationSynthese();
- w.write(t, opW);
System.out.println("Ecriture");
! printAnalyze("FICHIER", opW.getAnalyze());
}
--- 170,178 ----
}
CorEleBthWriter w= null;
! w= CorEleBthFileFormat.getInstance().getLastVersionImpl().createCorEleBthWriter();
w.setFile(corOut, eleOut, bthOut);
w.setProgressReceiver(new ProgressionBuAdapter(null));
System.out.println("Ecriture");
! printAnalyze("FICHIER", w.write(t).getAnalyze().toAnalyze());
}
***************
*** 190,194 ****
inter,
null);
! assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
--- 189,193 ----
inter,
null);
! assertNull(syntheseR.getAnalyze().toAnalyze());
_interfaceTest(getInter(tmpFile));
***************
*** 196,204 ****
public CorEleBthInterface getInter(File _f) {
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! CorEleBthInterface r=
! CorEleBthFileFormat.getInstance().getLastVersionImpl().read(_f, syntheseR, null);
! assertNull(syntheseR.getAnalyze());
! return r;
}
--- 195,202 ----
public CorEleBthInterface getInter(File _f) {
! FileOperationSynthese syntheseR=
! CorEleBthFileFormat.getInstance().getLastVersionImpl().read(_f, null);
! assertNull(syntheseR.getAnalyze().toAnalyze());
! return (CorEleBthInterface)syntheseR.getSource();
}
Index: TestDunes.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestDunes.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TestDunes.java 18 Aug 2003 11:05:20 -0000 1.8
--- TestDunes.java 22 Aug 2003 15:51:13 -0000 1.9
***************
*** 29,46 ****
* @version $Id$
*/
! public class TestDunes extends TestIO
! {
! public TestDunes()
! {
super("mesh.mail");
! }
! public synchronized void _interfaceTest(DunesInterface _inter)
! {
assertNotNull(_inter);
! DunesInterface t=_inter;
! double[] adapt = t.getAdaptatifValeur();
! int temp = adapt.length;
assertEquals(temp, 9);
assertEquals(adapt[0], 0.1d, eps_);
--- 29,43 ----
* @version $Id$
*/
! public class TestDunes extends TestIO {
! public TestDunes() {
super("mesh.mail");
! }
! public synchronized void _interfaceTest(DunesInterface _inter) {
assertNotNull(_inter);
! DunesInterface t= _inter;
! double[] adapt= t.getAdaptatifValeur();
! int temp= adapt.length;
assertEquals(temp, 9);
assertEquals(adapt[0], 0.1d, eps_);
***************
*** 54,83 ****
assertEquals(adapt[8], 1d, eps_);
assertNotNull(t.getMaillage());
! H2dMaillage m=t.getMaillage();
! temp = m.getPtsNb();
assertEquals(temp, 9);
! H2dPoint pt = m.getPt(0);
assertEquals(pt.getX(), 0d, eps_);
assertEquals(pt.getY(), 0d, eps_);
assertEquals(pt.getZ(), 0.25, eps_);
! pt =m.getPt(4);
assertEquals(pt.getX(), 0d, eps_);
assertEquals(pt.getY(), 3d, eps_);
assertEquals(pt.getZ(), 0.25, eps_);
! pt = m.getPt(8);
assertEquals(pt.getX(), 2d, eps_);
assertEquals(pt.getY(), 1d, eps_);
assertEquals(pt.getZ(), 0.1, eps_);
//H2dElement[] elems = t.getMaillage().getElts();
! temp = t.getMaillage().getEltNb();
assertEquals(temp, 9);
! int[] indices = t.getMaillage().getElement(1).getPtIndex();
! temp = indices.length;
assertEquals(temp, 3);
assertEquals(indices[0], 4);
assertEquals(indices[1], 0);
assertEquals(indices[2], 5);
! indices = t.getMaillage().getElement(6).getPtIndex();
! temp = indices.length;
assertEquals(temp, 3);
assertEquals(indices[0], 4);
--- 51,80 ----
assertEquals(adapt[8], 1d, eps_);
assertNotNull(t.getMaillage());
! H2dMaillage m= t.getMaillage();
! temp= m.getPtsNb();
assertEquals(temp, 9);
! H2dPoint pt= m.getPt(0);
assertEquals(pt.getX(), 0d, eps_);
assertEquals(pt.getY(), 0d, eps_);
assertEquals(pt.getZ(), 0.25, eps_);
! pt= m.getPt(4);
assertEquals(pt.getX(), 0d, eps_);
assertEquals(pt.getY(), 3d, eps_);
assertEquals(pt.getZ(), 0.25, eps_);
! pt= m.getPt(8);
assertEquals(pt.getX(), 2d, eps_);
assertEquals(pt.getY(), 1d, eps_);
assertEquals(pt.getZ(), 0.1, eps_);
//H2dElement[] elems = t.getMaillage().getElts();
! temp= t.getMaillage().getEltNb();
assertEquals(temp, 9);
! int[] indices= t.getMaillage().getElement(1).getPtIndex();
! temp= indices.length;
assertEquals(temp, 3);
assertEquals(indices[0], 4);
assertEquals(indices[1], 0);
assertEquals(indices[2], 5);
! indices= t.getMaillage().getElement(6).getPtIndex();
! temp= indices.length;
assertEquals(temp, 3);
assertEquals(indices[0], 4);
***************
*** 85,159 ****
assertEquals(indices[2], 6);
}
!
/**
*
*/
! public void testEcriture()
! {
! DunesInterface inter=getInter(fic_);
! File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=DunesFileFormat.getInstance().getLastVersionImpl().write(tmpFile, inter, null);
! assertNull(syntheseR.getAnalyze());
! _interfaceTest(getInter(tmpFile));
!
! }
!
! public static DunesInterface getInter(File _f)
! {
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! DunesInterface r=DunesFileFormat.getInstance().getLastVersionImpl().read(_f, syntheseR, null);
! assertNull(syntheseR.getAnalyze());
! if(syntheseR.containsMessages())
! syntheseR.getAnalyze().printResume();
! return r;
! }
! /**
! *
! */
! public void testLecture()
! {
! _interfaceTest(getInter(fic_));
! }
! public static void main(String[] args)
! {
! HashMap arg = DodicoLib.parseArgs(args);
! String fileName = (String) arg.get("-f");
! if (fileName == null)
! fileName = (String) arg.get("-file");
if (fileName == null)
! {
System.err.println("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
! File f = new File(fileName);
! if (!f.exists())
! {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
}
! ProgressionBuAdapter progress = new ProgressionBuAdapter(new BuTask());
! FileOperationSynthese op=new FileOperationSynthese();
! DunesInterface inter = DunesFileFormat.getInstance().getLastVersionImpl().read(f, op, progress);
! if(op.containsMessages()) op.getAnalyze().printResume();
! fileName = (String) arg.get("-out");
! if (fileName == null)
! {
System.err.println("pas de sortie");
return;
}
! File out = new File(fileName);
! if (out.exists())
! {
System.err.println("Le fichier existe déja :opération annulée");
return;
}
! FileOperationSynthese opw=DunesFileFormat.getInstance().getLastVersionImpl().write(out, inter, progress);
! if(opw.containsMessages()) opw.getAnalyze().printResume();
}
--- 82,158 ----
assertEquals(indices[2], 6);
}
!
/**
*
*/
! public void testEcriture() {
! DunesInterface inter= getInter(fic_);
! File tmpFile= createTempFile();
! FileOperationSynthese syntheseR=
! DunesFileFormat.getInstance().getLastVersionImpl().write(
! tmpFile,
! inter,
! null);
! assertNull(syntheseR.getAnalyze().toAnalyze());
! _interfaceTest(getInter(tmpFile));
! }
! public static DunesInterface getInter(File _f) {
! FileOperationSynthese syntheseR=
! DunesFileFormat.getInstance().getLastVersionImpl().read(_f, null);
! DunesInterface r= (DunesInterface)syntheseR.getSource();
! assertNull(syntheseR.getAnalyze().toAnalyze());
! if (syntheseR.containsMessages())
! syntheseR.getAnalyze().toAnalyze().printResume();
! return r;
! }
+ /**
+ *
+ */
+ public void testLecture() {
+ _interfaceTest(getInter(fic_));
+ }
! public static void main(String[] args) {
! HashMap arg= DodicoLib.parseArgs(args);
! String fileName= (String)arg.get("-f");
if (fileName == null)
! fileName= (String)arg.get("-file");
! if (fileName == null) {
System.err.println("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
! File f= new File(fileName);
! if (!f.exists()) {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
}
! ProgressionBuAdapter progress= new ProgressionBuAdapter(new BuTask());
! FileOperationSynthese op=
! DunesFileFormat.getInstance().getLastVersionImpl().read(f, progress);
! DunesInterface inter= (DunesInterface)op.getSource();
! if (op.containsMessages())
! op.getAnalyze().toAnalyze().printResume();
! fileName= (String)arg.get("-out");
! if (fileName == null) {
System.err.println("pas de sortie");
return;
}
! File out= new File(fileName);
! if (out.exists()) {
System.err.println("Le fichier existe déja :opération annulée");
return;
}
! FileOperationSynthese opw=
! DunesFileFormat.getInstance().getLastVersionImpl().write(
! out,
! inter,
! progress);
! if (opw.containsMessages())
! opw.getAnalyze().toAnalyze().printResume();
}
Index: TestINP.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestINP.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TestINP.java 18 Aug 2003 11:05:20 -0000 1.6
--- TestINP.java 22 Aug 2003 15:51:13 -0000 1.7
***************
*** 15,27 ****
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
- import org.fudaa.dodico.h2d.H2dConditionLimiteReflux;
- import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dGroupePasTemps;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dProprieteElementaire;
- import org.fudaa.dodico.h2d.H2dRefluxDicoModel;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
--- 15,26 ----
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.commun.ProgressionTestAdapter;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dGroupePasTemps;
import org.fudaa.dodico.h2d.H2dMaillage;
+ import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dProprieteElementaire;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
***************
*** 30,33 ****
--- 29,36 ----
import org.fudaa.dodico.h2d.type.H2dSchemaResolutionType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
+ import org.fudaa.dodico.h2d.reflux.H2dRefluxBordIndexGeneral;
+ import org.fudaa.dodico.h2d.reflux.H2dRefluxBordManager;
+ import org.fudaa.dodico.h2d.reflux.H2dRefluxConditionLimite;
+ import org.fudaa.dodico.h2d.reflux.H2dRefluxParametres;
import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.reflux.io.INPInterface;
***************
*** 39,110 ****
* @version $Id$
*/
! public class TestINP extends TestIO
! {
! public TestINP()
! {
super("canal_s.inp");
}
!
!
/**
* @see org.fudaa.dodico.test.TestIO#_interfaceTest(TrFileReadView)
*/
! public void _interfaceTest(INPInterface _t)
! {
! INPFileFormat.INPVersion version=INPFileFormat.getInstance().getLastINPVersionImpl();
! INPInterface t=_t;
assertTrue("5.0".equals(t.getVersion()));
assertEquals(t.getTypeProjet(), H2dProjetType.COURANTOLOGIE_2D);
assertNotNull(t.getEntiteValue());
! assertTrue(t.getEntiteValue().containsKey(version.getDico().getEntite("ITERATION")));
! H2dMaillage m=t.getMaillage();
assertEquals(m.getPtsNb(), 1791);
! H2dPoint pt=m.getPt(1790);
! assertEquals(pt.getX(), 1000,eps_);
! assertEquals(pt.getY(), 10,eps_);
! assertEquals(pt.getZ(), 12,eps_);
! pt=m.getPt(1770);
! assertEquals(pt.getX(), 989.898987,eps_);
! assertEquals(pt.getY(), 7.5,eps_);
! assertEquals(pt.getZ(), 12.030303,eps_);
! int[] itemp=t.getPtsExtremitesElement();
! assertNotNull("Les points frontiere ne sont pas nuls",itemp);
! assertEquals(itemp[5], 18);
! assertEquals(itemp[499],1790);
! H2dConditionLimiteReflux[] tabCl=t.getConditionLimite();
!
! H2dConditionLimiteReflux cl=getForIndex(tabCl, 818);
assertEquals(cl.getUType(), H2dClType.PERMANENT);
! assertEquals(cl.getU(),0,eps_);
!
! cl=getForIndex(tabCl, 1790);
assertEquals(cl.getVType(), H2dClType.PERMANENT);
! assertEquals(cl.getV(),0,eps_);
! assertEquals(cl.getNormale(), 0,eps_);
assertEquals(cl.getHType(), H2dClType.PERMANENT);
! assertEquals(cl.getH(),13.3,eps_);
!
! cl=getForIndex(tabCl, 1781);
! assertEquals(cl.getNormale(), 90.0000041,eps_);
!
! cl=getForIndex(tabCl, 0);
assertEquals(cl.getHType(), H2dClType.PERMANENT);
! assertEquals(cl.getH(),16.325,eps_);
!
! itemp=new int[]{1430,1421,1412,1403,1394};
!
! for(int i=itemp.length-1;i>0;i--)
! {
! cl=getForIndex(tabCl, itemp[i]);
! assertEquals(H2dBordType.SOLIDE,cl.getBordType());
! assertEquals(H2dClType.PERMANENT,cl.getRugositeType());
! assertEquals(3d,cl.getRugosite(),eps_);
!
}
!
!
//H2dElement[] elems=t.getMaillage().getElts();
assertEquals(t.getMaillage().getEltNb(), 792);
! itemp=t.getMaillage().getElement(791).getPtIndex();
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
--- 42,114 ----
* @version $Id$
*/
! public class TestINP extends TestIO {
! public TestINP() {
super("canal_s.inp");
}
!
/**
* @see org.fudaa.dodico.test.TestIO#_interfaceTest(TrFileReadView)
*/
! public void _interfaceTest(INPInterface _t) {
! INPFileFormat.INPVersion version=
! INPFileFormat.getInstance().getLastINPVersionImpl();
! INPInterface t= _t;
assertTrue("5.0".equals(t.getVersion()));
assertEquals(t.getTypeProjet(), H2dProjetType.COURANTOLOGIE_2D);
assertNotNull(t.getEntiteValue());
! assertTrue(
! t.getEntiteValue().containsKey(version.getDico().getEntite("ITERATION")));
! H2dMaillage m= t.getMaillage();
assertEquals(m.getPtsNb(), 1791);
! H2dPoint pt= m.getPt(1790);
! assertEquals(pt.getX(), 1000, eps_);
! assertEquals(pt.getY(), 10, eps_);
! assertEquals(pt.getZ(), 12, eps_);
! pt= m.getPt(1770);
! assertEquals(pt.getX(), 989.898987, eps_);
! assertEquals(pt.getY(), 7.5, eps_);
! assertEquals(pt.getZ(), 12.030303, eps_);
! int[] itemp;
! // int[] itemp=t.getPtsExtremitesElement();
! // assertNotNull("Les points frontiere ne sont pas nuls",itemp);
! // assertEquals(itemp[5], 18);
! // assertEquals(itemp[499],1790);
! H2dRefluxConditionLimite[] tabCl= t.getConditionLimite();
!
! H2dRefluxConditionLimite cl= getForIndex(tabCl, 818);
assertEquals(cl.getUType(), H2dClType.PERMANENT);
! assertEquals(cl.getU(), 0, eps_);
!
! cl= getForIndex(tabCl, 1790);
assertEquals(cl.getVType(), H2dClType.PERMANENT);
! assertEquals(cl.getV(), 0, eps_);
! assertEquals(cl.getNormale(), 0, eps_);
assertEquals(cl.getHType(), H2dClType.PERMANENT);
! assertEquals(cl.getH(), 13.3, eps_);
!
! cl= getForIndex(tabCl, 1781);
! assertEquals(cl.getNormale(), 90.0000041, eps_);
!
! cl= getForIndex(tabCl, 0);
assertEquals(cl.getHType(), H2dClType.PERMANENT);
! assertEquals(cl.getH(), 16.325, eps_);
!
! H2dRefluxBordIndexGeneral bord=
! H2dRefluxBordIndexGeneral.findBordWithIndex(1430, 1421, _t.getBords());
! assertEquals(H2dBordType.SOLIDE, bord.getBord());
! bord=
! H2dRefluxBordIndexGeneral.findBordWithIndex(1412, 1403, _t.getBords());
! assertEquals(H2dBordType.SOLIDE, bord.getBord());
! itemp= new int[] { 1430, 1421, 1412, 1403, 1394 };
! for (int i= itemp.length - 1; i > 0; i--) {
! cl= getForIndex(tabCl, itemp[i]);
! assertEquals(H2dClType.PERMANENT, cl.getRugositeType());
! assertEquals(3d, cl.getRugosite(), eps_);
!
}
!
//H2dElement[] elems=t.getMaillage().getElts();
assertEquals(t.getMaillage().getEltNb(), 792);
! itemp= t.getMaillage().getElement(791).getPtIndex();
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
***************
*** 113,153 ****
assertEquals(itemp[4], 1770);
assertEquals(itemp[5], 1779);
!
! H2dProprieteElementaire[] propelem=t.getPropElementaires();
! H2dProprieteElementaire prTemp=propelem[0];
assertEquals(prTemp.getVariableType(), H2dVariableType.VISCOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.01,eps_);
! prTemp=propelem[1];
assertEquals(prTemp.getVariableType(), H2dVariableType.RUGOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.025,eps_);
! prTemp=propelem[2];
! assertEquals(prTemp.getVariableType(), H2dVariableType.ALPHA_LONGUEUR_MELANGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.0,eps_);
!
! prTemp=propelem[3];
assertEquals(prTemp.getVariableType(), H2dVariableType.PERTE_CHARGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 792);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.0,eps_);
!
! for(int i=790;i>=0;i--)
! {
! if(i!=758)
! assertEquals(prTemp.getPermanentValueForIndex(i), 0.0,eps_);
else
! assertEquals(prTemp.getPermanentValueForIndex(i), 0.01,eps_);
}
! String[] fics=t.getFichiers();
assertEquals(fics.length, 3);
assertEquals(fics[0], "canal_s.siv");
--- 117,158 ----
assertEquals(itemp[4], 1770);
assertEquals(itemp[5], 1779);
!
! H2dProprieteElementaire[] propelem= t.getPropElementaires();
! H2dProprieteElementaire prTemp= propelem[0];
assertEquals(prTemp.getVariableType(), H2dVariableType.VISCOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(), 0.01, eps_);
! prTemp= propelem[1];
assertEquals(prTemp.getVariableType(), H2dVariableType.RUGOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(), 0.025, eps_);
! prTemp= propelem[2];
! assertEquals(
! prTemp.getVariableType(),
! H2dVariableType.ALPHA_LONGUEUR_MELANGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(), 0.0, eps_);
!
! prTemp= propelem[3];
assertEquals(prTemp.getVariableType(), H2dVariableType.PERTE_CHARGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentNb(), 792);
assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(), 0.0, eps_);
!
! for (int i= 790; i >= 0; i--) {
! if (i != 758)
! assertEquals(prTemp.getPermanentValueForIndex(i), 0.0, eps_);
else
! assertEquals(prTemp.getPermanentValueForIndex(i), 0.01, eps_);
}
! String[] fics= t.getFichiers();
assertEquals(fics.length, 3);
assertEquals(fics[0], "canal_s.siv");
***************
*** 157,213 ****
assertFalse(t.contientSollicitationsReparties());
assertFalse(t.contientVent());
!
! H2dGroupePasTemps[] gts=t.getGroupePasTemps();
assertNotNull(gts);
assertEquals(gts.length, 1);
! H2dGroupePasTemps gt=gts[0];
assertNotNull(gt);
assertEquals(gt.getNbPasTemps(), 1);
assertEquals(gt.getSchema(), H2dSchemaResolutionType.STATIONNAIRE);
assertEquals(gt.getMethode(), H2dMethodeResolutionType.SELECT_LUMPING);
! assertEquals(gt.getRelaxation(), 1,eps_);
! assertEquals(gt.getPrecision(), 0.001,eps_);
! assertEquals(gt.getPrecisionBancCouvrantDecouvrant(), 0.05,eps_);
assertEquals(gt.getNombreIterationMax(), 2);
! Map dtemp=t.getEntiteValue();
assertNotNull(dtemp);
! for(int i=8;i>=0;i--)
! {
! DicoEntite ent=version.getCoefContribution(i);
assertNotNull(ent);
! assertEquals(Double.parseDouble((String)dtemp.get(ent)) , i,eps_);
}
}
!
! private H2dConditionLimiteReflux getForIndex(H2dConditionLimiteReflux[] _tab,int _index)
! {
! int l=_tab.length-1;
! for(int i=l;i>=0;i--)
! {
! if(_tab[i].getIndexPt()==_index) return _tab[i];
}
return null;
}
!
/**
*
*/
! public void testEcriture()
! {
! // CorEleBthInterface inter=getInter(fic_);
! // File tmpFile=createTempFile();
! // FileOperationSynthese syntheseR=CorEleBthFileFormat.getInstance().write(tmpFile, inter, null);
! // assertNull(syntheseR.getAnalyze());
! // _interfaceTest(getInter(tmpFile));
!
! }
! public INPInterface getInter(File _f)
! {
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface r=INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, syntheseR, null);
! if(syntheseR.getAnalyze()!=null)
! System.out.println( syntheseR.getAnalyze().getResume());
! assertNull(syntheseR.getAnalyze());
return r;
}
--- 162,217 ----
assertFalse(t.contientSollicitationsReparties());
assertFalse(t.contientVent());
!
! H2dGroupePasTemps[] gts= t.getGroupePasTemps();
assertNotNull(gts);
assertEquals(gts.length, 1);
! H2dGroupePasTemps gt= gts[0];
assertNotNull(gt);
assertEquals(gt.getNbPasTemps(), 1);
assertEquals(gt.getSchema(), H2dSchemaResolutionType.STATIONNAIRE);
assertEquals(gt.getMethode(), H2dMethodeResolutionType.SELECT_LUMPING);
! assertEquals(gt.getRelaxation(), 1, eps_);
! assertEquals(gt.getPrecision(), 0.001, eps_);
! assertEquals(gt.getPrecisionBancCouvrantDecouvrant(), 0.05, eps_);
assertEquals(gt.getNombreIterationMax(), 2);
! Map dtemp= t.getEntiteValue();
assertNotNull(dtemp);
! for (int i= 8; i >= 0; i--) {
! DicoEntite ent= version.getCoefContribution(i);
assertNotNull(ent);
! assertEquals(Double.parseDouble((String)dtemp.get(ent)), i, eps_);
}
}
!
! private H2dRefluxConditionLimite getForIndex(
! H2dRefluxConditionLimite[] _tab,
! int _index) {
! int l= _tab.length - 1;
! for (int i= l; i >= 0; i--) {
! if (_tab[i].getIndexPt() == _index)
! return _tab[i];
}
return null;
}
!
/**
*
*/
! public void testEcriture() {
! // CorEleBthInterface inter=getInter(fic_);
! // File tmpFile=createTempFile();
! // FileOperationSynthese syntheseR=CorEleBthFileFormat.getInstance().write(tmpFile, inter, null);
! // assertNull(syntheseR.getAnalyze());
! // _interfaceTest(getInter(tmpFile));
! }
!
! public INPInterface getInter(File _f) {
! FileOperationSynthese syntheseR=
! INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, null);
! INPInterface r=(INPInterface)syntheseR.getSource();
! if (syntheseR.containsMessages())
! syntheseR.getAnalyze().toAnalyze().printResume();
! assertNull(syntheseR.getAnalyze().toAnalyze());
return r;
}
***************
*** 216,271 ****
*
*/
! public void testLecture()
! {
_interfaceTest(getInter(fic_));
}
!
!
!
!
! public static void main(String[] args)
! {
! HashMap arg = DodicoLib.parseArgs(args);
! String fileName = (String) arg.get("-f");
! if (fileName == null)
! fileName = (String) arg.get("-file");
if (fileName == null)
! {
System.err.println("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
! File f = new File(fileName);
! if (!f.exists())
! {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
}
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface inpInter=INPFileFormat.getInstance().getLastINPVersionImpl().read(f, syntheseR, null);
! DodicoAnalyze infos = syntheseR.getAnalyze();
if (infos != null)
infos.printResume();
! if (inpInter != null)
! {
System.out.println(inpInter.getTypeProjet().toString());
DodicoLib.printFields(inpInter, false);
}
- // try
- // {
- // Thread.currentThread().sleep(10000);
- // }
- // catch(Exception e)
- // {
- // e.printStackTrace();
- // }
}
-
-
}
--- 220,283 ----
*
*/
! public void testLecture() {
_interfaceTest(getInter(fic_));
+ }
+
+ public void testAnalyze() {
+ INPInterface inter= getInter(fic_);
+ DodicoAnalyze.Editor anal= new DodicoAnalyze.Editor();
+ H2dRefluxParametres param=
+ H2dRefluxParametres.init(
+ inter,
+ new ProgressionTestAdapter(),
+ INPFileFormat.getInstance().getLastINPVersionImpl(),
+ anal);
+ assertTrue(anal.isEmpty());
+ assertNull(anal.toAnalyze());
+ H2dMaillageFrontiere maillageBord= param.getMaillage().getPtsFrontiere();
+ int[] pointsFr= maillageBord.getArray();
+ int n= pointsFr.length - 1;
+ for (int i= n; i >= 0; i--) {
+ assertEquals(pointsFr[i], param.getRefluxCL(i).getIndexPt());
+ }
+ assertEquals(1, maillageBord.getBordNb());
+ H2dRefluxBordManager mng= param.getBords();
+ assertEquals(mng.getFrontiereBordNb(), 1);
+ H2dRefluxBordManager.BordParFrontiere frontiere0= mng.getFrontiereBord(0);
+ assertEquals(1, frontiere0.getBordNb());
+ assertTrue(frontiere0.getBord(0).isUnique());
}
! public static void main(String[] args) {
! HashMap arg= DodicoLib.parseArgs(args);
! String fileName= (String)arg.get("-f");
if (fileName == null)
! fileName= (String)arg.get("-file");
! if (fileName == null) {
System.err.println("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
! File f= new File(fileName);
! if (!f.exists()) {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
}
! FileOperationSynthese syntheseR= INPFileFormat.getInstance().getLastINPVersionImpl().read(
! f,
! null);
! INPInterface inpInter=(INPInterface)syntheseR.getSource();
! DodicoAnalyze infos= syntheseR.getAnalyze().toAnalyze();
if (infos != null)
infos.printResume();
! if (inpInter != null) {
System.out.println(inpInter.getTypeProjet().toString());
DodicoLib.printFields(inpInter, false);
}
}
}
|
|
From: <de...@us...> - 2003-08-23 00:00:49
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test/tr
In directory sc8-pr-cvs1:/tmp/cvs-serv7810/test/tr
Modified Files:
TestTrMaillage.java
Log Message:
tr: ajout de l'export pour le maillage
gestion affichage maillage
commun modif mineure
Index: TestTrMaillage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test/tr/TestTrMaillage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestTrMaillage.java 18 Aug 2003 11:54:43 -0000 1.2
--- TestTrMaillage.java 22 Aug 2003 16:02:23 -0000 1.3
***************
*** 33,37 ****
import org.fudaa.ebli.trace.TracePoint;
! import org.fudaa.fudaa.tr.data.TrMaillage;
/**
--- 33,37 ----
import org.fudaa.ebli.trace.TracePoint;
! import org.fudaa.fudaa.tr.data.TrCalqueMaillage;
/**
***************
*** 48,52 ****
*
*/
! public TestTrMaillage(TrMaillage _maillage) {
vue_ = new BVueCalque();
vue_.setBackground(Color.white);
--- 48,52 ----
*
*/
! public TestTrMaillage(TrCalqueMaillage _maillage) {
vue_ = new BVueCalque();
vue_.setBackground(Color.white);
***************
*** 88,101 ****
}
File f = new File(fileName);
! FileOperationSynthese op = new FileOperationSynthese();
System.out.println("Debut Lecture");
! SerafinInterface inter = SerafinFileFormat.getInstance().getLastVersionImpl().read(f, op, null);
System.out.println("fin Lecture");
if (op.containsFatalError()) {
! op.getAnalyze().printResume("!! ");
System.exit(1);
}
else if (op.containsMessages()) {
! op.getAnalyze().printResume(" ");
}
--- 88,102 ----
}
File f = new File(fileName);
!
System.out.println("Debut Lecture");
! FileOperationSynthese op = SerafinFileFormat.getInstance().getLastVersionImpl().read(f, null);
! SerafinInterface inter =(SerafinInterface)op.getSource();
System.out.println("fin Lecture");
if (op.containsFatalError()) {
! op.getAnalyze().toAnalyze().printResume("!! ");
System.exit(1);
}
else if (op.containsMessages()) {
! op.getAnalyze().toAnalyze().printResume(" ");
}
***************
*** 105,112 ****
System.out.println(inter.getPtsFrontiere()[0]);
long t1=System.currentTimeMillis();
! inter.getMaillage().computeBordV2(null);
long t2=System.currentTimeMillis();
System.out.println("temps "+(t2-t1));
! TrMaillage maillage = new TrMaillage(inter.getMaillage());
TestTrMaillage test = new TestTrMaillage(maillage);
--- 106,113 ----
System.out.println(inter.getPtsFrontiere()[0]);
long t1=System.currentTimeMillis();
! inter.getMaillage().computeBord(null);
long t2=System.currentTimeMillis();
System.out.println("temps "+(t2-t1));
! TrCalqueMaillage maillage = new TrCalqueMaillage(inter.getMaillage());
TestTrMaillage test = new TestTrMaillage(maillage);
|
|
From: <de...@us...> - 2003-08-22 23:17:10
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv7810/dico
Modified Files:
FDicoImplementation.java FDicoParams.java
FDicoProjetAbstract.java
Log Message:
tr: ajout de l'export pour le maillage
gestion affichage maillage
commun modif mineure
Index: FDicoImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoImplementation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FDicoImplementation.java 4 Jul 2003 14:44:20 -0000 1.1
--- FDicoImplementation.java 22 Aug 2003 16:02:23 -0000 1.2
***************
*** 9,23 ****
package org.fudaa.fudaa.dico;
! import java.io.File;
! import java.io.IOException;
!
! import com.memoire.bu.BuCommonImplementation;
! import org.fudaa.dodico.commun.DodicoAnalyze;
! import org.fudaa.dodico.commun.ProgressionInterface;
! import org.fudaa.dodico.fichiers.FileFormat;
! import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.fudaa.commun.*;
! import org.fudaa.fudaa.commun.FudaaLib;
/**
--- 9,15 ----
package org.fudaa.fudaa.dico;
! import com.memoire.bu.BuPreferences;
! import org.fudaa.fudaa.commun.FudaaCommonImplementation;
/**
***************
*** 25,142 ****
* @version $Id$
*/
! public class FDicoImplementation extends BuCommonImplementation implements FudaaUI
{
- /**
- *
- */
- public FDicoImplementation()
- {
- super();
- }
-
- /**
- *
- */
- public void error(String _titre, String _text)
- {
- FudaaLib.showError(this, _titre, _text);
- System.err.println(_titre+" "+_text);
-
- }
-
- /**
- *
- */
- public void message(String _titre, String _text)
- {
- FudaaLib.showMessage(this, _titre, _text);
-
- }
/**
*
*/
! public boolean confirmation(String _titre, String _text)
! {
! return FudaaLib.showConfirmation(this, _titre, _text);
! }
!
! // public FileOperationSynthese readFile(File _file, FileFormat _fileFormat, ProgressionInterface _progress)
! // {
! // FileOperationSynthese r = _fileFormat.read(_file, _progress);
! // manageClosingException(r.getClosingException(), _file);
! // if ((r.getAnalyze() != null) && (r.getAnalyze().getFatalError() != null))
! // {
! // DodicoAnalyze.Field f = r.getAnalyze().getFatalError();
! // error("Erreur de lecture", f.getOffset() < 0 ? f.getMessage() : f.toString());
! // return null;
! // }
! // return r;
! // }
! //
! // public FileOperationSynthese write(File _f, Object _interface, FileFormat _ft, ProgressionInterface _progress)
! // {
! // FileOperationSynthese r = _ft.write(_f, _interface, _progress);
! // manageClosingException(r.getClosingException(), _f);
! // if ((r.getAnalyze() != null) && (r.getAnalyze().getFatalError() != null))
! // {
! // DodicoAnalyze.Field f = r.getAnalyze().getFatalError();
! // error("Erreur de lecture", f.getOffset() < 0 ? f.getMessage() : f.toString());
! // return null;
! // }
! // return r;
! // }
!
! // public void manageClosingException(IOException[] _e,FileW _f)
! // {
! // if(_e==null) return;
! // System.err.println("FATAL :erreur lors de la fermeture de "+_f.getAbsolutePath());
! // System.out.println(_e[0]);
! //
! // }
!
! /**
! *
! */
! public boolean manageErrorOperation(FileOperationSynthese _opResult)
! {
! if(_opResult.getClosingException()!=null)
! {
! System.err.println("FATAL :erreur lors de la fermeture de "+_opResult.getFile());
! }
! if(_opResult.getAnalyze() != null)
! {
! if(_opResult.getAnalyze().getFatalError() != null)
! {
!
! DodicoAnalyze.Field f = _opResult.getAnalyze().getFatalError();
! error(_opResult.getDesc(), f.getOffset() < 0 ? f.getMessage() : f.toString());
! return true;
! }
! else
! {
! FudaaLib.showError(this,_opResult.getDesc(),_opResult.getAnalyze().getResume());
! }
! }
! return false;
! }
!
! /**
! * @param _msg
! */
! public void error(String _msg)
! {
! error("Erreur",_msg);
!
! }
!
! /**
! * @param _msg
! */
! public void message(String _msg)
! {
! message("Message",_msg);
!
}
--- 17,29 ----
* @version $Id$
*/
! public class FDicoImplementation extends FudaaCommonImplementation
{
/**
*
*/
! public BuPreferences getApplicationPreferences() {
! return null;
}
Index: FDicoParams.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoParams.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FDicoParams.java 18 Aug 2003 11:54:43 -0000 1.2
--- FDicoParams.java 22 Aug 2003 16:02:23 -0000 1.3
***************
*** 40,44 ****
private String casFileName_;
! protected long casFileTimeLoaded_;
protected DicoParams dicoParams_;
protected FudaaUI ui_;
--- 40,44 ----
private String casFileName_;
! protected long fileLastModified_;
protected DicoParams dicoParams_;
protected FudaaUI ui_;
***************
*** 52,62 ****
File _file,
DicoCasFileFormatVersion _ft,
! Map _initialSetValues,
! long _timeloaded) {
dicoParams_= new DicoParams(_initialSetValues, _ft);
- casFileTimeLoaded_= _timeloaded;
dirBase_= _file.getParent();
casFileName_= _file.getName();
! casFileTimeLoaded_= _timeloaded;
dicoParams_.addModelListener(this);
}
--- 52,60 ----
File _file,
DicoCasFileFormatVersion _ft,
! Map _initialSetValues) {
dicoParams_= new DicoParams(_initialSetValues, _ft);
dirBase_= _file.getParent();
casFileName_= _file.getName();
! fileLastModified_= _file.lastModified();
dicoParams_.addModelListener(this);
}
***************
*** 71,78 ****
ProgressionInterface _progress,
FudaaUI _ui) {
! FileOperationSynthese op= new FileOperationSynthese();
! DicoCasInterface inter= _fileFormat.readCas(_file, op, _progress);
if (_ui != null)
! _ui.manageErrorOperation(op);
if (inter == null)
return null;
--- 69,76 ----
ProgressionInterface _progress,
FudaaUI _ui) {
! FileOperationSynthese op= _fileFormat.read(_file, _progress);
! DicoCasInterface inter=(DicoCasInterface)op.getSource();
if (_ui != null)
! _ui.manageErrorOperationAndIsFatal(op);
if (inter == null)
return null;
***************
*** 85,89 ****
}
FDicoParams r=
! new FDicoParams(_file, _fileFormat, inter.getInputs(), op.getOpTime());
r.setUI(_ui);
return r;
--- 83,87 ----
}
FDicoParams r=
! new FDicoParams(_file, _fileFormat, inter.getInputs());
r.setUI(_ui);
return r;
***************
*** 326,336 ****
}
FileOperationSynthese r=
! getFileFormatVersion().writeCas(
file,
dicoParams_.createCasWriterInterface(casFileName_),
_progress);
! r.setDesc("Sauvegarde fichier cas " + file.getAbsolutePath());
! if (ui_.manageErrorOperation(r)) {
! casFileTimeLoaded_= System.currentTimeMillis();
isModified_= false;
}
--- 324,333 ----
}
FileOperationSynthese r=
! getFileFormatVersion().writeMaillage(
file,
dicoParams_.createCasWriterInterface(casFileName_),
_progress);
! if (ui_.manageErrorOperationAndIsFatal(r)) {
! fileLastModified_= file.lastModified();
isModified_= false;
}
***************
*** 354,358 ****
dirBase_= _n.getParentFile().getAbsolutePath();
casFileName_= _n.getName();
! casFileTimeLoaded_= System.currentTimeMillis();
isModified_= false;
}
--- 351,355 ----
dirBase_= _n.getParentFile().getAbsolutePath();
casFileName_= _n.getName();
! fileLastModified_= System.currentTimeMillis();
isModified_= false;
}
***************
*** 362,369 ****
public FDicoComparator compareWith(File _n, ProgressionInterface _progress) {
! FileOperationSynthese syn= new FileOperationSynthese();
if (_progress != null)
_progress.setDesc("lecture " + _n.getName());
! DicoCasInterface inter= getFileFormatVersion().readCas(_n, syn, _progress);
if (syn.containsFatalError()) {
ui_.error(
--- 359,367 ----
public FDicoComparator compareWith(File _n, ProgressionInterface _progress) {
!
if (_progress != null)
_progress.setDesc("lecture " + _n.getName());
! FileOperationSynthese syn= getFileFormatVersion().read(_n, _progress);
! DicoCasInterface inter=(DicoCasInterface)syn.getSource();
if (syn.containsFatalError()) {
ui_.error(
***************
*** 446,454 ****
}
FileOperationSynthese op=
! getFileFormatVersion().writeCas(
_n,
new DicoCasAbstract(entitesValues),
_progress);
! if (ui_.manageErrorOperation(op)) {
isModified_= false;
return true;
--- 444,452 ----
}
FileOperationSynthese op=
! getFileFormatVersion().writeMaillage(
_n,
new DicoCasAbstract(entitesValues),
_progress);
! if (ui_.manageErrorOperationAndIsFatal(op)) {
isModified_= false;
return true;
***************
*** 470,474 ****
*/
public long getCasFileTimeLoaded() {
! return casFileTimeLoaded_;
}
--- 468,472 ----
*/
public long getCasFileTimeLoaded() {
! return fileLastModified_;
}
Index: FDicoProjetAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoProjetAbstract.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FDicoProjetAbstract.java 19 Aug 2003 07:48:40 -0000 1.3
--- FDicoProjetAbstract.java 22 Aug 2003 16:02:23 -0000 1.4
***************
*** 49,53 ****
protected FudaaCalculAction actions_;
BuInformationsDocument idoc_;
! FDicoFilleProjet entiteFille_;
public FDicoProjetAbstract(FudaaCommonImplementation _impl) {
--- 49,53 ----
protected FudaaCalculAction actions_;
BuInformationsDocument idoc_;
! protected FDicoFilleProjet entiteFille_;
public FDicoProjetAbstract(FudaaCommonImplementation _impl) {
***************
*** 89,97 ****
}
public void active() {
if (impl_ == null)
return;
if (entiteFille_ == null) {
! entiteFille_= new FDicoFilleProjet(this);
Dimension dim= impl_.getMainPanel().getDesktop().getSize();
entiteFille_.setSize(
--- 89,109 ----
}
+ protected void buildEntiteFille() {
+ if (entiteFille_ != null)
+ return;
+ entiteFille_= new FDicoFilleProjet(this);
+ JMenuBar menu= entiteFille_.getJMenuBar();
+ JButton bt= new BuButton("Comparer");
+ bt.addActionListener(this);
+ bt.setIcon(FudaaResource.FUDAA.getIcon("diff_16"));
+ bt.setActionCommand("COMPARER");
+ menu.add(bt);
+ }
+
public void active() {
if (impl_ == null)
return;
if (entiteFille_ == null) {
! buildEntiteFille();
Dimension dim= impl_.getMainPanel().getDesktop().getSize();
entiteFille_.setSize(
***************
*** 100,112 ****
entiteFille_.setLocation(0, 0);
impl_.addInternalFrame(entiteFille_);
}
! JMenuBar menu= entiteFille_.getJMenuBar();
! JButton bt= new BuButton("Comparer");
! bt.addActionListener(this);
! bt.setIcon(FudaaResource.FUDAA.getIcon("diff_16"));
! bt.setActionCommand("COMPARER");
! menu.add(bt);
! entiteFille_.pack();
! entiteFille_.setVisible(true);
}
--- 112,120 ----
entiteFille_.setLocation(0, 0);
impl_.addInternalFrame(entiteFille_);
+ } else {
+ impl_.activateInternalFrame(entiteFille_);
}
! // entiteFille_.pack();
! // entiteFille_.setVisible(true);
}
|
|
From: <de...@us...> - 2003-08-22 23:17:09
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr
In directory sc8-pr-cvs1:/tmp/cvs-serv7810/tr
Modified Files:
TrExport.java TrFileFormatManager.java TrImplHelper.java
TrImplementation.java TrProjet.java
Added Files:
TrFilleVisu.java TrLoaderThread.java TrParametres.java
Log Message:
tr: ajout de l'export pour le maillage
gestion affichage maillage
commun modif mineure
--- NEW FILE: TrFilleVisu.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: TrLoaderThread.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: TrParametres.java ---
(This appears to be a binary file; contents omitted.)
Index: TrExport.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrExport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrExport.java 19 Aug 2003 07:48:40 -0000 1.1
--- TrExport.java 22 Aug 2003 16:02:23 -0000 1.2
***************
*** 9,15 ****
--- 9,41 ----
package org.fudaa.fudaa.tr;
+ import java.io.File;
+ import java.lang.reflect.Method;
+
+ import javax.swing.ButtonGroup;
+ import javax.swing.JFileChooser;
+ import javax.swing.JPanel;
+ import javax.swing.JRadioButton;
+ import javax.swing.JTextField;
+
+ import com.memoire.bu.BuGridLayout;
+ import com.memoire.bu.BuRadioButton;
+ import com.memoire.bu.BuTaskOperation;
+ import com.memoire.bu.BuVerticalLayout;
+
+ import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.commun.ProgressionBuAdapter;
+ import org.fudaa.dodico.commun.ProgressionInterface;
+ import org.fudaa.dodico.dunes.io.DunesFileFormat;
+ import org.fudaa.dodico.h2d.H2dFileFormatMaillageVersion;
+ import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dParametres;
+ import org.fudaa.dodico.h2d.type.H2dElementType;
+ import org.fudaa.dodico.reflux.io.CorEleBthFileFormat;
+ import org.fudaa.dodico.telemac.io.SerafinFileFormat;
+
+ import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
import org.fudaa.fudaa.commun.FudaaLib;
+ import org.fudaa.fudaa.commun.fileChooser.FudaaFileChooser;
/**
***************
*** 18,36 ****
* @version $Id$
*/
! public class TrExport {
! public static String EXPORT_PREF="EXPORT";
! H2dParametres params_;
/**
*
*/
! public TrExport(H2dParametres _p) {
! params_=_p;
}
!
!
! public void export(String _s){
! String f=_s.substring(EXPORT_PREF.length());
! if(FudaaLib.DEBUG) System.out.println("export "+f);
}
--- 44,343 ----
* @version $Id$
*/
! public abstract class TrExport {
! public static String EXPORT_PREF= "EXPORT";
! protected TrParametres params_;
! TrImplementation ui_;
/**
*
*/
! public TrExport(TrParametres _p, TrImplementation _ui) {
! params_= _p;
! ui_= _ui;
}
!
! public TrParametres getParams() {
! return params_;
! }
!
! public TrImplementation getUI() {
! return ui_;
! }
!
! public void export(String _s) {
! String f= _s.substring(EXPORT_PREF.length());
! if (FudaaLib.DEBUG)
! System.out.println("export " + f);
!
! try {
! final Method m= getClass().getMethod("export" + f, null);
! if (m != null) {
! try {
! m.invoke(TrExport.this, null);
! } catch (Exception _ex) {
! _ex.printStackTrace();
! ui_.error(
! TrLib.geti18n("Erreur interne accès methode export")
! + DodicoLib.EMPTY_STRING
! + f);
! }
! }
! } catch (NoSuchMethodException _ex) {
! if (FudaaLib.DEBUG)
! System.out.println("Export non supporté " + f);
! ui_.error(
! TrLib.geti18n("Export non supporté") + DodicoLib.EMPTY_STRING + f);
! }
!
! }
!
! public static class ExportDialog extends EbliSimpleDialogPanel {
! JTextField file_;
!
! public ExportDialog() {
! setLayout(new BuVerticalLayout(5, true, false));
! addEmptyBorder(5);
! file_= addLabelFileChooserPanel(TrLib.geti18n("Fichier"), true);
! }
!
! public File getFileExport() {
! return new File(file_.getText());
! }
!
! /**
! * Renvoie le file chooser de fudaa.
! */
! public JFileChooser createFileChooser() {
! return new FudaaFileChooser();
! }
!
! /**
! *
! */
! public boolean valide() {
! return file_.getText().length() > 0;
! }
!
! }
!
! public static class MaillageT3T6Panel extends JPanel {
!
! ButtonGroup group_;
!
! public MaillageT3T6Panel(H2dMaillage _m) {
! setLayout(new BuGridLayout(1, 5, 5));
! H2dElementType type= _m.getEltType();
! group_= new ButtonGroup();
! System.out.println(type);
! if (type == H2dElementType.T6) {
! JRadioButton b= new BuRadioButton();
! b.setText("pas de transformation");
! b.setActionCommand("TRANSFO_NOTHING");
! group_.add(b);
! add(b);
! b.setSelected(true);
! b= new BuRadioButton();
! b.setText("T6 -> T3");
! b.setActionCommand("TRANSFO_T3");
! add(b);
! group_.add(b);
! b= new BuRadioButton();
! b.setText("T6 -> 4 T3");
! b.setActionCommand("TRANSFO_4T3");
! group_.add(b);
! add(b);
! } else if (type == H2dElementType.T3) {
! JRadioButton b= new BuRadioButton();
! b.setText("pas de transformation");
! b.setActionCommand("TRANSFO_NOTHING");
! b.setSelected(true);
! group_.add(b);
! add(b);
! b= new BuRadioButton();
! b.setText("T3 -> T6");
! b.setActionCommand("TRANSFO_T6");
! group_.add(b);
! add(b);
! }
! }
!
! public String getSelectedAction() {
! return group_.getSelection().getActionCommand();
! }
!
! public static boolean needTransfo(String _s) {
! return !"TRANSFO_NOTHING".equals(_s);
! }
! };
!
! public abstract void loadMaillage(
! ProgressionInterface _inter,
! TrThreadListener _l);
!
! public void transformAndWriteMaillage(final H2dFileFormatMaillageVersion _ftMaillage) {
! H2dMaillage m= params_.getMaillage();
! if (m == null) {
! final TrThreadListener th= new TrThreadListener() {
! public void threadIsFinish() {
! transformAndWriteMaillageExe(_ftMaillage);
! }
! };
! new BuTaskOperation(ui_, TrLib.geti18n("Chargement maillage")) {
! public void act() {
! loadMaillage(new ProgressionBuAdapter(this), th);
! }
! }
! .start();
! } else
! transformAndWriteMaillageExe(_ftMaillage);
!
! }
!
! public void transformAndWriteMaillageExe(H2dFileFormatMaillageVersion _ftMaillage) {
! H2dMaillage m= params_.getMaillage();
! if (m == null)
! return;
! ExportDialog dialog= new ExportDialog();
! MaillageT3T6Panel pn= new MaillageT3T6Panel(m);
! dialog.add(pn);
! if (dialog
! .isOkResponse(
! dialog.afficheModale(
! ui_.getFrame(),
! "Export" + " " + _ftMaillage.getName()))) {
! TransformAndWriteMaillageOp op=
! new TransformAndWriteMaillageOp(_ftMaillage);
! op.setFile(dialog.getFileExport());
! op.setTransfo(pn.getSelectedAction());
! op.start();
! }
!
! }
!
! private class TransformAndWriteMaillageOp extends BuTaskOperation {
! H2dFileFormatMaillageVersion formatName_;
! String transfo_;
! File f_;
! TransformAndWriteMaillageOp(H2dFileFormatMaillageVersion _formatName) {
! super(ui_, _formatName.getName());
! formatName_= _formatName;
! }
!
! public void setTransfo(String _transfo) {
! transfo_= _transfo;
! }
!
! public void setFile(File _f) {
! f_= _f;
! }
!
! public String getFormatName() {
! return formatName_.getName();
! }
!
! public void act() {
! if (f_ == null) {
! System.out.println("fichier de dest nul");
! return;
! }
! ProgressionInterface prog= new ProgressionBuAdapter(this);
! H2dMaillage maillage= params_.getMaillage();
! if (MaillageT3T6Panel.needTransfo(transfo_)) {
!
! if ("TRANSFO_T6".equals(transfo_)) {
! ui_.getMainPanel().setMessage("Transformation maillage en T6");
! maillage= maillage.maillageT3enT6(prog, null);
! } else if ("TRANSFO_T3".equals(transfo_)) {
! ui_.getMainPanel().setMessage("Transformation maillage en T3");
! maillage= maillage.maillageT6enT3(prog, null);
! } else if ("TRANSFO_4T3".equals(transfo_)) {
! ui_.getMainPanel().setMessage("Transformation maillage en T3 (4)");
! maillage= maillage.maillageT6en4T3(prog);
! } else {
! ui_.error("Transformation inconnue");
! }
! }
! ui_.getMainPanel().setMessage("Ecriture fichier");
! ui_.getMainPanel().setMessage("");
! ui_.getMainPanel().setProgression(50);
! File[] f= formatName_.getFileFormat().getFile(f_);
! int n= f.length;
! StringBuffer b= new StringBuffer(150);
! for (int i= 0; i < n; i++) {
! if (f[i].exists()) {
! if (b.length() > 0)
! b.append(DodicoLib.LINE_SEP);
! b.append(f[i].getAbsolutePath());
! }
! }
! if (b.length() > 0) {
! if (!ui_
! .confirmation(
! TrLib.geti18n("Ecraser les fichiers"),
! TrLib.geti18n("Les fichiers suivants vont être effacés")
! + ":"
! + DodicoLib.LINE_SEP
! + b.toString()
! + DodicoLib.LINE_SEP
! + TrLib.geti18n("Voulez-vous continuer ?")))
! return;
!
! }
! boolean fatal=
! ui_.manageErrorOperationAndIsFatal(
! formatName_.writeMaillage(f_, maillage, prog));
! ui_.getMainPanel().setProgression(0);
! if (fatal) {
! ui_.error(
! TrLib.geti18n("Ecriture") + " " + formatName_.getName(),
! TrLib.geti18n("Erreur lors de l'ecriture du fichier")
! + " "
! + f_.getAbsolutePath());
! }
! }
! }
!
! public void exportMaillage(TransformAndWriteMaillageOp _maillage) {
! H2dMaillage m= params_.getMaillage();
!
! if (m == null) {
! new TrLoaderThread(getUI(), "chargement maillage") {
! public void load(ProgressionInterface _inter) {
! params_.loadGeometrie(_inter);
! }
! }
! .launchLoad();
! m= params_.getMaillage();
! if (m == null)
! return;
! }
! ExportDialog dialog= new ExportDialog();
! MaillageT3T6Panel pn= new MaillageT3T6Panel(m);
! dialog.add(pn);
! if (dialog
! .isOkResponse(
! dialog.afficheModale(
! ui_.getFrame(),
! "Export" + " " + _maillage.getFormatName()))) {
! _maillage.setTransfo(pn.getSelectedAction());
! _maillage.setFile(dialog.getFileExport());
! _maillage.start();
! }
! }
!
! public void exportCORELEBTH() {
! transformAndWriteMaillage(
! CorEleBthFileFormat.getInstance().getLastVersionImpl());
!
! }
!
! public void exportDUNES() {
! transformAndWriteMaillage(
! DunesFileFormat.getInstance().getLastVersionImpl());
! }
!
! public void exportSERAFIN() {
! transformAndWriteMaillage(
! SerafinFileFormat.getInstance().getLastVersionImpl());
}
Index: TrFileFormatManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrFileFormatManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrFileFormatManager.java 19 Aug 2003 07:48:40 -0000 1.2
--- TrFileFormatManager.java 22 Aug 2003 16:02:23 -0000 1.3
***************
*** 38,42 ****
* @version $Id$
*/
! public class TrFileFormatManager{
private FileFormat[] formats_;
--- 38,42 ----
* @version $Id$
*/
! public class TrFileFormatManager {
private FileFormat[] formats_;
***************
*** 108,112 ****
* {@link org.fudaa.dodico.h2d.type.H2dFileFormatType H2dFileFormatType}.
*/
! public void buildExportMenu(BuMenu _m,TrImplementation _impl) {
List l= H2dFileFormatType.LIST;
int n= l.size();
--- 108,112 ----
* {@link org.fudaa.dodico.h2d.type.H2dFileFormatType H2dFileFormatType}.
*/
! public void buildExportMenu(BuMenu _m, TrImplementation _impl) {
List l= H2dFileFormatType.LIST;
int n= l.size();
***************
*** 116,119 ****
--- 116,120 ----
FileFormat[] fts= getFormatWithType(ft.getId());
BuMenu me= new BuMenu(ft.getNom(), ft.getNom());
+
//pour trier ( pas super intelligent ....)
TreeMap map= new TreeMap();
***************
*** 125,132 ****
me.addMenuItem(id, TrExport.EXPORT_PREF + (String)map.get(id), _impl);
}
! _m.addSubMenu(me, true);
}
}
-
}
--- 126,133 ----
me.addMenuItem(id, TrExport.EXPORT_PREF + (String)map.get(id), _impl);
}
! //TODO : a ameliorer
! _m.addSubMenu(me, ft == H2dFileFormatType.MAILLAGE);
}
}
}
Index: TrImplHelper.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplHelper.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrImplHelper.java 19 Aug 2003 07:48:40 -0000 1.4
--- TrImplHelper.java 22 Aug 2003 16:02:23 -0000 1.5
***************
*** 30,36 ****
public TrImplHelper(TrImplementation _impl) {
impl_= _impl;
! impl_.getFrame().setTitle("Superviseur " + getID());
impl_.getFrame().setIconImage(
! FudaaResource.FUDAA.getIcon("appli/" + getID()).getImage());
}
--- 30,36 ----
public TrImplHelper(TrImplementation _impl) {
impl_= _impl;
! impl_.getFrame().setTitle("Superviseur " + getSoftwareID());
impl_.getFrame().setIconImage(
! FudaaResource.FUDAA.getIcon("appli/" + getSoftwareID()).getImage());
}
***************
*** 44,51 ****
public BuIcon getIcon() {
! return FudaaResource.FUDAA.getToolIcon("appli/" + getID());
}
! public abstract String getID();
public BuMenuItem[] getMenuItemsOuvrir() {
--- 44,51 ----
public BuIcon getIcon() {
! return FudaaResource.FUDAA.getToolIcon("appli/" + getSoftwareID());
}
! public abstract String getSoftwareID();
public BuMenuItem[] getMenuItemsOuvrir() {
***************
*** 61,65 ****
TrImplementation _impl) {
if (_impl.getCurrentImplHelper() != null) {
! if (_id.equals(_impl.getCurrentImplHelper().getID())) {
return _impl.getCurrentImplHelper();
}
--- 61,65 ----
TrImplementation _impl) {
if (_impl.getCurrentImplHelper() != null) {
! if (_id.equals(_impl.getCurrentImplHelper().getSoftwareID())) {
return _impl.getCurrentImplHelper();
}
Index: TrImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplementation.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrImplementation.java 19 Aug 2003 07:48:40 -0000 1.4
--- TrImplementation.java 22 Aug 2003 16:02:23 -0000 1.5
***************
*** 19,22 ****
--- 19,23 ----
import javax.swing.JMenu;
+ import javax.swing.JScrollPane;
import com.memoire.bu.BuColumn;
***************
*** 38,43 ****
--- 39,46 ----
import org.fudaa.dodico.fichiers.FileFormatSoftware;
+ import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat;
import org.fudaa.ebli.calque.BArbreCalque;
+ import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.fudaa.commun.FudaaCommonImplementation;
***************
*** 109,113 ****
String id= dialc.getValue();
! if (!id.equals(getCurrentImplHelper().getID())) {
if (FudaaLib.DEBUG)
System.out.println("choix " + id);
--- 112,116 ----
String id= dialc.getValue();
! if (!id.equals(getCurrentImplHelper().getSoftwareID())) {
if (FudaaLib.DEBUG)
System.out.println("choix " + id);
***************
*** 126,130 ****
protected void ouvrirId(String _id) {
! if (_id.equals(FileFormatSoftware.TELEMAC_IS.name)) {
TrTelemacImplHelper h=
(TrTelemacImplHelper)TrImplHelper.getImplHelper(
--- 129,134 ----
protected void ouvrirId(String _id) {
! if (_id
! .equals(TelemacDicoFileFormat.DICO_PROJET_ID)) {
TrTelemacImplHelper h=
(TrTelemacImplHelper)TrImplHelper.getImplHelper(
***************
*** 134,138 ****
error("Erreur interne", "impossible de trouver l'implantation telemac");
h.ouvrirDico();
-
} else {
TrImplHelper h= TrImplHelper.getImplHelper(_id, this);
--- 138,141 ----
***************
*** 152,162 ****
}
! protected void ouvrir(File _f, String _id) {
! TrImplHelper h= TrImplHelper.getImplHelper(_id, this);
! if (h == null)
! error("Erreur interne", "impossible de trouver l'implantation");
! else
! h.ouvrir(_f);
! }
public void actionPerformed(ActionEvent _evt) {
--- 155,165 ----
}
! // protected void ouvrir(File _f, String _id) {
! // TrImplHelper h= TrImplHelper.getImplHelper(_id, this);
! // if (h == null)
! // error("Erreur interne", "impossible de trouver l'implantation");
! // else
! // h.ouvrir(_f);
! // }
public void actionPerformed(ActionEvent _evt) {
***************
*** 183,189 ****
} else if ("MODIFIER_CHAINE".equals(action)) {
changeChaineCalcul();
! } else if (action.startsWith(TrExport.EXPORT_PREF)){
projetCourant().export(action);
!
} else {
super.actionPerformed(_evt);
--- 186,192 ----
} else if ("MODIFIER_CHAINE".equals(action)) {
changeChaineCalcul();
! } else if (action.startsWith(TrExport.EXPORT_PREF)) {
projetCourant().export(action);
!
} else {
super.actionPerformed(_evt);
***************
*** 273,277 ****
setEnabledForAction("CREER", false);
setEnabledForAction("OUVRIR", true);
! setEnabledForAction("EXPORTER", true);
setEnabledForAction("QUITTER", true);
setEnabledForAction("PREFERENCE", true);
--- 276,280 ----
setEnabledForAction("CREER", false);
setEnabledForAction("OUVRIR", true);
! setEnabledForAction("EXPORTER", false);
setEnabledForAction("QUITTER", true);
setEnabledForAction("PREFERENCE", true);
***************
*** 302,305 ****
--- 305,309 ----
setEnabledForAction("ENREGISTRERCOPIE", false);
setEnabledForAction("FERMER", false);
+ setEnabledForAction("EXPORTER", false);
}
***************
*** 314,317 ****
--- 318,322 ----
setEnabledForAction("ENREGISTRERCOPIE", true);
setEnabledForAction("FERMER", true);
+ setEnabledForAction("EXPORTER", true);
}
***************
*** 444,447 ****
--- 449,469 ----
}
+ public BArbreCalque getArbreCalque() {
+ if (arbre_ != null)
+ return arbre_;
+ arbre_= new BArbreCalque();
+ arbre_.setRootVisible(false);
+ arbre_.setModel(null);
+ JScrollPane sp= new JScrollPane(arbre_);
+ sp.setSize(150, 150);
+ sp.setVisible(false);
+ getMainPanel().getRightColumn().addToggledComponent(
+ EbliResource.EBLI.getString("Calques"),
+ "CALQUE",
+ sp,
+ this);
+ return arbre_;
+ }
+
/**
*
***************
*** 456,460 ****
private void buildExporterMenu() {
fileFormatMng_.buildExportMenu(
! (BuMenu)getMainMenuBar().getMenu("EXPORTER"),this);
}
--- 478,483 ----
private void buildExporterMenu() {
fileFormatMng_.buildExportMenu(
! (BuMenu)getMainMenuBar().getMenu("EXPORTER"),
! this);
}
***************
*** 467,471 ****
System.out.println(((BuMenu)e.getSource()).getActionCommand());
BuMenu menu= (BuMenu)e.getSource();
! if(menu.getMenuComponentCount()!=0) return;
if (menu.getActionCommand().equals("EXPORTER")) {
buildExporterMenu();
--- 490,495 ----
System.out.println(((BuMenu)e.getSource()).getActionCommand());
BuMenu menu= (BuMenu)e.getSource();
! if (menu.getMenuComponentCount() != 0)
! return;
if (menu.getActionCommand().equals("EXPORTER")) {
buildExporterMenu();
Index: TrProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrProjet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrProjet.java 19 Aug 2003 07:48:40 -0000 1.4
--- TrProjet.java 22 Aug 2003 16:02:23 -0000 1.5
***************
*** 24,28 ****
- public String getID();
public BuInformationsDocument getInformationsDocument();
--- 24,27 ----
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/fichiers
Modified Files:
FileFormatSoftware.java FileFormatVersion.java
FileOpReadCharSimpleAbstract.java
FileOpWriterCharSimpleAbstract.java FileOperationAbstract.java
FileOperationSynthese.java
Added Files:
FileReadOperationAbstract.java FileWriteOperationAbstract.java
Removed Files:
FileOperationInterface.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
--- NEW FILE: FileReadOperationAbstract.java ---
/*
* @file FileInterface.java
* @creation 6 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.fichiers;
import org.fudaa.dodico.commun.DodicoLib;
/**
* @author deniger
* @version $Id: FileReadOperationAbstract.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public abstract class FileReadOperationAbstract extends FileOperationAbstract{
protected abstract Object _read();
/**
*
*/
public final FileOperationSynthese read() {
return closeOperation(_read());
}
/**
*
*/
protected String getOperationDescription() {
return DodicoLib.geti18n("Lecture");
}
}
--- NEW FILE: FileWriteOperationAbstract.java ---
(This appears to be a binary file; contents omitted.)
Index: FileFormatSoftware.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileFormatSoftware.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileFormatSoftware.java 18 Aug 2003 11:48:02 -0000 1.1
--- FileFormatSoftware.java 22 Aug 2003 15:51:12 -0000 1.2
***************
*** 21,26 ****
public final static BuInformationsSoftware REFLUX_IS=
new BuInformationsSoftware();
- public final static BuInformationsSoftware DICO_IS=
- new BuInformationsSoftware();
static {
--- 21,24 ----
***************
*** 36,43 ****
REFLUX_IS.contact= "pat...@eq...";
- DICO_IS.name= "dico";
- DICO_IS.http= "http://telemacsystem.com";
- DICO_IS.rights= "LNHE";
- DICO_IS.contact= "in...@te...";
}
--- 34,37 ----
Index: FileFormatVersion.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileFormatVersion.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileFormatVersion.java 18 Aug 2003 11:48:02 -0000 1.1
--- FileFormatVersion.java 22 Aug 2003 15:51:12 -0000 1.2
***************
*** 17,21 ****
* @version $Id$
*/
! public class FileFormatVersion {
String version_;
FileFormat ft_;
--- 17,21 ----
* @version $Id$
*/
! public abstract class FileFormatVersion {
String version_;
FileFormat ft_;
***************
*** 24,33 ****
*
*/
! public FileFormatVersion(FileFormat _ft,String _nom) {
version_= _nom;
! ft_=_ft;
}
!
! public FileFormat getFileFormat(){
return ft_;
}
--- 24,33 ----
*
*/
! public FileFormatVersion(FileFormat _ft, String _nom) {
version_= _nom;
! ft_= _ft;
}
!
! public FileFormat getFileFormat() {
return ft_;
}
***************
*** 36,46 ****
return version_;
}
!
! public String getFormatName(){
return ft_.getName();
}
public String toString() {
! return getFormatName()+" "+version_;
}
--- 36,51 ----
return version_;
}
!
! public String getFormatName() {
return ft_.getName();
}
+
+ public String getName(){
+ return getFormatName() + " " + version_;
+ }
public String toString() {
! return getName();
!
}
***************
*** 55,59 ****
/**
! * Compare selon le nom de le nom de l'enumeration
*/
public int compareTo(Object o) {
--- 60,64 ----
/**
! * Compare selon le num de version
*/
public int compareTo(Object o) {
***************
*** 66,87 ****
}
! public static void initOperation(
! FileOperationSynthese _synt,
! FileOperationInterface _op,
! ProgressionInterface _progress,
! File _f) {
! _op.setProgressReceiver(_progress);
! _op.setFile(_f);
! _synt.setMainFile(_f);
}
! public static FileOperationSynthese initOperation(
! FileOperationInterface _op,
! ProgressionInterface _progress,
! File _f) {
! FileOperationSynthese r= new FileOperationSynthese();
! initOperation(r, _op, _progress, _f);
return r;
}
}
--- 71,107 ----
}
! // public static void initOperation(
! // FileOperationSynthese _synt,
! // FileOperationInterface _op,
! // ProgressionInterface _progress,
! // File _f) {
! //
! // }
!
! public abstract FileReadOperationAbstract createReader();
! public abstract FileWriteOperationAbstract createWriter();
!
! public FileOperationSynthese read(File _f, ProgressionInterface _prog) {
! FileReadOperationAbstract i= createReader();
! i.setFile(_f);
! i.setProgressReceiver(_prog);
! FileOperationSynthese r= i.read();
! i.setProgressReceiver(null);
! return r;
}
! public FileOperationSynthese write(
! File _f,
! Object _source,
! ProgressionInterface _prog) {
! FileWriteOperationAbstract i= createWriter();
! i.setFile(_f);
! i.setProgressReceiver(_prog);
! FileOperationSynthese r= i.write(_source);
! i.setProgressReceiver(null);
return r;
+
}
}
+
Index: FileOpReadCharSimpleAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileOpReadCharSimpleAbstract.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileOpReadCharSimpleAbstract.java 4 Jul 2003 12:41:19 -0000 1.1
--- FileOpReadCharSimpleAbstract.java 22 Aug 2003 15:51:12 -0000 1.2
***************
*** 17,20 ****
--- 17,21 ----
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.fortran.FortranInterface;
import org.fudaa.dodico.fortran.FortranReader;
***************
*** 25,66 ****
*/
public abstract class FileOpReadCharSimpleAbstract
! extends FileOperationAbstract
! {
protected FortranReader in_;
! public final void setFile(File _f)
! {
FileReader r= null;
! try
! {
r= new FileReader(_f);
! }
! catch (FileNotFoundException _e)
! {
! //manageException(_e, analyze_);
}
if (r != null)
setFile(r);
}
! public final void setFile(File[] _f)
! {
setFile(_f[0]);
}
! public final void setFile(Reader _r)
! {
in_= new FortranReader(_r);
}
! public final void close() throws IOException
! {
! in_.close();
}
! protected void addAnalyzeLigneLue(DodicoAnalyze.Editor _analyze)
! {
! _analyze.addInfo(DodicoLib.geti18n("Ligne lue") + ": " + in_.getLine(), in_);
! }
}
--- 26,71 ----
*/
public abstract class FileOpReadCharSimpleAbstract
! extends FileReadOperationAbstract{
protected FortranReader in_;
! public final void setFile(File _f) {
! analyze_= new DodicoAnalyze.Editor();
! analyze_.setRessource(_f.getAbsolutePath());
FileReader r= null;
! try {
r= new FileReader(_f);
! } catch (FileNotFoundException _e) {
! analyze_.addFatalError(DodicoLib.geti18n("Fichier inconnu"));
}
if (r != null)
setFile(r);
}
+
+
! public final void setFile(File[] _f) {
setFile(_f[0]);
}
! private final void setFile(Reader _r) {
in_= new FortranReader(_r);
}
!
! protected void addAnalyzeLigneLue() {
! analyze_.addInfo(
! DodicoLib.geti18n("Ligne lue") + ": " + in_.getLine(),
! in_);
}
+
+ protected abstract Object _read();
!
! /**
! *
! */
! protected FortranInterface getFortranInterface() {
! return in_;
! }
}
Index: FileOpWriterCharSimpleAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileOpWriterCharSimpleAbstract.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileOpWriterCharSimpleAbstract.java 4 Jul 2003 12:41:19 -0000 1.1
--- FileOpWriterCharSimpleAbstract.java 22 Aug 2003 15:51:12 -0000 1.2
***************
*** 14,18 ****
--- 14,20 ----
import java.io.Writer;
+ import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.fortran.FortranInterface;
import org.fudaa.dodico.fortran.FortranLib;
***************
*** 22,59 ****
* @version $Id$
*/
! public abstract class FileOpWriterCharSimpleAbstract extends FileOperationAbstract
! {
protected String lineSep_;
protected Writer out_;
! public FileOpWriterCharSimpleAbstract()
! {
! lineSep_ = DodicoLib.LINE_SEP;
}
! public void writeln() throws IOException
! {
out_.write(lineSep_);
}
! public void writeln(StringBuffer _b) throws IOException
! {
write(_b.append(lineSep_));
}
! public void write(StringBuffer _b) throws IOException
! {
out_.write(_b.toString());
_b.setLength(0);
}
! public void writeln(String _b) throws IOException
! {
write(_b + lineSep_);
}
! public void write(String _b) throws IOException
! {
out_.write(_b);
}
--- 24,55 ----
* @version $Id$
*/
! public abstract class FileOpWriterCharSimpleAbstract
! extends FileWriteOperationAbstract {
protected String lineSep_;
protected Writer out_;
! public FileOpWriterCharSimpleAbstract() {
! lineSep_= DodicoLib.LINE_SEP;
}
! public void writeln() throws IOException {
out_.write(lineSep_);
}
! public void writeln(StringBuffer _b) throws IOException {
write(_b.append(lineSep_));
}
! public void write(StringBuffer _b) throws IOException {
out_.write(_b.toString());
_b.setLength(0);
}
! public void writeln(String _b) throws IOException {
write(_b + lineSep_);
}
! public void write(String _b) throws IOException {
out_.write(_b);
}
***************
*** 63,68 ****
* @return separateur de ligne
*/
! public final String getLineSeparator()
! {
return lineSep_;
}
--- 59,63 ----
* @return separateur de ligne
*/
! public final String getLineSeparator() {
return lineSep_;
}
***************
*** 72,90 ****
* @param lineSep The lineSep to set
*/
! public final void setLineSeparator(String lineSep)
! {
! lineSep_ = lineSep;
}
! public final void setFile(File _f)
! {
! FileWriter out = null;
! try
! {
! out = new FileWriter(_f);
! }
! catch (IOException _e)
! {
! // manageException(_e, analyze_);
}
if (out != null)
--- 67,81 ----
* @param lineSep The lineSep to set
*/
! public final void setLineSeparator(String lineSep) {
! lineSep_= lineSep;
}
! public final void setFile(File _f) {
! analyze_= new DodicoAnalyze.Editor();
! analyze_.setRessource(_f.getAbsolutePath());
! FileWriter out= null;
! try {
! out= new FileWriter(_f);
! } catch (IOException _e) {
}
if (out != null)
***************
*** 93,109 ****
}
! public final void setFile(File[] _f)
! {
setFile(_f[0]);
}
! public final void setFile(Writer _f)
! {
! out_ = _f;
}
! public final void close() throws IOException
! {
! out_.close();
}
--- 84,103 ----
}
! public final void setFile(File[] _f) {
setFile(_f[0]);
}
! private final void setFile(Writer _f) {
! out_= _f;
}
! protected FortranInterface getFortranInterface() {
! return new FortranInterface() {
!
! public void close() throws IOException {
! if (out_ != null)
! out_.close();
! }
! };
}
Index: FileOperationAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileOperationAbstract.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileOperationAbstract.java 4 Jul 2003 12:41:19 -0000 1.1
--- FileOperationAbstract.java 22 Aug 2003 15:51:12 -0000 1.2
***************
*** 1,5 ****
/*
! * @file FileOperationAbstract.java
! * @creation 8 juin 2003
* @modification $Date$
* @license GNU General Public License 2
--- 1,5 ----
/*
! * @file FileWriteOperation.java
! * @creation 22 août 2003
* @modification $Date$
* @license GNU General Public License 2
***************
*** 16,74 ****
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.ProgressionInterface;
/**
! * @author fred deniger
* @version $Id$
- *
*/
! public abstract class FileOperationAbstract implements FileOperationInterface
! {
protected ProgressionInterface progress_;
! public ProgressionInterface getProgressReceiver()
! {
! return progress_;
! }
! public void setProgressReceiver(ProgressionInterface _progressReceiver)
! {
progress_= _progressReceiver;
}
! protected final DodicoAnalyze.Editor[] initAnalyze(int _nb)
! {
! DodicoAnalyze.Editor[] analyze_= new DodicoAnalyze.Editor[_nb];
! for (int i= _nb - 1; i >= 0; i--)
! {
! analyze_[i]= new DodicoAnalyze.Editor();
! }
! return analyze_;
}
! public static final FileReader initFileReader(File _f)
! {
FileReader r= null;
! try
! {
r= new FileReader(_f);
! }
! catch (FileNotFoundException _e)
! {
! //manageException(_e, analyze_[_i]);
}
return r;
}
! public static final FileWriter initFileWriter(File _f)
! {
FileWriter r= null;
! try
! {
r= new FileWriter(_f);
! }
! catch (IOException _e)
! {
! //manageException(_e, analyze_[_i]);
}
return r;
--- 16,75 ----
import org.fudaa.dodico.commun.DodicoAnalyze;
+ import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionInterface;
+ import org.fudaa.dodico.fortran.FortranInterface;
+ import org.fudaa.dodico.fortran.FortranLib;
/**
! * @author deniger
* @version $Id$
*/
! public abstract class FileOperationAbstract {
protected ProgressionInterface progress_;
+ protected DodicoAnalyze.Editor analyze_;
! public void setProgressReceiver(ProgressionInterface _progressReceiver) {
progress_= _progressReceiver;
}
! protected abstract String getOperationDescription();
! protected abstract FortranInterface getFortranInterface();
!
! public abstract void setFile(File _f);
! public abstract FileFormatVersion getVersion();
!
! protected final FileOperationSynthese closeOperation(Object _o) {
! FileOperationSynthese r= new FileOperationSynthese();
! FortranInterface out= getFortranInterface();
! r.setClosingOperation(FortranLib.closeState(out));
! r.setFileOp(out);
! analyze_.setDesc(
! getOperationDescription()
! + DodicoLib.EMPTY_STRING
! + DodicoLib.geti18n("Format")
! + ": "
! + getVersion());
! r.setAnalyze(analyze_);
! r.setSource(_o);
! progress_= null;
! analyze_= null;
! return r;
}
! public static final FileReader initFileReader(File _f) {
FileReader r= null;
! try {
r= new FileReader(_f);
! } catch (FileNotFoundException _e) {
}
return r;
}
! public static final FileWriter initFileWriter(File _f) {
FileWriter r= null;
! try {
r= new FileWriter(_f);
! } catch (IOException _e) {
}
return r;
Index: FileOperationSynthese.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileOperationSynthese.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FileOperationSynthese.java 18 Aug 2003 11:05:19 -0000 1.2
--- FileOperationSynthese.java 22 Aug 2003 15:51:12 -0000 1.3
***************
*** 12,15 ****
--- 12,16 ----
import org.fudaa.dodico.commun.DodicoAnalyze;
+ import org.fudaa.dodico.fortran.FortranInterface;
import org.fudaa.dodico.fortran.FortranLib;
***************
*** 19,115 ****
* @version $Id$
*/
! public class FileOperationSynthese
! {
! private File[] files_;
! private File mainFile_;
private String exClose_;
! private DodicoAnalyze analyze_;
! FileOperationInterface fileOp_;
! private String desc_;
! private long opTime_;
!
!
! public void printAnalyze(){
! if(analyze_!=null) analyze_.printResume();
! else System.out.println("Pas d'erreur");
! }
!
! /**
! *
! */
! public final String getDesc()
! {
! return desc_;
! }
!
! /**
! *
! */
! public final void setDesc(String _string)
! {
! desc_= _string;
! }
!
! /**
! *
! */
! public long getOpTime()
! {
! return opTime_;
! }
!
! /**
! *
! */
! public void setOpTime(long _l)
! {
! opTime_= _l;
! }
! public void initOpTime()
! {
! opTime_= System.currentTimeMillis();
}
! public FileOperationSynthese()
! {
! }
!
! public void setRessource(File[] _f)
! {
! files_=_f;
}
! public static void initAndClose(
! FileOperationSynthese _opResults,
! DodicoAnalyze.Editor _analyze,
! FileOperationInterface _op,
! String _desc)
! {
! _opResults.setAnalyze(_analyze.toAnalyze());
! _opResults.setFileOp(_op);
! _opResults.setOpTime(System.currentTimeMillis());
! _opResults.setDesc(_desc);
! _opResults.setExClose(FortranLib.closeState(_op));
}
! public DodicoAnalyze getAnalyze()
! {
return analyze_;
}
! public String getClosingException()
! {
return exClose_;
}
! public boolean containsFatalError()
! {
return ((analyze_ != null) && (analyze_.containsFatalError()));
}
! public boolean containsClosingError()
! {
return exClose_ != null;
}
--- 20,61 ----
* @version $Id$
*/
! public class FileOperationSynthese {
private String exClose_;
! private DodicoAnalyze.Editor analyze_;
! FortranInterface fileOp_;
! private Object source_;
! public void printAnalyze() {
! if (analyze_ != null)
! analyze_.toAnalyze().printResume();
! else
! System.out.println("Pas d'erreur");
}
! public Object getSource() {
! return source_;
}
! // public void initOpTime()
! // {
! // opTime_= System.currentTimeMillis();
! // }
+ public FileOperationSynthese() {
}
! public DodicoAnalyze.Editor getAnalyze() {
return analyze_;
}
! public String getClosingException() {
return exClose_;
}
! public boolean containsFatalError() {
return ((analyze_ != null) && (analyze_.containsFatalError()));
}
! public boolean containsClosingError() {
return exClose_ != null;
}
***************
*** 118,140 ****
*
*/
! public boolean containsMessages()
! {
! return analyze_ != null;
! }
!
! /**
! *
! */
! public String getExClose()
! {
! return exClose_;
! }
!
! /**
! *
! */
! public File getFile()
! {
! return mainFile_;
}
--- 64,69 ----
*
*/
! public boolean containsMessages() {
! return (analyze_ != null) && (!analyze_.isEmpty());
}
***************
*** 142,163 ****
*
*/
! public FileOperationInterface getFileOp()
! {
return fileOp_;
}
- /**
- *
- */
- public void setAnalyze(DodicoAnalyze _analyze)
- {
- analyze_= _analyze;
- }
/**
*
*/
! public void setExClose(String _exception)
! {
exClose_= _exception;
}
--- 71,83 ----
*
*/
! public FortranInterface getFileOp() {
return fileOp_;
}
/**
*
*/
! public void setClosingOperation(String _exception) {
exClose_= _exception;
}
***************
*** 166,204 ****
*
*/
! public void setFileOp(FileOperationInterface _interface)
! {
fileOp_= _interface;
}
/**
! * @return
! */
! public File[] getFiles()
! {
! return files_;
! }
!
! /**
! * @return
! */
! public File getMainFile()
! {
! return mainFile_;
! }
!
! /**
! * @param _files
*/
! public void setFiles(File[] _files)
! {
! files_= _files;
}
/**
! * @param _file
*/
! public void setMainFile(File _file)
! {
! mainFile_= _file;
}
--- 86,105 ----
*
*/
! public void setFileOp(FortranInterface _interface) {
fileOp_= _interface;
}
/**
! *
*/
! public void setSource(Object _object) {
! source_= _object;
}
/**
! *
*/
! public void setAnalyze(DodicoAnalyze.Editor _editor) {
! analyze_= _editor;
}
--- FileOperationInterface.java DELETED ---
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/h2d/telemac
Added Files:
H2dTelemacConditionLimite.java
H2dTelemacConditionLimiteMutable.java
H2dTelemacParametres.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
--- NEW FILE: H2dTelemacConditionLimite.java ---
/*
* @file H2dConditionLimiteTelemac.java
* @creation 25 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.H2dConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id: H2dTelemacConditionLimite.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dTelemacConditionLimite extends H2dConditionLimite
{
H2dClType traceurType_;
double traceur_;
H2dClType stricklerType_;
double strickler_;
double traceurCoefA_;
double traceurCoefB_;
protected H2dBordType bordType_;
/**
*
*/
public H2dTelemacConditionLimite()
{
super();
}
/**
*
*/
public H2dBordType getBordType() {
return bordType_;
}
/**
*
*/
public double getStrickler()
{
return strickler_;
}
/**
*
*/
public H2dClType getStricklerType()
{
return stricklerType_;
}
/**
*
*/
public double getTraceur()
{
return traceur_;
}
/**
*
*/
public double getTraceurCoefA()
{
return traceurCoefA_;
}
/**
*
*/
public double getTraceurCoefB()
{
return traceurCoefB_;
}
/**
*
*/
public H2dClType getTraceurType()
{
return traceurType_;
}
}
--- NEW FILE: H2dTelemacConditionLimiteMutable.java ---
/*
* @file H2dConditionLimiteTelemacMutable.java
* @creation 25 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id: H2dTelemacConditionLimiteMutable.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dTelemacConditionLimiteMutable extends H2dTelemacConditionLimite
{
/**
*
*/
public H2dTelemacConditionLimiteMutable()
{
super();
}
/**
*
*/
public void setStrickler(double _s)
{
strickler_ = _s;
}
/**
*
*/
public void setStricklerType(H2dClType _s)
{
stricklerType_ = _s;
}
/**
*
*/
public void setTraceur(double _s)
{
traceur_ = _s;
}
/**
*
*/
public void setTraceurCoefA(double _s)
{
traceurCoefA_ = _s;
}
/**
*
*/
public void setTraceurCoefB(double _s)
{
traceurCoefB_ = _s;
}
/**
*
*/
public void setTraceurType(H2dClType _s)
{
traceurType_ = _s;
}
/**
*
*/
public void setBordType(H2dBordType _s)
{
bordType_ = _s;
}
/**
*
*/
public void setH(double _s)
{
h_ = _s;
}
/**
*
*/
public void setHType(H2dClType _s)
{
hType_ = _s;
}
/**
*
*/
public void setIndexPt(int _s)
{
indexPt_ = _s;
}
/**
*
*/
public void setU(double _s)
{
u_ = _s;
}
/**
*
*/
public void setUType(H2dClType _s)
{
uType_ = _s;
}
/**
*
*/
public void setV(double _s)
{
v_ = _s;
}
/**
*
*/
public void setVType(H2dClType _s)
{
vType_ = _s;
}
}
--- NEW FILE: H2dTelemacParametres.java ---
(This appears to be a binary file; contents omitted.)
|
|
From: <de...@us...> - 2003-08-22 23:14:14
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/dunes/io
Modified Files:
DunesFileFormat.java DunesReader.java DunesWriter.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
Index: DunesFileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesFileFormat.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DunesFileFormat.java 18 Aug 2003 11:05:19 -0000 1.5
--- DunesFileFormat.java 22 Aug 2003 15:51:11 -0000 1.6
***************
*** 16,20 ****
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
--- 16,23 ----
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
! import org.fudaa.dodico.fichiers.FileWriteOperationAbstract;
! import org.fudaa.dodico.h2d.H2dFileFormatMaillageVersion;
! import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
***************
*** 53,57 ****
}
! public class DunesVersion extends FileFormatVersion {
/**
--- 56,60 ----
}
! public class DunesVersion extends FileFormatVersion implements H2dFileFormatMaillageVersion{
/**
***************
*** 91,99 ****
}
! public DunesReader createReader() {
return new DunesReader(this);
}
! public DunesWriter createWriter() {
return new DunesWriter(this);
}
--- 94,102 ----
}
! public FileReadOperationAbstract createReader() {
return new DunesReader(this);
}
! public FileWriteOperationAbstract createWriter() {
return new DunesWriter(this);
}
***************
*** 103,119 ****
DunesInterface _inter,
ProgressionInterface _prog) {
! DunesWriter w= createWriter();
! FileOperationSynthese synt= FileFormatVersion.initOperation(w, _prog, _f);
! w.write(_inter, synt);
! return synt;
}
! public DunesInterface read(
File _f,
! FileOperationSynthese _synt,
ProgressionInterface _prog) {
! DunesReader r= createReader();
! FileFormatVersion.initOperation(_synt, r, _prog, _f);
! return r.read(_synt);
}
--- 106,126 ----
DunesInterface _inter,
ProgressionInterface _prog) {
! DunesWriter w= new DunesWriter(this);
! w.setFile(_f);
! w.setProgressReceiver(_prog);
! return w.write(_inter);
}
!
! /**
! *
! */
! public FileOperationSynthese writeMaillage(
File _f,
! H2dMaillage _m,
ProgressionInterface _prog) {
! DunesAdapter inter=new DunesAdapter();
! inter.setMaillage(_m);
! return write(_f, inter, _prog);
}
Index: DunesReader.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesReader.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DunesReader.java 18 Aug 2003 11:05:19 -0000 1.6
--- DunesReader.java 22 Aug 2003 15:51:11 -0000 1.7
***************
*** 17,22 ****
--- 17,24 ----
import org.fudaa.dodico.corba.geometrie.SPoint;
import org.fudaa.dodico.fichiers.FileFormat;
+ import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOpReadCharSimpleAbstract;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
+ import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
***************
*** 30,35 ****
* @version $Id$
*/
! public class DunesReader extends FileOpReadCharSimpleAbstract
! {
DunesFileFormat.DunesVersion version_;
--- 32,36 ----
* @version $Id$
*/
! public class DunesReader extends FileOpReadCharSimpleAbstract {
DunesFileFormat.DunesVersion version_;
***************
*** 38,144 ****
* @param _in le flux d'entree non bufferise.
*/
! public DunesReader()
! {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesReader(DunesFileFormat.DunesVersion _f)
! {
! version_ = _f;
}
!
! public DunesInterface read(FileOperationSynthese _operationState)
! {
! DodicoAnalyze.Editor edit=new DodicoAnalyze.Editor();
! DunesInterface r=readDunes(edit);
! FileOperationSynthese.initAndClose(_operationState,edit,this,"Lecture Fichier Dunes");
! return r;
}
-
! protected DunesInterface readDunes(DodicoAnalyze.Editor _analyze)
! {
! DunesAdapter source_=null;
! H2dPoint[] points=null;
! H2dElement[] elems=null;
! double[] adaptatifs=null;
in_.setJumpBlankLine(true);
! try
! {
//lit jusqu'a la premiere ligne non vide.
//Lecture de l'identifiant NOEUD
in_.readFields();
! if ((in_.getNumberOfFields() != 1) && (!version_.getNoeudCode().equals(in_.stringField(0))))
! {
! _analyze.addError(DodicoLib.geti18n("L'identifiant") + " " + version_.getNoeudCode() + " " + DodicoLib.geti18n("est attendu"), in_);
return null;
}
-
//Lecture du nombre de noeud et format du maillage (apaptatif ou non)
//NOMBRE_DE_NOEUD TYPE_DE_MAILLAGE
in_.readFields();
//verification que l'on a bien 2 champs
! if (in_.getNumberOfFields() != 2)
! {
! _analyze.addFatalError(DodicoLib.geti18n("Nombre de noeuds non trouve"), in_);
return null;
}
//le nombre de noeud
! int nbNoeuds = in_.intField(0);
//le type de maillage.
//Si 2, des infos sur le maillage adaptatif seront presentes
! int typeMaillage = in_.intField(1);
//Si adaptatif, on initialise le tableau stockant les valeurs.
! if (typeMaillage == version_.getAdaptatifCode())
! {
! adaptatifs = new double[nbNoeuds];
//on affecte a source le tableau.
}
//Creation du tableau de point.
! points = new H2dPoint[nbNoeuds];
! // maillage.points = points;
! int pourc = 0;
! boolean afficheAvance = (progress_ == null ? false : true);
if (afficheAvance)
progress_.setProgression(pourc);
! int step = H2dLib.getStep(nbNoeuds);
! int pourcStep = (int) (50 / step);
! int pas = (int) (nbNoeuds / step);
! int pMax = pas;
int temp;
//lecture des noeuds
! for (int i = 0; i < nbNoeuds; i++)
! {
in_.readFields();
! if (in_.getNumberOfFields() != 4)
! {
! _analyze.addInfo(DodicoLib.geti18n("Format attendu") + ": NUM_POINT X Y Z", in_);
! _analyze.addError(DodicoLib.geti18n("Définition du noeud") + " " + (i + 1) + " " + DodicoLib.geti18n("non valide"), in_);
return null;
}
! temp = in_.intField(0);
! if (temp != (i + 1))
! {
! _analyze.addInfo(DodicoLib.geti18n("Le numero du point ne correspond pas au numéro réel"), in_);
}
! points[i] = new H2dPoint(in_.doubleField(1),in_.doubleField(2),in_.doubleField(3));
! if (adaptatifs != null)
! {
in_.readFields();
! if (in_.getNumberOfFields() != 1)
! {
! _analyze.addWarning(DodicoLib.geti18n("la ligne du coefficient adaptatif ne doit contenir qu'un champ"), in_);
}
! adaptatifs[i] = in_.doubleField(0);
}
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 39,152 ----
* @param _in le flux d'entree non bufferise.
*/
! public DunesReader() {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesReader(DunesFileFormat.DunesVersion _f) {
! version_= _f;
}
!
! protected Object _read() {
! return readDunes();
}
! private DunesInterface readDunes() {
! DunesAdapter source_= null;
! H2dPoint[] points= null;
! H2dElement[] elems= null;
! double[] adaptatifs= null;
in_.setJumpBlankLine(true);
! try {
//lit jusqu'a la premiere ligne non vide.
//Lecture de l'identifiant NOEUD
in_.readFields();
! if ((in_.getNumberOfFields() != 1)
! && (!version_.getNoeudCode().equals(in_.stringField(0)))) {
! analyze_.addError(
! DodicoLib.geti18n("L'identifiant")
! + " "
! + version_.getNoeudCode()
! + " "
! + DodicoLib.geti18n("est attendu"),
! in_);
return null;
}
//Lecture du nombre de noeud et format du maillage (apaptatif ou non)
//NOMBRE_DE_NOEUD TYPE_DE_MAILLAGE
in_.readFields();
//verification que l'on a bien 2 champs
! if (in_.getNumberOfFields() != 2) {
! analyze_.addFatalError(
! DodicoLib.geti18n("Nombre de noeuds non trouve"),
! in_);
return null;
}
//le nombre de noeud
! int nbNoeuds= in_.intField(0);
//le type de maillage.
//Si 2, des infos sur le maillage adaptatif seront presentes
! int typeMaillage= in_.intField(1);
//Si adaptatif, on initialise le tableau stockant les valeurs.
! if (typeMaillage == version_.getAdaptatifCode()) {
! adaptatifs= new double[nbNoeuds];
//on affecte a source le tableau.
}
//Creation du tableau de point.
! points= new H2dPoint[nbNoeuds];
! // maillage.points = points;
! int pourc= 0;
! boolean afficheAvance= (progress_ == null ? false : true);
if (afficheAvance)
progress_.setProgression(pourc);
! int step= H2dLib.getStep(nbNoeuds);
! int pourcStep= (int) (50 / step);
! int pas= (int) (nbNoeuds / step);
! int pMax= pas;
int temp;
//lecture des noeuds
! for (int i= 0; i < nbNoeuds; i++) {
in_.readFields();
! if (in_.getNumberOfFields() != 4) {
! analyze_.addInfo(
! DodicoLib.geti18n("Format attendu") + ": NUM_POINT X Y Z",
! in_);
! analyze_.addError(
! DodicoLib.geti18n("Définition du noeud")
! + " "
! + (i + 1)
! + " "
! + DodicoLib.geti18n("non valide"),
! in_);
return null;
}
! temp= in_.intField(0);
! if (temp != (i + 1)) {
! analyze_.addInfo(
! DodicoLib.geti18n(
! "Le numero du point ne correspond pas au numéro réel"),
! in_);
}
! points[i]=
! new H2dPoint(
! in_.doubleField(1),
! in_.doubleField(2),
! in_.doubleField(3));
! if (adaptatifs != null) {
in_.readFields();
! if (in_.getNumberOfFields() != 1) {
! analyze_.addWarning(
! DodicoLib.geti18n(
! "la ligne du coefficient adaptatif ne doit contenir qu'un champ"),
! in_);
}
! adaptatifs[i]= in_.doubleField(0);
}
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 149,155 ****
//Lecture du mot cle ELEMENT
in_.readFields();
! if ((in_.getNumberOfFields() != 1) && (!version_.getElementCode().equals(in_.stringField(0))))
! {
! _analyze.addError(DodicoLib.geti18n("L'identifiant") + " " + version_.getElementCode() + " " + DodicoLib.geti18n("est attendu"), in_);
return null;
}
--- 157,169 ----
//Lecture du mot cle ELEMENT
in_.readFields();
! if ((in_.getNumberOfFields() != 1)
! && (!version_.getElementCode().equals(in_.stringField(0)))) {
! analyze_.addError(
! DodicoLib.geti18n("L'identifiant")
! + " "
! + version_.getElementCode()
! + " "
! + DodicoLib.geti18n("est attendu"),
! in_);
return null;
}
***************
*** 158,215 ****
in_.readFields();
//Un seul champ attendu
! if (in_.getNumberOfFields() != 1)
! {
! _analyze.addFatalError(DodicoLib.geti18n("Cette ligne ne doit contenir que le nombre d'elements"), in_);
return null;
}
! int nbElem = in_.intField(0);
! elems = new H2dElement[nbElem];
//Les donnees utiles pour l'etat d'avancement
! step = H2dLib.getStep(nbElem);
! pas = (int) (nbElem / step);
! pMax = pas;
! pourcStep = (int) (50 / step);
int[] index;
! for (int i = 0; i < nbElem; i++)
! {
in_.readFields();
! if (in_.getNumberOfFields() < 2)
! {
! _analyze.addInfo(DodicoLib.geti18n("Format attendu") + "NUM_ELEMENT NB_POINT P[1] ...P[NB_POINT]", in_);
! _analyze.addError(DodicoLib.geti18n("Définition de l'element") + " " + (i + 1) + " " + DodicoLib.geti18n("non valide"), in_);
return null;
}
//le numero d'element
! temp = in_.intField(0);
! if (temp != (i + 1))
! {
! _analyze.addInfo(DodicoLib.geti18n("Le numero de l'element ne correspond pas au numéro réel"), in_);
}
! temp = in_.intField(1);
! if (temp <= 0)
! {
! _analyze.addError(DodicoLib.geti18n("Nombre de points négatifs ou nul pour l'élément") + " " + (i + 1), in_);
return null;
}
! if (in_.getNumberOfFields() != (temp + 2))
! {
! _analyze.addInfo(
! DodicoLib.geti18n("Nombre indiqué") + ": " + temp + "." + DodicoLib.geti18n("Nombre lu") + ": " + (in_.getNumberOfFields() - 2),
in_);
- _analyze.addFatalError(DodicoLib.geti18n("Le nombre d'éléments ne correspond pas"), in_);
return null;
}
index= new int[temp];
! for (int j = 0; j < temp; j++)
! {
//on stocke les indexs en commencant a 0.
! index[j] = in_.intField(2 + j) - 1;
}
! elems[i]=new H2dElement(index);
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 172,248 ----
in_.readFields();
//Un seul champ attendu
! if (in_.getNumberOfFields() != 1) {
! analyze_.addFatalError(
! DodicoLib.geti18n(
! "Cette ligne ne doit contenir que le nombre d'elements"),
! in_);
return null;
}
! int nbElem= in_.intField(0);
! elems= new H2dElement[nbElem];
//Les donnees utiles pour l'etat d'avancement
! step= H2dLib.getStep(nbElem);
! pas= (int) (nbElem / step);
! pMax= pas;
! pourcStep= (int) (50 / step);
int[] index;
! for (int i= 0; i < nbElem; i++) {
in_.readFields();
! if (in_.getNumberOfFields() < 2) {
! analyze_.addInfo(
! DodicoLib.geti18n("Format attendu")
! + "NUM_ELEMENT NB_POINT P[1] ...P[NB_POINT]",
! in_);
! analyze_.addError(
! DodicoLib.geti18n("Définition de l'element")
! + " "
! + (i + 1)
! + " "
! + DodicoLib.geti18n("non valide"),
! in_);
return null;
}
//le numero d'element
! temp= in_.intField(0);
! if (temp != (i + 1)) {
! analyze_.addInfo(
! DodicoLib.geti18n(
! "Le numero de l'element ne correspond pas au numéro réel"),
! in_);
}
! temp= in_.intField(1);
! if (temp <= 0) {
! analyze_.addError(
! DodicoLib.geti18n(
! "Nombre de points négatifs ou nul pour l'élément")
! + " "
! + (i + 1),
! in_);
return null;
}
! if (in_.getNumberOfFields() != (temp + 2)) {
! analyze_.addInfo(
! DodicoLib.geti18n("Nombre indiqué")
! + ": "
! + temp
! + "."
! + DodicoLib.geti18n("Nombre lu")
! + ": "
! + (in_.getNumberOfFields() - 2),
! in_);
! analyze_.addFatalError(
! DodicoLib.geti18n("Le nombre d'éléments ne correspond pas"),
in_);
return null;
}
index= new int[temp];
! for (int j= 0; j < temp; j++) {
//on stocke les indexs en commencant a 0.
! index[j]= in_.intField(2 + j) - 1;
}
! elems[i]= new H2dElement(index);
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 219,248 ****
}
in_.readFields();
! if (!"0 0 0 0".equals(in_.getLine().trim()))
! {
if (in_.getLine().trim() != "")
! _analyze.addWarning("Cette ligne et les suivantes sont ignorées", in_);
}
in_.readFields();
if (in_.getLine().trim() != "")
! _analyze.addWarning("Cette ligne et les suivantes sont ignorées", in_);
!
! }
! catch (EOFException e)
! {
if (DodicoLib.DEBUG)
System.out.println("Lecture terminée");
! }
! catch (NumberFormatException fe)
! {
! DodicoAnalyze.manageException(fe, _analyze, in_);
! }
! catch (IOException _e)
! {
! DodicoAnalyze.manageException(_e, _analyze);
}
//Le mot clef noeud est trouve, on peut creer le maillage.
! H2dMaillage maillage = new H2dMaillage(points,elems);
! source_ = new DunesAdapter();
source_.setMaillage(maillage);
source_.setAdaptatif(adaptatifs);
--- 252,276 ----
}
in_.readFields();
! if (!"0 0 0 0".equals(in_.getLine().trim())) {
if (in_.getLine().trim() != "")
! analyze_.addWarning(
! "Cette ligne et les suivantes sont ignorées",
! in_);
}
in_.readFields();
if (in_.getLine().trim() != "")
! analyze_.addWarning("Cette ligne et les suivantes sont ignorées", in_);
!
! } catch (EOFException e) {
if (DodicoLib.DEBUG)
System.out.println("Lecture terminée");
! } catch (NumberFormatException fe) {
! DodicoAnalyze.manageException(fe, analyze_, in_);
! } catch (IOException _e) {
! DodicoAnalyze.manageException(_e, analyze_);
}
//Le mot clef noeud est trouve, on peut creer le maillage.
! H2dMaillage maillage= new H2dMaillage(points, elems);
! source_= new DunesAdapter();
source_.setMaillage(maillage);
source_.setAdaptatif(adaptatifs);
***************
*** 251,267 ****
}
-
/**
* @return
*/
! public FileFormat getFileFormat()
! {
return getDunesFileFormat();
}
!
! public DunesFileFormat getDunesFileFormat()
! {
! return (DunesFileFormat)version_.getFileFormat();
! }
}
--- 279,299 ----
}
/**
* @return
*/
! public FileFormat getFileFormat() {
return getDunesFileFormat();
}
!
! public DunesFileFormat getDunesFileFormat() {
! return (DunesFileFormat)version_.getFileFormat();
! }
!
! /**
! *
! */
! public FileFormatVersion getVersion() {
! return version_;
! }
}
Index: DunesWriter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesWriter.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DunesWriter.java 18 Aug 2003 11:05:19 -0000 1.6
--- DunesWriter.java 22 Aug 2003 15:51:11 -0000 1.7
***************
*** 16,21 ****
--- 16,23 ----
import org.fudaa.dodico.corba.geometrie.SPoint;
import org.fudaa.dodico.fichiers.FileFormat;
+ import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOpWriterCharSimpleAbstract;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
+ import org.fudaa.dodico.fortran.FortranInterface;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
***************
*** 28,62 ****
* @version $Id$
*/
! public class DunesWriter extends FileOpWriterCharSimpleAbstract
! {
DunesFileFormat.DunesVersion version_;
! public DunesWriter()
! {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesWriter(DunesFileFormat.DunesVersion _f)
! {
version_= _f;
}
! public FileFormat getFileFormat()
! {
return version_.getFileFormat();
}
- public void write(DunesInterface _d, FileOperationSynthese _op)
- {
- DodicoAnalyze.Editor edit= new DodicoAnalyze.Editor();
- writeDunes(_d, edit);
- FileOperationSynthese.initAndClose(
- _op,
- edit,
- this,
- "Ecriture Fichier Dunes");
- }
-
/**
* Ecrire les donnees de l'interface <code>DunesInterface</code>
--- 30,49 ----
* @version $Id$
*/
! public class DunesWriter extends FileOpWriterCharSimpleAbstract {
DunesFileFormat.DunesVersion version_;
! public DunesWriter() {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesWriter(DunesFileFormat.DunesVersion _f) {
version_= _f;
}
! public FileFormat getFileFormat() {
return version_.getFileFormat();
}
/**
* Ecrire les donnees de l'interface <code>DunesInterface</code>
***************
*** 65,92 ****
* La méthode se termine par un flush mais ne ferme pas le flux.
*/
! protected void writeDunes(DunesInterface _d, DodicoAnalyze.Editor analyze_)
! {
DunesInterface dunes_= _d;
//Test sur les objets a ecrire
! if (dunes_ == null)
! {
analyze_.addFatalError(
DodicoLib.geti18n("La structure à écrire est nulle !"));
return;
}
! if (out_ == null)
! {
analyze_.addFatalError("Le flux de sortie est nul !");
return;
}
H2dMaillage maillage= dunes_.getMaillage();
! if (maillage == null)
! {
analyze_.addFatalError("Le maillage est nul !");
return;
}
int nPts= maillage.getPtsNb();
! if (nPts == 0)
! {
analyze_.addFatalError(
DodicoLib.geti18n("Le maillage ne contient pas de points !"));
--- 52,74 ----
* La méthode se termine par un flush mais ne ferme pas le flux.
*/
! protected void writeDunes(DunesInterface _d) {
DunesInterface dunes_= _d;
//Test sur les objets a ecrire
! if (dunes_ == null) {
analyze_.addFatalError(
DodicoLib.geti18n("La structure à écrire est nulle !"));
return;
}
! if (out_ == null) {
analyze_.addFatalError("Le flux de sortie est nul !");
return;
}
H2dMaillage maillage= dunes_.getMaillage();
! if (maillage == null) {
analyze_.addFatalError("Le maillage est nul !");
return;
}
int nPts= maillage.getPtsNb();
! if (nPts == 0) {
analyze_.addFatalError(
DodicoLib.geti18n("Le maillage ne contient pas de points !"));
***************
*** 94,105 ****
}
//H2dElement[] elems= maillage.getElts();
! // if (elems == null)
! // {
! // analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
! // return;
! // }
int nElems= maillage.getEltNb();
! if (nElems == 0)
! {
analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
return;
--- 76,86 ----
}
//H2dElement[] elems= maillage.getElts();
! // if (elems == null)
! // {
! // analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
! // return;
! // }
int nElems= maillage.getEltNb();
! if (nElems == 0) {
analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
return;
***************
*** 113,124 ****
boolean printAdaptatifV= false;
double[] adValeur= dunes_.getAdaptatifValeur();
! if (adValeur != null)
! {
b.append(' ');
b.append(version_.getAdaptatifCode());
printAdaptatifV= true;
! }
! else
! {
b.append(version_.getNonAdaptatifCode());
}
--- 94,102 ----
boolean printAdaptatifV= false;
double[] adValeur= dunes_.getAdaptatifValeur();
! if (adValeur != null) {
b.append(' ');
b.append(version_.getAdaptatifCode());
printAdaptatifV= true;
! } else {
b.append(version_.getNonAdaptatifCode());
}
***************
*** 128,133 ****
int pourc= 0;
boolean afficheAvance= (progress_ == null ? false : true);
! if (afficheAvance)
progress_.setProgression(pourc);
int step= H2dLib.getStep(nPts);
int pas= (int) (nPts / step);
--- 106,114 ----
int pourc= 0;
boolean afficheAvance= (progress_ == null ? false : true);
! if (afficheAvance) {
progress_.setProgression(pourc);
+ progress_.setDesc(DodicoLib.geti18n("Ecriture fichier dunes"));
+ }
+
int step= H2dLib.getStep(nPts);
int pas= (int) (nPts / step);
***************
*** 135,142 ****
int pourcStep= (int) (50 / step);
H2dPoint pt;
! try
! {
! for (int i= 0; i < nPts; i++)
! {
pt= maillage.getPt(i);
b.append((i + 1));
--- 116,121 ----
int pourcStep= (int) (50 / step);
H2dPoint pt;
! try {
! for (int i= 0; i < nPts; i++) {
pt= maillage.getPt(i);
b.append((i + 1));
***************
*** 148,161 ****
b.append(pt.getZ());
b.append(lineSep_);
! if (printAdaptatifV)
! {
b.append(adValeur[i]);
b.append(lineSep_);
}
DodicoLib.writeTo(out_, b);
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 127,137 ----
b.append(pt.getZ());
b.append(lineSep_);
! if (printAdaptatifV) {
b.append(adValeur[i]);
b.append(lineSep_);
}
DodicoLib.writeTo(out_, b);
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 182,187 ****
int nppel;
int[] index;
! for (int i= 0; i < nElems; i++)
! {
ppel= maillage.getElement(i);
nppel= ppel.getPtNb();
--- 158,162 ----
int nppel;
int[] index;
! for (int i= 0; i < nElems; i++) {
ppel= maillage.getElement(i);
nppel= ppel.getPtNb();
***************
*** 192,198 ****
b.append(nppel);
//les indices des points pour l'element i
! index=ppel.getPtIndex();
! for (int j= 0; j < nppel; j++)
! {
b.append(' ');
//Les indices sont stockés a partir de 0.
--- 167,172 ----
b.append(nppel);
//les indices des points pour l'element i
! index= ppel.getPtIndex();
! for (int j= 0; j < nppel; j++) {
b.append(' ');
//Les indices sont stockés a partir de 0.
***************
*** 201,208 ****
writeln(b);
//mis a jour de l'etat d'avancement au cas ou.
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 175,180 ----
writeln(b);
//mis a jour de l'etat d'avancement au cas ou.
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 213,222 ****
DodicoLib.writeTo(out_, b);
out_.flush();
! }
! catch (IOException _ex)
! {
DodicoAnalyze.manageException(_ex, analyze_);
}
return;
}
}
--- 185,219 ----
DodicoLib.writeTo(out_, b);
out_.flush();
! } catch (IOException _ex) {
DodicoAnalyze.manageException(_ex, analyze_);
}
return;
}
+
+ /**
+ *
+ */
+ protected void _write(Object _o) {
+ if (_o instanceof DunesInterface) {
+ writeDunes((DunesInterface)_o);
+ } else {
+ analyze_.addFatalError(DodicoLib.geti18n("Données invalide"));
+ }
+ }
+
+ /**
+ *
+ */
+ public final FileOperationSynthese write(DunesInterface _o) {
+ writeDunes(_o);
+ return closeOperation(_o);
+ }
+
+ /**
+ *
+ */
+ public FileFormatVersion getVersion() {
+ return version_;
+ }
+
}
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/h2d
Modified Files:
H2dBord.java H2dBordMutable.java H2dConditionLimite.java
H2dElement.java H2dMaillage.java H2dMaillageMutable.java
H2dParametres.java
Added Files:
H2dFileFormatMaillageVersion.java H2dMaillageFrontiere.java
Removed Files:
H2dConditionLimiteReflux.java
H2dConditionLimiteRefluxMutable.java
H2dConditionLimiteTelemac.java
H2dConditionLimiteTelemacMutable.java
H2dParametresCalculReflux.java H2dParametresReflux.java
H2dRefluxDicoModel.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
--- NEW FILE: H2dFileFormatMaillageVersion.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: H2dMaillageFrontiere.java ---
/*
* @file H2dMaillageBord.java
* @creation 30 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import gnu.trove.TIntArrayList;
import java.util.Arrays;
import java.util.List;
import org.fudaa.dodico.commun.DodicoLib;
/**
* @author deniger
* @version $Id: H2dMaillageFrontiere.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dMaillageFrontiere {
protected int[][] bords_;
/**
*
*/
public H2dMaillageFrontiere(List _l) {
int n= _l.size();
if (n > 0) {
bords_= new int[n][];
_l.toArray(bords_);
} else
bords_= new int[0][];
}
public int[] getPlacement(int _ptIdx){
for(int i=0;i<bords_.length;i++){
int n=bords_[i].length;
for(int j=0;j<n;j++){
if(bords_[i][j]==_ptIdx) return new int[]{i,j};
}
}
return null;
}
/**
* Permet de verifier si les indices de bords
* sont dans le meme ordre que celui donne
* par _ipobo.
*/
public boolean isSame(int[] _ipobo) {
if (_ipobo == null)
return false;
int nBI= bords_.length;
int indexIpobo= 0;
int nbFI;
for (int i= 0; i < nBI; i++) {
nbFI= bords_[i].length;
for (int j= 0; j < nbFI; j++) {
if (_ipobo[indexIpobo + j] != bords_[i][j]) {
System.out.println("echec interne");
return false;
}
}
indexIpobo += nbFI;
}
return true;
}
/**
* Renvoie les bords sous forme d'un tableau ( conforme tableau ipobo
* de telemac/serafin).
*/
public int[] getArray() {
TIntArrayList list= new TIntArrayList();
int nb= bords_.length;
list.ensureCapacity(bords_[0].length + (nb - 1) * (bords_[0].length / 2));
for (int i= 0; i < nb; i++) {
list.add(bords_[i]);
}
return list.toNativeArray();
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord principal
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordPrinc() {
return DodicoLib._printObject(bords_[0], true);
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord interne d'indice _id
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordInterne(int _id) {
return DodicoLib._printObject(bords_[_id + 1], true);
}
public String toString() {
return "H2dMaillageBord bordExt["
+ bords_[0].length
+ "] bord interne ["
+ getBordInternNb()
+ "]";
}
public H2dPoint[] getMinMax(H2dMaillage _mail, int _bordIdx) {
int[] bordIdx= bords_[_bordIdx ];
int i0= bordIdx[0];
H2dPoint pt= _mail.pts_[i0];
H2dPointMutable pMin= new H2dPointMutable(pt);
H2dPointMutable pMax= new H2dPointMutable(pt);
int nb= bordIdx.length - 1;
for (int i= nb; i >= 1; i--) {
pt= _mail.pts_[bordIdx[i]];
if (pt.x_ < pMin.x_)
pMin.x_= pt.x_;
if (pt.y_ < pMin.y_)
pMin.y_= pt.y_;
if (pt.z_ < pMin.z_)
pMin.z_= pt.z_;
if (pt.x_ > pMax.x_)
pMax.x_= pt.x_;
if (pt.y_ > pMax.y_)
pMax.y_= pt.y_;
if (pt.z_ > pMax.z_)
pMax.z_= pt.z_;
}
return new H2dPoint[] { pMin, pMax };
}
public int getBordInternNb() {
return bords_.length - 1;
}
// public int[] getBord(int _i)
// {
// return _i==0?bordPrinc_:bordInter_[_i-1];
// }
//
// public int[] getBordPrinc()
// {
// return bordPrinc_;
// }
public int getBordNb() {
return bords_.length;
}
public int getBordPrincPointIdx(int _idx) {
return bords_[0][_idx];
}
public int getPtIdxForBord(int _bordIdx, int _ptIdx) {
return bords_[_bordIdx][_ptIdx];
}
// public int[] getBordIntern(int _i)
// {
// return bordInter_[_i];
// }
// public int getBordInternIdx(int _indexBordInterne, int _indexPoint) {
// return bordInter_[_indexBordInterne][_indexPoint];
// }
public int getPtNbForBord(int _bordIdx) {
return bords_[_bordIdx].length;
}
}
Index: H2dBord.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBord.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dBord.java 18 Aug 2003 11:05:19 -0000 1.2
--- H2dBord.java 22 Aug 2003 15:51:12 -0000 1.3
***************
*** 12,57 ****
/**
- * TODO : Les bords contiennent des conditions limites !
* @author deniger
* @version $Id$
*/
! public class H2dBord
! {
!
H2dBordType type_;
! int[] elems_;
/**
*
*/
! public H2dBord(int[] _elem)
! {
! elems_=_elem;
! }
/**
*
*/
! public H2dBordType getType()
! {
return type_;
}
!
! public int getPtsNb()
! {
! return elems_.length;
}
!
/**
! * Renvoie les indices des points concernés ATTENTION: ne pas modifier ce tableau directement.
*/
! public int[] getPtsIndex()
! {
! return elems_;
}
!
! public int getPtIndice(int _offset)
! {
! return elems_[_offset];
}
--- 12,72 ----
/**
* @author deniger
* @version $Id$
*/
! public class H2dBord {
!
H2dBordType type_;
! int idxDeb_;
! int idxFin_;
!
! /**
! * La frontiere concerne par ce bord (0 =frontiere externe)
! */
! int IdxmaillageFrontiere_;
/**
*
*/
! public H2dBord() {}
/**
*
*/
! public H2dBordType getType() {
return type_;
}
!
! public String toString() {
! return "H2DBord frontiere n°"
! + IdxmaillageFrontiere_
! + " ["
! + idxDeb_
! + ","
! + idxFin_
! + "] type "
! + type_;
}
!
/**
! *
*/
! public int getIdxDeb() {
! return idxDeb_;
}
!
! /**
! * Bord unique si l'index de debut=index de fin.
! */
! public boolean isUnique() {
! return idxDeb_ == idxFin_;
! }
!
! public boolean containsIdx(int _idx) {
! return idxDeb_ == idxFin_
! ? true
! : ((idxDeb_ < idxFin_)
! ? ((_idx >= idxDeb_) && (_idx <= idxFin_))
! : ((_idx >= 0) && (_idx <= idxFin_) && (_idx >= idxDeb_)));
}
***************
*** 59,65 ****
*
*/
! protected void setType(H2dBordType _type)
! {
! type_ = _type;
}
--- 74,86 ----
*
*/
! public int getIdxFin() {
! return idxFin_;
! }
!
! /**
! * Renvoie l'index de la frontiere concernee par ce bord.
! */
! public int getIdxFrontiere() {
! return IdxmaillageFrontiere_;
}
Index: H2dBordMutable.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBordMutable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dBordMutable.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dBordMutable.java 22 Aug 2003 15:51:12 -0000 1.2
***************
*** 1,5 ****
/*
* @file H2dBordMutable.java
! * @creation 27 juin 2003
* @modification $Date$
* @license GNU General Public License 2
--- 1,5 ----
/*
* @file H2dBordMutable.java
! * @creation 20 août 2003
* @modification $Date$
* @license GNU General Public License 2
***************
*** 15,27 ****
* @version $Id$
*/
! public class H2dBordMutable extends H2dBord
! {
/**
*
*/
! public H2dBordMutable(int[] _elems)
! {
! super(_elems);
}
--- 15,32 ----
* @version $Id$
*/
! public class H2dBordMutable extends H2dBord{
/**
*
*/
! public H2dBordMutable() {
! super();
! }
!
! /**
! *
! */
! public void setIdxDeb(int _i) {
! idxDeb_= _i;
}
***************
*** 29,36 ****
*
*/
public void setType(H2dBordType _type)
{
! super.setType(_type);
}
}
--- 34,55 ----
*
*/
+ public void setIdxFin(int _i) {
+ idxFin_= _i;
+ }
+
+ /**
+ *
+ */
+ public void setIdxmaillageFrontiere(int _i) {
+ IdxmaillageFrontiere_= _i;
+ }
+ /**
+ *
+ */
public void setType(H2dBordType _type)
{
! type_ = _type;
}
+
}
Index: H2dConditionLimite.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dConditionLimite.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dConditionLimite.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dConditionLimite.java 22 Aug 2003 15:51:12 -0000 1.2
***************
*** 9,12 ****
--- 9,14 ----
package org.fudaa.dodico.h2d;
+ import java.util.Comparator;
+
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
***************
*** 16,52 ****
* @version $Id$
*/
! public class H2dConditionLimite
! {
!
! H2dBordType bordType_;
! H2dClType uType_;
! H2dClType vType_;
! H2dClType hType_;
! double u_,v_,h_;
!
! int indexPt_;
!
/**
*
*/
! public H2dConditionLimite()
! {
super();
}
- /**
- *
- */
- public H2dBordType getBordType()
- {
- return bordType_;
}
/**
*
*/
! public double getH()
! {
return h_;
}
--- 18,63 ----
* @version $Id$
*/
! public class H2dConditionLimite {
!
!
! protected H2dClType uType_;
! protected H2dClType vType_;
! protected H2dClType hType_;
! protected double u_, v_, h_;
!
! protected int indexPt_;
/**
*
*/
! public H2dConditionLimite() {
super();
}
+
+ public static H2dConditionLimite getCLFast(int _ptIdx,H2dConditionLimite[] _l) {
+ int lowIndex= 0;
+ int highIndex= _l.length- 1;
+ int temp, tempMid;
+
+ while (lowIndex <= highIndex) {
+ tempMid= (lowIndex + highIndex) >> 1;
+ temp= _l[tempMid].getIndexPt() - _ptIdx;
+ if (temp < 0)
+ lowIndex= tempMid + 1;
+ else if (temp > 0)
+ highIndex= tempMid - 1;
+ else
+ return _l[tempMid];
+ }
+ return null;
}
+
+
/**
*
*/
! public double getH() {
return h_;
}
***************
*** 55,60 ****
*
*/
! public H2dClType getHType()
! {
return hType_;
}
--- 66,70 ----
*
*/
! public H2dClType getHType() {
return hType_;
}
***************
*** 63,68 ****
*
*/
! public int getIndexPt()
! {
return indexPt_;
}
--- 73,78 ----
*
*/
! public final int getIndexPt() {
! //System.out.println(indexPt_);
return indexPt_;
}
***************
*** 71,76 ****
*
*/
! public double getU()
! {
return u_;
}
--- 81,85 ----
*
*/
! public double getU() {
return u_;
}
***************
*** 79,84 ****
*
*/
! public H2dClType getUType()
! {
return uType_;
}
--- 88,92 ----
*
*/
! public H2dClType getUType() {
return uType_;
}
***************
*** 87,92 ****
*
*/
! public double getV()
! {
return v_;
}
--- 95,99 ----
*
*/
! public double getV() {
return v_;
}
***************
*** 95,101 ****
*
*/
! public H2dClType getVType()
! {
return vType_;
}
--- 102,120 ----
*
*/
! public H2dClType getVType() {
return vType_;
+ }
+
+ public static class ComparatorIdxPt implements Comparator {
+
+ public int compare(Object o1, Object o2) {
+ if (!(o1 instanceof H2dConditionLimite))
+ throw new IllegalArgumentException("o1 doit etre de type H2dConditionLimite");
+ if (!(o2 instanceof H2dConditionLimite))
+ throw new IllegalArgumentException("o2 doit etre de type H2dConditionLimite");
+ return ((H2dConditionLimite)o1).indexPt_
+ - ((H2dConditionLimite)o2).indexPt_;
+ }
+
}
Index: H2dElement.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dElement.java 18 Aug 2003 11:05:19 -0000 1.2
--- H2dElement.java 22 Aug 2003 15:51:12 -0000 1.3
***************
*** 16,19 ****
--- 16,20 ----
import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.h2d.type.H2dElementType;
/**
***************
*** 23,36 ****
*/
public class H2dElement {
- public static final int UNKNOWN= 0;
- public static final int T3= 1;
- public static final int T6= 3;
- public static final int Q4= 4;
- public static final int Q8= 5;
- /**
- * Element de type mixte
- */
- public static final int MIXTE= 10;
int[] ptIndex_;
--- 24,28 ----
***************
*** 48,54 ****
}
! public int getDefaultType() {
return getDefaultType(ptIndex_.length);
}
/**
--- 40,54 ----
}
! public H2dElementType getDefaultType() {
return getDefaultType(ptIndex_.length);
}
+
+ public static H2dElement ShiftLeftElementIndex(H2dElement _el){
+ int[] elIdx=_el.ptIndex_;
+ int[] n=new int[elIdx.length];
+ System.arraycopy(elIdx, 1, n, 0, elIdx.length-1);
+ n[elIdx.length-1]=elIdx[0];
+ return new H2dElement(n);
+ }
/**
***************
*** 432,436 ****
}
! public static int getCommunType(H2dElement[] _elts) {
int n= _elts.length - 2;
H2dElement element;
--- 432,436 ----
}
! public static H2dElementType getCommunType(H2dElement[] _elts) {
int n= _elts.length - 2;
H2dElement element;
***************
*** 439,443 ****
element= _elts[i];
if (element.getPtNb() != r) {
! return MIXTE;
}
}
--- 439,443 ----
element= _elts[i];
if (element.getPtNb() != r) {
! return null;
}
}
***************
*** 476,491 ****
}
! public static int getDefaultType(int _nbPoint) {
! switch (_nbPoint) {
! case 3 :
! return T3;
! case 4 :
! return Q4;
! case 6 :
! return T6;
! case 8 :
! return Q8;
! }
! return UNKNOWN;
}
--- 476,481 ----
}
! public static H2dElementType getDefaultType(int _nbPoint) {
! return H2dElementType.getCommunType(_nbPoint);
}
Index: H2dMaillage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillage.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dMaillage.java 18 Aug 2003 11:05:19 -0000 1.3
--- H2dMaillage.java 22 Aug 2003 15:51:12 -0000 1.4
***************
*** 20,23 ****
--- 20,24 ----
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionInterface;
+ import org.fudaa.dodico.h2d.type.H2dElementType;
/**
***************
*** 30,37 ****
public class H2dMaillage {
! int typeElt_;
H2dPoint[] pts_;
H2dElement[] elts_;
! H2dMaillageBord ptsFrontiere_;
H2dPoint ptMin_;
--- 31,38 ----
public class H2dMaillage {
! H2dElementType typeElt_;
H2dPoint[] pts_;
H2dElement[] elts_;
! H2dMaillageFrontiere ptsFrontiere_;
H2dPoint ptMin_;
***************
*** 78,88 ****
*/
public H2dMaillage(H2dPoint[] _pts, H2dElement[] _elts) {
- typeElt_= -1;
pts_= _pts;
elts_= _elts;
}
! public int getEltType() {
! if (typeElt_ < 0) {
typeElt_= H2dElement.getCommunType(elts_);
}
--- 79,88 ----
*/
public H2dMaillage(H2dPoint[] _pts, H2dElement[] _elts) {
pts_= _pts;
elts_= _elts;
}
! public H2dElementType getEltType() {
! if (typeElt_ ==null) {
typeElt_= H2dElement.getCommunType(elts_);
}
***************
*** 132,136 ****
*
*/
! public H2dMaillageBord getPtsFrontiere() {
return ptsFrontiere_;
}
--- 132,136 ----
*
*/
! public H2dMaillageFrontiere getPtsFrontiere() {
return ptsFrontiere_;
}
***************
*** 298,431 ****
*/
public void computeBord(ProgressionInterface _inter) {
- //les pts frontieres existent, on sort.
- if (ptsFrontiere_ != null)
- return;
-
- int n= elts_.length;
- //maj avancement
- if (_inter != null) {
- _inter.setProgression(0);
- _inter.setDesc("Recherche des aretes de contours");
- }
- //listIndex stocke les indices des aretes unique tel que
- //listIndex(2n) point 1 arete
- //listIndex(2n+1) point 2 arete
- TIntArrayList listIndex= new TIntArrayList(n);
-
- //on parcourt les elements pour remplir listIndex
- for (int i= n - 1; i >= 0; i--) {
- elts_[i].addSingleSegment(this, listIndex, i);
- }
-
- //on recupere le point so du maillage ( compris forcement dans les index
- //de bords)
- int debIndex= getSOPointIndex(listIndex);
-
- //variable temporaire
- int indexTemp;
-
- //a1 indice p1 de l'arete
- //a2 indice p2 de l'arete
- int a1, a2;
-
- //bord : la liste des bord. On parit pour 20 bord max...
- ArrayList bord= new ArrayList(20);
-
- //vecteur tempo stockant les indices du bord en cours.
- TIntArrayList l= new TIntArrayList(n * 6);
- // on part du point SO. on l'ajoute..
- a1= debIndex;
- l.add(a1);
-
- //maj avancement
- if (_inter != null) {
- _inter.setProgression(50);
- _inter.setDesc("Tri des aretes de contours");
- }
-
- //on parcourt toutes les aretes uniques et on recupere les aretes chaines
- while (listIndex.size() > 0) {
- //un index du point a1 : pour recuperer le point a2.
- indexTemp= listIndex.indexOf(a1);
- //pas d'index prob !!!
- if (indexTemp < 0)
- System.out.println("probleme " + a1);
-
- //on recupere a2 et on enleve les entrees dans listIndex
- if (indexTemp % 2 == 0) {
- a2= listIndex.get(indexTemp + 1);
- listIndex.remove(indexTemp + 1);
- listIndex.remove(indexTemp);
- } else {
- a2= listIndex.get(indexTemp - 1);
- listIndex.remove(indexTemp);
- listIndex.remove(indexTemp - 1);
-
- }
- //si a2 ne correspond pas a l'indice de debut, on continue le tour
- //du bord. Sinon, on ajoute le bord et on recommence (s'il y a encore des
- //points) par le point SO.
- if (a2 != debIndex) {
- l.add(a2);
- a1= a2;
- } else {
- bord.add(l.toNativeArray());
- l.clear();
- if (listIndex.size() != 0) {
- //on reinitialise les valeurs necessaires.
- debIndex= getSOPointIndex(listIndex);
- a1= debIndex;
- l.add(a1);
- }
- }
- }
- //petite verif inutile....
- if (l.size() != 0)
- System.out.println("prob des points restent dans l");
-
- if (_inter != null) {
- _inter.setProgression(90);
- _inter.setDesc("Orientation des bords");
- }
- n= bord.size();
- int[] a1a2, element;
- int finIndex, premElement;
- for (int i= 0; i < n; i++) {
- a1a2= (int[])bord.get(i);
- //pour le premier pt du bord on cherche un element
- //ayant 2 point de bord
- debIndex= a1a2[0];
- finIndex= a1a2[1];
- element= getEltIdxContainsPtIdx(debIndex);
- //l'element contenant les points 0 et 1 du bord.
- premElement= getElementIdxContainingPtIdx(finIndex, element);
-
- //l'orientation de l'element.
- a1= this.isElementTrigoOriente(premElement);
- a2= elts_[premElement].isSegmentInEltOrient(debIndex, finIndex);
- if (a2 == 0)
- System.out.println("prob les elements n'appartiennent au segment");
- //l'orientation reelle du premier segment de bord.
- a1= a1 * a2;
- if (a1 == 0)
- new Throwable().printStackTrace();
- //Si le point est dans le sens horaire on inverse.
- //le bord externe doit etre dans le sens trigo
- //et les bord interne dans le sens horaire.
- if (a1 < 0) {
- DodicoLib.invert(a1a2, 1);
- }
- }
-
- //on affecte les points frontieres.
- ptsFrontiere_= new H2dMaillageBord(bord);
- }
-
- public void computeBordV2(ProgressionInterface _inter) {
if (ptsFrontiere_ != null)
return;
! if (getEltType() == H2dElement.T6) {
! computeBordV2T6(_inter);
return;
}
--- 298,306 ----
*/
public void computeBord(ProgressionInterface _inter) {
if (ptsFrontiere_ != null)
return;
! if (getEltType() == H2dElementType.T6) {
! computeBordT6(_inter);
return;
}
***************
*** 555,566 ****
}
}
! ptsFrontiere_= new H2dMaillageBord(bordFinal);
}
! public void computeBordV2T6(ProgressionInterface _inter) {
if (ptsFrontiere_ != null)
return;
-
int n= elts_.length;
if (_inter != null) {
--- 430,440 ----
}
}
! ptsFrontiere_= new H2dMaillageFrontiere(bordFinal);
}
! public void computeBordT6(ProgressionInterface _inter) {
if (ptsFrontiere_ != null)
return;
int n= elts_.length;
if (_inter != null) {
***************
*** 691,695 ****
}
}
! ptsFrontiere_= new H2dMaillageBord(bordFinal);
}
--- 565,569 ----
}
}
! ptsFrontiere_= new H2dMaillageFrontiere(bordFinal);
}
***************
*** 709,713 ****
ProgressionInterface _progress,
TObjectIntHashMap _segmentPtAjouteIdx) {
! if (getEltType() != H2dElement.T3)
return null;
int nelem= elts_.length;
--- 583,587 ----
ProgressionInterface _progress,
TObjectIntHashMap _segmentPtAjouteIdx) {
! if (getEltType() != H2dElementType.T3)
return null;
int nelem= elts_.length;
***************
*** 835,839 ****
ProgressionInterface _progress,
TIntIntHashMap _ptT6IdxPtT3Idx) {
! if (getEltType() != H2dElement.T6)
return null;
int nelemT6= elts_.length;
--- 709,713 ----
ProgressionInterface _progress,
TIntIntHashMap _ptT6IdxPtT3Idx) {
! if (getEltType() != H2dElementType.T6)
return null;
int nelemT6= elts_.length;
***************
*** 917,921 ****
public H2dMaillage maillageT6en4T3(ProgressionInterface _progress) {
! if (getEltType() != H2dElement.T6)
return null;
int nptsT6= pts_.length;
--- 791,795 ----
public H2dMaillage maillageT6en4T3(ProgressionInterface _progress) {
! if (getEltType() != H2dElementType.T6)
return null;
int nptsT6= pts_.length;
***************
*** 1049,1053 ****
if (_pr != null)
_pr.setProgression(90);
! _mail.ptsFrontiere_=new H2dMaillageBord(l);
}
--- 923,927 ----
if (_pr != null)
_pr.setProgression(90);
! _mail.ptsFrontiere_=new H2dMaillageFrontiere(l);
}
Index: H2dMaillageMutable.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillageMutable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dMaillageMutable.java 18 Aug 2003 11:05:19 -0000 1.2
--- H2dMaillageMutable.java 22 Aug 2003 15:51:12 -0000 1.3
***************
*** 9,12 ****
--- 9,13 ----
package org.fudaa.dodico.h2d;
+ import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.dodico.telemac.io.SerafinInterface;
***************
*** 30,33 ****
--- 31,38 ----
elts_= _elements;
}
+
+ public void setElt(H2dElement _element,int _id){
+ elts_[_id]=_element;
+ }
/**
***************
*** 41,45 ****
*
*/
! public void setPtsFrontiere(H2dMaillageBord _is) {
ptsFrontiere_= _is;
}
--- 46,50 ----
*
*/
! public void setPtsFrontiere(H2dMaillageFrontiere _is) {
ptsFrontiere_= _is;
}
***************
*** 48,52 ****
*
*/
! public void setTypeElt(int _i) {
typeElt_= _i;
}
--- 53,57 ----
*
*/
! public void setTypeElt(H2dElementType _i) {
typeElt_= _i;
}
Index: H2dParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dParametres.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dParametres.java 19 Aug 2003 07:44:22 -0000 1.3
--- H2dParametres.java 22 Aug 2003 15:51:12 -0000 1.4
***************
*** 9,13 ****
package org.fudaa.dodico.h2d;
-
/**
*
--- 9,12 ----
***************
*** 15,23 ****
* @version $Id$
*/
! public interface H2dParametres
! {
!
! public H2dMaillage getMaillage();
}
--- 14,42 ----
* @version $Id$
*/
! public abstract class H2dParametres {
! protected H2dMaillage maillage_;
!
! protected H2dParametres(H2dMaillage _m) {
! maillage_= _m;
! }
!
! public final H2dMaillage getMaillage() {
! return maillage_;
! }
+ public int getNPointInBord(H2dBord _b) {
+ int deb= _b.getIdxDeb();
+ int fin= _b.getIdxFin();
+ if (fin > deb)
+ return fin - deb + 1;
+ else {
+ return fin
+ + 1
+ + maillage_.getPtsFrontiere().getPtNbForBord(
+ _b.getIdxFrontiere())
+ - deb;
+ }
+
+ }
}
--- H2dConditionLimiteReflux.java DELETED ---
--- H2dConditionLimiteRefluxMutable.java DELETED ---
--- H2dConditionLimiteTelemac.java DELETED ---
--- H2dConditionLimiteTelemacMutable.java DELETED ---
--- H2dParametresCalculReflux.java DELETED ---
--- H2dParametresReflux.java DELETED ---
--- H2dRefluxDicoModel.java DELETED ---
|
|
From: <de...@us...> - 2003-08-22 22:38:25
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d In directory sc8-pr-cvs1:/tmp/cvs-serv6234/h2d Removed Files: H2dMaillageBord.java Log Message: H2dMaillageBord renomme en H2dMaillageFrontiere --- H2dMaillageBord.java DELETED --- |
|
From: <de...@us...> - 2003-08-22 22:17:18
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux In directory sc8-pr-cvs1:/tmp/cvs-serv4685/reflux Log Message: Directory /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux added to the repository |
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque
In directory sc8-pr-cvs1:/tmp/cvs-serv6613/calque
Modified Files:
ZCalqueAffichageDonnees.java ZCalquePoint.java
ZEbliFilleCalques.java ZModelePoint.java
Log Message:
Corrections mineures
Index: ZCalqueAffichageDonnees.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonnees.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ZCalqueAffichageDonnees.java 4 Jul 2003 14:32:48 -0000 1.2
--- ZCalqueAffichageDonnees.java 22 Aug 2003 15:55:31 -0000 1.3
***************
*** 47,51 ****
protected Color couleurSelection_ = null;
protected TraceIcone iconeSelection_ = null;
! protected TraceIcone iconeSelectionPartielle_ = null;
public ZCalqueAffichageDonnees()
--- 47,51 ----
protected Color couleurSelection_ = null;
protected TraceIcone iconeSelection_ = null;
! // protected TraceIcone iconeSelectionPartielle_ = null;
public ZCalqueAffichageDonnees()
***************
*** 58,65 ****
}
! public TraceIcone iconeSelectionPartielle()
! {
! return iconeSelectionPartielle_;
! }
/**
--- 58,65 ----
}
! // public TraceIcone iconeSelectionPartielle()
! // {
! // return iconeSelectionPartielle_;
! // }
/**
***************
*** 80,88 ****
}
! protected void initIconeSelectionPartielle()
! {
! if (iconeSelectionPartielle_ == null)
! iconeSelectionPartielle_ = new TraceIcone(TraceIcone.CARRE_PLEIN, 4);
! }
public EbliListeSelection modeleSelection()
--- 80,88 ----
}
! // protected void initIconeSelectionPartielle()
! // {
! // if (iconeSelectionPartielle_ == null)
! // iconeSelectionPartielle_ = new TraceIcone(TraceIcone.CARRE_PLEIN, 4);
! // }
public EbliListeSelection modeleSelection()
Index: ZCalquePoint.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ZCalquePoint.java 4 Jul 2003 14:32:48 -0000 1.2
--- ZCalquePoint.java 22 Aug 2003 15:55:31 -0000 1.3
***************
*** 14,18 ****
import javax.swing.Icon;
! import org.fudaa.ebli.commun.*;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrMorphisme;
--- 14,18 ----
import javax.swing.Icon;
! import org.fudaa.ebli.commun.EbliListeSelection;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrMorphisme;
***************
*** 21,24 ****
--- 21,26 ----
import org.fudaa.ebli.palette.BPaletteCouleur;
import org.fudaa.ebli.palette.BPaletteIcone;
+ import org.fudaa.ebli.trace.TraceIcone;
+ import org.fudaa.ebli.trace.TracePoint;
/**
***************
*** 42,52 ****
public ZCalquePoint()
{
! super();
}
public ZCalquePoint(ZModelePoint _modele)
{
! this();
modele(_modele);
}
--- 44,57 ----
public ZCalquePoint()
{
! this(null);
!
!
}
public ZCalquePoint(ZModelePoint _modele)
{
! super();
modele(_modele);
+ setIcone(new TraceIcone(TracePoint.POINT,1));
}
Index: ZEbliFilleCalques.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliFilleCalques.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ZEbliFilleCalques.java 4 Jul 2003 14:32:48 -0000 1.5
--- ZEbliFilleCalques.java 22 Aug 2003 15:55:31 -0000 1.6
***************
*** 108,114 ****
private BGroupeCalque cqAdmin_;
/** */
! private BCalquePositionnementInteraction cqDepVueI_;
/** */
! private BCalqueRepereInteraction cqZoomI_;
/** */
--- 108,114 ----
private BGroupeCalque cqAdmin_;
/** */
! protected BCalquePositionnementInteraction cqDepVueI_;
/** */
! protected BCalqueRepereInteraction cqZoomI_;
/** */
***************
*** 138,145 ****
protected JComponent[] specificTools_;
! private ArrayList specificToolsList_;
// private SpecificToolsManager specificToolsManager_;
private AbstractButton[] btSelection_;
! private ViewPreferences specificToolsPrefView_;
private AbstractButton[] enableButtons_;
--- 138,145 ----
protected JComponent[] specificTools_;
! protected ArrayList specificToolsList_;
// private SpecificToolsManager specificToolsManager_;
private AbstractButton[] btSelection_;
! protected ViewPreferences specificToolsPrefView_;
private AbstractButton[] enableButtons_;
***************
*** 205,210 ****
* @param _vc la vue calque associee
* @param _arbre l'arbre associe
- * @param _groupSelection si true ce groupe sera construit. idem pour les
- * autres
* @param _appli l'appli associee
* @param _id les informations eventuelles du document.
--- 205,208 ----
***************
*** 364,368 ****
}
! private String getPreferencesVisibleKey(JComponent _ab)
{
String pref = getPreferencesKey(_ab);
--- 362,366 ----
}
! protected String getPreferencesVisibleKey(JComponent _ab)
{
String pref = getPreferencesKey(_ab);
***************
*** 373,377 ****
}
! private boolean isPreferencesVisible(JComponent _ab)
{
String pref = getPreferencesVisibleKey(_ab);
--- 371,375 ----
}
! protected boolean isPreferencesVisible(JComponent _ab)
{
String pref = getPreferencesVisibleKey(_ab);
***************
*** 379,383 ****
}
! private void writePreferences()
{
EbliPreferences.EBLI.writeIniFile();
--- 377,381 ----
}
! protected void writePreferences()
{
EbliPreferences.EBLI.writeIniFile();
***************
*** 450,454 ****
}
! private void applyPreferences()
{
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED);
--- 448,452 ----
}
! protected void applyPreferences()
{
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED);
***************
*** 754,758 ****
}
! private void showViewPreferences()
{
if(EbliLib.DEBUG) System.out.println("ViewPreferences ok");
--- 752,756 ----
}
! protected void showViewPreferences()
{
if(EbliLib.DEBUG) System.out.println("ViewPreferences ok");
***************
*** 1173,1178 ****
/**
! * Renvoie les enableButtons : ce sont les boutons qui seront actives ou non avec le changement de calque.
! * La methode </code>getEnabledSpecificTools()</code> de <code>BCalque</code> est utilisee pour les determiner.
* Cette methode peut-être redefinie pour modifier les outils a activer ou non.
*
--- 1171,1178 ----
/**
! * Renvoie les enableButtons : ce sont les boutons qui seront actives ou non
! * avec le changement de calque.
! * La methode </code>getEnabledSpecificTools()</code> de <code>BCalque</code>
! * est utilisee pour les determiner.
* Cette methode peut-être redefinie pour modifier les outils a activer ou non.
*
***************
*** 1441,1445 ****
public void apply()
{
- System.out.println("apply");
savePref(model_.button_);
model_.button_.clear();
--- 1441,1444 ----
Index: ZModelePoint.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModelePoint.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZModelePoint.java 30 Jan 2003 10:56:50 -0000 1.1
--- ZModelePoint.java 22 Aug 2003 15:55:31 -0000 1.2
***************
*** 21,32 ****
{
- /**
- * Instancie un point et le renvoie.
- *
- * @param _i
- * @return nouveau point
- */
- //GrPoint point(int _i);
-
/**
--- 21,24 ----
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog
In directory sc8-pr-cvs1:/tmp/cvs-serv6613/dialog
Modified Files:
BDialog.java BDialogContent.java BDialogContentImprimable.java
BFileChooser.java BInternalDialog.java
EbliSimpleDialogPanel.java
Log Message:
Corrections mineures
Index: BDialog.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/BDialog.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BDialog.java 1 Apr 2003 15:15:29 -0000 1.3
--- BDialog.java 22 Aug 2003 15:55:31 -0000 1.4
***************
*** 10,18 ****
package org.fudaa.ebli.dialog;
! import com.memoire.bu.*;
! import java.awt.*;
! import java.awt.event.*;
! import javax.swing.*;
! import java.util.*;
/**
--- 10,21 ----
package org.fudaa.ebli.dialog;
! import java.awt.Component;
! import java.awt.event.WindowAdapter;
! import java.awt.event.WindowEvent;
! import java.util.Vector;
!
! import javax.swing.JDialog;
!
! import com.memoire.bu.BuCommonInterface;
/**
Index: BDialogContent.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/BDialogContent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BDialogContent.java 1 Apr 2003 15:15:27 -0000 1.3
--- BDialogContent.java 22 Aug 2003 15:55:31 -0000 1.4
***************
*** 10,22 ****
package org.fudaa.ebli.dialog;
! import com.memoire.bu.*;
! import org.fudaa.ebli.ressource.*;
! import org.fudaa.ebli.commun.*;
! import java.util.*;
! import java.awt.*;
! import java.awt.event.*;
! import javax.swing.*;
! import javax.swing.border.*;
! import java.beans.*;
/**
--- 10,45 ----
package org.fudaa.ebli.dialog;
! import java.awt.BorderLayout;
! import java.awt.Color;
! import java.awt.Component;
! import java.awt.Container;
! import java.awt.Dialog;
! import java.awt.Dimension;
! import java.awt.Point;
! import java.awt.Toolkit;
! import java.awt.event.ActionEvent;
! import java.awt.event.ActionListener;
! import java.awt.event.KeyEvent;
! import java.awt.event.KeyListener;
! import java.awt.event.MouseAdapter;
! import java.awt.event.MouseEvent;
! import java.beans.PropertyChangeEvent;
! import java.beans.PropertyChangeListener;
!
! import javax.swing.JComponent;
! import javax.swing.JOptionPane;
! import javax.swing.JPanel;
! import javax.swing.JScrollPane;
! import javax.swing.border.EmptyBorder;
! import javax.swing.border.EtchedBorder;
!
! import com.memoire.bu.BuCommonInterface;
! import com.memoire.bu.BuDialogError;
! import com.memoire.bu.BuDialogMessage;
! import com.memoire.bu.BuIcon;
! import com.memoire.bu.BuInformationsSoftware;
! import com.memoire.bu.BuPanel;
!
! import org.fudaa.ebli.commun.EbliPreferences;
/**
Index: BDialogContentImprimable.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/BDialogContentImprimable.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BDialogContentImprimable.java 1 Apr 2003 15:15:31 -0000 1.3
--- BDialogContentImprimable.java 22 Aug 2003 15:55:31 -0000 1.4
***************
*** 18,23 ****
import com.memoire.bu.BuInformationsDocument;
- import org.fudaa.ebli.impression.EbliPageable;
import org.fudaa.ebli.impression.EbliPageFormat;
import org.fudaa.ebli.impression.EbliPageableDelegate;
--- 18,23 ----
import com.memoire.bu.BuInformationsDocument;
import org.fudaa.ebli.impression.EbliPageFormat;
+ import org.fudaa.ebli.impression.EbliPageable;
import org.fudaa.ebli.impression.EbliPageableDelegate;
Index: BFileChooser.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/BFileChooser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BFileChooser.java 1 Apr 2003 15:15:30 -0000 1.3
--- BFileChooser.java 22 Aug 2003 15:55:31 -0000 1.4
***************
*** 10,15 ****
package org.fudaa.ebli.dialog;
! import javax.swing.*;
! import org.fudaa.ebli.ressource.*;
/**
--- 10,17 ----
package org.fudaa.ebli.dialog;
! import javax.swing.JFileChooser;
! import javax.swing.UIManager;
!
! import org.fudaa.ebli.ressource.EbliResource;
/**
Index: BInternalDialog.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/BInternalDialog.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BInternalDialog.java 1 Apr 2003 15:15:30 -0000 1.3
--- BInternalDialog.java 22 Aug 2003 15:55:31 -0000 1.4
***************
*** 10,23 ****
package org.fudaa.ebli.dialog;
! import com.memoire.bu.*;
! import org.fudaa.ebli.impression.EbliPageable;
import org.fudaa.ebli.impression.EbliPageFormat;
! import java.awt.*;
! import java.awt.dnd.*;
! import java.awt.print.*;
! import java.awt.event.*;
! import javax.swing.*;
! import javax.swing.event.*;
! import java.util.*;
/**
--- 10,40 ----
package org.fudaa.ebli.dialog;
! import java.awt.Component;
! import java.awt.Dimension;
! import java.awt.Graphics;
! import java.awt.Point;
! import java.awt.dnd.DnDConstants;
! import java.awt.dnd.DropTarget;
! import java.awt.dnd.DropTargetDragEvent;
! import java.awt.dnd.DropTargetDropEvent;
! import java.awt.dnd.DropTargetEvent;
! import java.awt.dnd.DropTargetListener;
! import java.awt.print.PageFormat;
! import java.awt.print.Printable;
! import java.util.Vector;
!
! import javax.swing.JComponent;
! import javax.swing.JInternalFrame;
! import javax.swing.event.InternalFrameAdapter;
! import javax.swing.event.InternalFrameEvent;
!
! import com.memoire.bu.BuCommonInterface;
! import com.memoire.bu.BuDesktop;
! import com.memoire.bu.BuInformationsDocument;
! import com.memoire.bu.BuInformationsSoftware;
! import com.memoire.bu.BuInternalFrame;
!
import org.fudaa.ebli.impression.EbliPageFormat;
! import org.fudaa.ebli.impression.EbliPageable;
/**
Index: EbliSimpleDialogPanel.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/EbliSimpleDialogPanel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliSimpleDialogPanel.java 4 Jul 2003 14:32:48 -0000 1.1
--- EbliSimpleDialogPanel.java 22 Aug 2003 15:55:31 -0000 1.2
***************
*** 22,26 ****
import java.io.File;
- import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JButton;
--- 22,25 ----
***************
*** 31,35 ****
import javax.swing.JOptionPane;
import javax.swing.JTextField;
[...1200 lines suppressed...]
*/
! public File getLastFile() {
return lastFile_;
}
***************
*** 778,784 ****
*
*/
! public void setLastFile(File _file)
! {
! lastFile_ = _file;
}
--- 709,714 ----
*
*/
! public void setLastFile(File _file) {
! lastFile_= _file;
}
|
|
From: <de...@us...> - 2003-08-22 21:49:57
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv7810/commun
Modified Files:
FudaaCommonImplementation.java FudaaUI.java
Log Message:
tr: ajout de l'export pour le maillage
gestion affichage maillage
commun modif mineure
Index: FudaaCommonImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaCommonImplementation.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FudaaCommonImplementation.java 19 Aug 2003 07:48:38 -0000 1.2
--- FudaaCommonImplementation.java 22 Aug 2003 16:02:23 -0000 1.3
***************
*** 36,39 ****
--- 36,40 ----
import org.fudaa.dodico.commun.DodicoAnalyze;
+ import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
***************
*** 42,45 ****
--- 43,47 ----
import org.fudaa.ebli.impression.EbliMiseEnPagePreferencesPanel;
import org.fudaa.ebli.impression.EbliPageable;
+
import org.fudaa.fudaa.commun.aide.FudaaAidePreferencesPanel;
import org.fudaa.fudaa.commun.aide.FudaaAstuces;
***************
*** 175,185 ****
{
String action = _evt.getActionCommand();
- String arg = "";
int i = action.indexOf('(');
if (i >= 0)
{
! arg = action.substring(i + 1, action.length() - 1);
! action = action.substring(0, i);
}
--- 177,185 ----
{
String action = _evt.getActionCommand();
int i = action.indexOf('(');
if (i >= 0)
{
! action =action.substring(i + 1, action.length() - 1).substring(0, i);
}
***************
*** 366,394 ****
*
*/
! public boolean manageErrorOperation(FileOperationSynthese _opResult)
{
if (_opResult.getClosingException() != null)
{
System.err.println(
! "FATAL :erreur lors de la fermeture de " + _opResult.getFile());
}
if (_opResult.getAnalyze() != null)
{
! if (_opResult.getAnalyze().getFatalError() != null)
! {
- DodicoAnalyze.Field f = _opResult.getAnalyze().getFatalError();
- error(
- _opResult.getDesc(),
- f.getOffset() < 0 ? f.getMessage() : f.toString());
- return true;
- }
- else
- {
- FudaaLib.showError(
- this,
- _opResult.getDesc(),
- _opResult.getAnalyze().getResume());
- }
}
return false;
--- 366,380 ----
*
*/
! public boolean manageErrorOperationAndIsFatal(FileOperationSynthese _opResult)
{
if (_opResult.getClosingException() != null)
{
System.err.println(
! "FATAL :erreur lors de la fermeture de " + _opResult.getAnalyze().getRessource());
}
if (_opResult.getAnalyze() != null)
{
! return manageAnalyzeAndIsFatal(_opResult.getAnalyze());
}
return false;
***************
*** 477,480 ****
--- 463,489 ----
else
return null;
+ }
+
+ public boolean manageAnalyzeAndIsFatal(DodicoAnalyze.Editor _analyze) {
+ return _analyze==null?false:manageAnalyzeAndIsFatal(_analyze.toAnalyze());
+ }
+
+ /**
+ * Renvoie true si fatal error.
+ */
+ public boolean manageAnalyzeAndIsFatal(DodicoAnalyze _analyze) {
+ if(_analyze==null) return false;
+ if(!_analyze.isEmpty()){
+ _analyze.printResume();
+ }
+ if (_analyze.getFatalError() != null)
+ {
+ DodicoAnalyze.Field f = _analyze.getFatalError();
+ error(
+ _analyze.getDesc(),
+ f.getOffset() < 0 ? f.getMessage() : f.toString());
+ return true;
+ }
+ return false;
}
Index: FudaaUI.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaUI.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FudaaUI.java 4 Jul 2003 16:05:04 -0000 1.1
--- FudaaUI.java 22 Aug 2003 16:02:23 -0000 1.2
***************
*** 9,12 ****
--- 9,13 ----
package org.fudaa.fudaa.commun;
+ import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoUI;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
***************
*** 23,27 ****
* Gere les erreurs survenues pour l'operation et renvoie true si erreur fatale.
*/
! public boolean manageErrorOperation(FileOperationSynthese _opResult);
}
--- 24,30 ----
* Gere les erreurs survenues pour l'operation et renvoie true si erreur fatale.
*/
! public boolean manageErrorOperationAndIsFatal(FileOperationSynthese _opResult);
!
! public boolean manageAnalyzeAndIsFatal(DodicoAnalyze _analyze);
}
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/dico
Modified Files:
DicoCasFileFormat.java DicoCasFileFormatVersion.java
DicoCasReader.java DicoCasWriter.java DicoGenerator.java
DicoParams.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
Index: DicoCasFileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoCasFileFormat.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DicoCasFileFormat.java 19 Aug 2003 07:44:21 -0000 1.3
--- DicoCasFileFormat.java 22 Aug 2003 15:51:11 -0000 1.4
***************
*** 27,30 ****
--- 27,31 ----
super(1);
nom_= _nom;
+ ID_=nom_.toUpperCase();
description_= "fichier de paramètres";
mode_= MODE_ASCII;
***************
*** 74,77 ****
--- 75,80 ----
return getDicoManager().createVersionImpl(this, _version, _language);
}
+
+
}
Index: DicoCasFileFormatVersion.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoCasFileFormatVersion.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DicoCasFileFormatVersion.java 18 Aug 2003 11:48:02 -0000 1.1
--- DicoCasFileFormatVersion.java 22 Aug 2003 15:51:11 -0000 1.2
***************
*** 15,18 ****
--- 15,20 ----
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
+ import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
+ import org.fudaa.dodico.fichiers.FileWriteOperationAbstract;
/**
***************
*** 95,116 ****
}
- public FileOperationSynthese writeCas(
- File _f,
- DicoCasInterface _inter,
- ProgressionInterface _prog) {
- DicoCasWriter w= createDicoCasWriter();
- FileOperationSynthese synt= FileFormatVersion.initOperation(w, _prog, _f);
- w.write(_inter, synt);
- return synt;
- }
-
- public DicoCasInterface readCas(
- File _f,
- FileOperationSynthese _synt,
- ProgressionInterface _prog) {
- DicoCasReader r= createDicoCasReader();
- FileFormatVersion.initOperation(_synt, r, _prog, _f);
- return r.read(_synt);
- }
/**
--- 97,100 ----
***************
*** 120,123 ****
--- 104,138 ----
return dico_;
}
+
+ /**
+ *
+ */
+ public FileReadOperationAbstract createReader() {
+ return createDicoCasReader();
+ }
+
+ /**
+ *
+ */
+ public FileWriteOperationAbstract createWriter() {
+ return createDicoCasWriter();
+ }
+
+ public FileOperationSynthese writeMaillage(
+ File _f,
+ DicoCasInterface _source,
+ ProgressionInterface _prog) {
+ DicoCasWriter i= createDicoCasWriter();
+ if(i==null){
+ return super.write(_f,(Object)_source,_prog);
+ }
+ i.setFile(_f);
+ i.setProgressReceiver(_prog);
+ FileOperationSynthese r= i.write(_source);
+ i.setProgressReceiver(null);
+ return r;
+
+ }
+
}
Index: DicoCasReader.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoCasReader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DicoCasReader.java 18 Aug 2003 11:05:19 -0000 1.2
--- DicoCasReader.java 22 Aug 2003 15:51:11 -0000 1.3
***************
*** 20,25 ****
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationAbstract;
! import org.fudaa.dodico.fichiers.FileOperationInterface;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
/**
--- 20,28 ----
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationAbstract;
! import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
+ import org.fudaa.dodico.fortran.FortranInterface;
+ import org.fudaa.dodico.fortran.FortranLib;
+ import org.fudaa.dodico.fortran.FortranReader;
/**
***************
*** 27,32 ****
* @version $Id$
*/
! public class DicoCasReader extends FileOperationAbstract implements FileOperationInterface
! {
DicoModelAbstract dico_;
DicoCasFileFormatVersion ft_;
--- 30,34 ----
* @version $Id$
*/
! public class DicoCasReader extends FileReadOperationAbstract {
DicoModelAbstract dico_;
DicoCasFileFormatVersion ft_;
***************
*** 34,179 ****
long readTime_;
! public DicoCasReader(DicoCasFileFormatVersion _t)
! {
! ft_ = _t;
! dico_ = ft_.getDico();
}
! public void setFile(File _f)
! {
!
! try
! {
! in_ = new LineNumberReader(new FileReader(_f));
! }
! catch (FileNotFoundException e)
! {
! in_ = null;
}
}
- public DicoCasInterface read(FileOperationSynthese _op)
- {
- DodicoAnalyze.Editor edit=new DodicoAnalyze.Editor();
- DicoCasInterface r=readCas(edit);
- FileOperationSynthese.initAndClose(_op,edit,this,"Lecture Fichier Cas");
- return r;
- }
! /**
! * @see org.fudaa.dodico.tr.TrReaderInterface#read()
! */
! private DicoCasInterface readCas(DodicoAnalyze.Editor _analyze)
! {
! DicoCasAbstract inter_ = null;
! if (in_ == null)
! {
! _analyze.addFatalError(DodicoLib.geti18n("Flux d'entree non trouve"));
return null;
}
! try
! {
String line;
String trimLine;
! boolean quoteEnCours = false;
String stemp;
! StringBuffer b = new StringBuffer(100);
! inter_ = new DicoCasAbstract();
! DicoEntite keyEnCours = null;
! while ((line = in_.readLine()) != null)
! {
! trimLine = line.trim();
//ligne vide
if (trimLine.length() == 0)
continue;
! if (quoteEnCours)
! {
! quoteEnCours = sansCommentaire(trimLine, true, b);
! }
! else
! {
//commentaire
if (trimLine.startsWith("/"))
continue;
! else if (trimLine.startsWith(ft_.getCommandStop()))
! {
inter_.setCommandStop(true);
! }
! else if (trimLine.startsWith(ft_.getCommandStopProgram()))
! {
inter_.setCommandStopProgram(true);
! }
! else if (trimLine.startsWith(ft_.getCommandPrintKeys()))
! {
inter_.setPrintKeys(true);
! }
! else if (trimLine.startsWith(ft_.getCommandPrintLongKeys()))
! {
inter_.setPrintLongKeys(true);
! }
! else if (trimLine.startsWith(ft_.getCommandPrintKeysValues()))
! {
inter_.setPrintKeysValues(true);
! }
! else
! {
! int indexE = equalIndex(trimLine);
! if (indexE > 0)
! {
! stemp = trimLine.substring(0, indexE).trim();
! if (dico_.isKey(stemp))
! {
! if (keyEnCours != null)
! {
! if (inter_.containsEntite(keyEnCours))
! {
! _analyze.addInfo(
! DodicoLib.geti18n("le mot-clef") + " " + keyEnCours.getNom() + " " + DodicoLib.geti18n("est défini plusieurs fois"),
in_.getLineNumber());
}
! ajouteClefValeur(keyEnCours, b, inter_,_analyze);
}
b.setLength(0);
! keyEnCours = dico_.getEntite(stemp);
! if (indexE < trimLine.length() - 1)
! {
! quoteEnCours = sansCommentaire(trimLine.substring(indexE + 1), false, b);
}
}
! }
! else
! {
! quoteEnCours = sansCommentaire(trimLine, false, b);
}
}
}
}
! if (keyEnCours != null)
! {
! ajouteClefValeur(keyEnCours, b, inter_,_analyze);
}
! }
! catch (IOException _ioe)
! {
! DodicoAnalyze.manageException(_ioe, _analyze);
}
return inter_;
}
! private void ajouteClefValeur(DicoEntite _cle, StringBuffer _valeur, DicoCasAbstract _dico,DodicoAnalyze.Editor _analyze)
! {
! String s = _valeur.toString().trim();
_dico.addTelemacCasInput(_cle, s);
! if (!_cle.isValide(s))
! {
! _analyze.addError("Valeur non valide", in_.getLineNumber());
! _analyze.addInfo(
! DodicoLib.geti18n("clef") + ": \"" + _cle.getNom() + "\", " + DodicoLib.geti18n("valeur") + ": \"" + _valeur.toString().trim() + "\"",
in_.getLineNumber());
--- 36,153 ----
long readTime_;
! public DicoCasReader(DicoCasFileFormatVersion _t) {
! ft_= _t;
! dico_= ft_.getDico();
}
! public void setFile(File _f) {
! analyze_= new DodicoAnalyze.Editor();
! analyze_.setRessource(_f.getAbsolutePath());
! try {
! in_= new LineNumberReader(new FileReader(_f));
! } catch (FileNotFoundException e) {
! in_= null;
}
}
! private DicoCasInterface readCas() {
! DicoCasAbstract inter_= null;
! if (in_ == null) {
! analyze_.addFatalError(DodicoLib.geti18n("Flux d'entree non trouve"));
return null;
}
! try {
String line;
String trimLine;
! boolean quoteEnCours= false;
String stemp;
! StringBuffer b= new StringBuffer(100);
! inter_= new DicoCasAbstract();
! DicoEntite keyEnCours= null;
! while ((line= in_.readLine()) != null) {
! trimLine= line.trim();
//ligne vide
if (trimLine.length() == 0)
continue;
! if (quoteEnCours) {
! quoteEnCours= sansCommentaire(trimLine, true, b);
! } else {
//commentaire
if (trimLine.startsWith("/"))
continue;
! else if (trimLine.startsWith(ft_.getCommandStop())) {
inter_.setCommandStop(true);
! } else if (trimLine.startsWith(ft_.getCommandStopProgram())) {
inter_.setCommandStopProgram(true);
! } else if (trimLine.startsWith(ft_.getCommandPrintKeys())) {
inter_.setPrintKeys(true);
! } else if (trimLine.startsWith(ft_.getCommandPrintLongKeys())) {
inter_.setPrintLongKeys(true);
! } else if (trimLine.startsWith(ft_.getCommandPrintKeysValues())) {
inter_.setPrintKeysValues(true);
! } else {
! int indexE= equalIndex(trimLine);
! if (indexE > 0) {
! stemp= trimLine.substring(0, indexE).trim();
! if (dico_.isKey(stemp)) {
! if (keyEnCours != null) {
! if (inter_.containsEntite(keyEnCours)) {
! analyze_.addInfo(
! DodicoLib.geti18n("le mot-clef")
! + " "
! + keyEnCours.getNom()
! + " "
! + DodicoLib.geti18n("est défini plusieurs fois"),
in_.getLineNumber());
}
! ajouteClefValeur(keyEnCours, b, inter_, analyze_);
}
b.setLength(0);
! keyEnCours= dico_.getEntite(stemp);
! if (indexE < trimLine.length() - 1) {
! quoteEnCours=
! sansCommentaire(trimLine.substring(indexE + 1), false, b);
}
}
! } else {
! quoteEnCours= sansCommentaire(trimLine, false, b);
}
}
}
}
! if (keyEnCours != null) {
! ajouteClefValeur(keyEnCours, b, inter_, analyze_);
}
! } catch (IOException _ioe) {
! DodicoAnalyze.manageException(_ioe, analyze_);
}
return inter_;
}
! private void ajouteClefValeur(
! DicoEntite _cle,
! StringBuffer _valeur,
! DicoCasAbstract _dico,
! DodicoAnalyze.Editor analyze_) {
! String s= _valeur.toString().trim();
_dico.addTelemacCasInput(_cle, s);
! if (!_cle.isValide(s)) {
! analyze_.addError("Valeur non valide", in_.getLineNumber());
! analyze_.addInfo(
! DodicoLib.geti18n("clef")
! + ": \""
! + _cle.getNom()
! + "\", "
! + DodicoLib.geti18n("valeur")
! + ": \""
! + _valeur.toString().trim()
! + "\"",
in_.getLineNumber());
***************
*** 185,215 ****
* Supprime les commentaires et les quotes ( et transforme les double en simple).
*/
! private static boolean sansCommentaire(String _s, boolean _beginByQuote, StringBuffer _b)
! {
! int l = _s.length();
! int index = _s.indexOf('\'');
! if (_beginByQuote)
! {
! if (index < 0)
! {
_b.append(_s);
return true;
! }
! else if (index == l - 1)
! {
_b.append(_s.substring(0, l - 1));
return false;
! }
! else
! {
! char c = _s.charAt(index + 1);
! if (c == '\'')
! {
_b.append(_s.substring(0, index + 1));
return sansCommentaire(_s.substring(index + 2), _beginByQuote, _b);
! }
! else
! {
_b.append(_s.substring(0, index));
--- 159,182 ----
* Supprime les commentaires et les quotes ( et transforme les double en simple).
*/
! private static boolean sansCommentaire(
! String _s,
! boolean _beginByQuote,
! StringBuffer _b) {
! int l= _s.length();
! int index= _s.indexOf('\'');
! if (_beginByQuote) {
! if (index < 0) {
_b.append(_s);
return true;
! } else if (index == l - 1) {
_b.append(_s.substring(0, l - 1));
return false;
! } else {
! char c= _s.charAt(index + 1);
! if (c == '\'') {
_b.append(_s.substring(0, index + 1));
return sansCommentaire(_s.substring(index + 2), _beginByQuote, _b);
! } else {
_b.append(_s.substring(0, index));
***************
*** 217,245 ****
}
}
! }
! else
! {
//l'indice du sigle de commentaire
! int indexCom = _s.indexOf('/');
//un ' present
! if (index >= 0)
! {
//Si pas de commentaire ou commentaire apres
! if ((indexCom < 0) || (index < indexCom))
! {
_b.append(_s.substring(0, index));
return sansCommentaire(_s.substring(index + 1), true, _b);
}
}
! if (indexCom >= 0)
! {
_b.append(_s.substring(0, indexCom));
! int com2 = _s.indexOf('/', indexCom + 1);
! if ((com2 < 0) || (com2 == l - 1))
! {
return false;
! }
! else
! {
return sansCommentaire(_s.substring(com2 + 1), false, _b);
}
--- 184,204 ----
}
}
! } else {
//l'indice du sigle de commentaire
! int indexCom= _s.indexOf('/');
//un ' present
! if (index >= 0) {
//Si pas de commentaire ou commentaire apres
! if ((indexCom < 0) || (index < indexCom)) {
_b.append(_s.substring(0, index));
return sansCommentaire(_s.substring(index + 1), true, _b);
}
}
! if (indexCom >= 0) {
_b.append(_s.substring(0, indexCom));
! int com2= _s.indexOf('/', indexCom + 1);
! if ((com2 < 0) || (com2 == l - 1)) {
return false;
! } else {
return sansCommentaire(_s.substring(com2 + 1), false, _b);
}
***************
*** 250,258 ****
}
! private static int equalIndex(String _l)
! {
! int index = _l.indexOf('=');
if (index < 0)
! index = _l.indexOf(':');
return index;
}
--- 209,216 ----
}
! private static int equalIndex(String _l) {
! int index= _l.indexOf('=');
if (index < 0)
! index= _l.indexOf(':');
return index;
}
***************
*** 261,266 ****
* @see org.fudaa.dodico.tr.TrReaderInterface#close()
*/
! public void close() throws IOException
! {
in_.close();
}
--- 219,223 ----
* @see org.fudaa.dodico.tr.TrReaderInterface#close()
*/
! public void close() throws IOException {
in_.close();
}
***************
*** 269,274 ****
* @see org.fudaa.dodico.tr.TrReaderInterface#setIn(java.io.File[])
*/
! public void setFile(File[] _f)
! {
setFile(_f[0]);
--- 226,230 ----
* @see org.fudaa.dodico.tr.TrReaderInterface#setIn(java.io.File[])
*/
! public void setFile(File[] _f) {
setFile(_f[0]);
***************
*** 278,288 ****
* @return
*/
! public DicoCasFileFormatVersion getDicoCasFileFormatVersion()
! {
return ft_;
}
! public FileFormatVersion getFileFormatVersion()
! {
return getDicoCasFileFormatVersion();
}
--- 234,242 ----
* @return
*/
! public DicoCasFileFormatVersion getDicoCasFileFormatVersion() {
return ft_;
}
! public FileFormatVersion getFileFormatVersion() {
return getDicoCasFileFormatVersion();
}
***************
*** 291,297 ****
*
*/
! public long getReadTime()
! {
return readTime_;
}
--- 245,275 ----
*
*/
! public long getReadTime() {
return readTime_;
+ }
+
+ /**
+ *
+ */
+ protected Object _read() {
+ return readCas();
+ }
+
+ /**
+ *
+ */
+ protected FortranInterface getFortranInterface() {
+ return new FortranInterface(){
+ public void close() throws IOException{
+ if(in_!=null) in_.close();
+ }
+ };
+ }
+
+ /**
+ *
+ */
+ public FileFormatVersion getVersion() {
+ return ft_;
}
Index: DicoCasWriter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoCasWriter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DicoCasWriter.java 18 Aug 2003 11:05:19 -0000 1.2
--- DicoCasWriter.java 22 Aug 2003 15:51:11 -0000 1.3
***************
*** 28,33 ****
* @version $Id$
*/
! public class DicoCasWriter extends FileOpWriterCharSimpleAbstract
! {
DicoCasFileFormatVersion version_;
String commentSep_;
--- 28,32 ----
* @version $Id$
*/
! public class DicoCasWriter extends FileOpWriterCharSimpleAbstract {
DicoCasFileFormatVersion version_;
String commentSep_;
***************
*** 39,117 ****
* @param _ft
*/
! public DicoCasWriter(DicoCasFileFormatVersion _ft)
! {
! version_ = _ft;
! com_ = version_.getCommentChar();
! commentSep_ = com_ + "---------------------------------------------------------------------" + lineSep_;
! enteteFormat_ =
! commentSep_ + com_ + " " + version_.getFileFormat().getID() + " Version ${VERSION} ${DATE}" + lineSep_ + com_ + " ${TITLE}" + lineSep_ + commentSep_;
! enteteRubrique_ = lineSep_ + commentSep_ + com_ + " ${RUBRIQUE}" + lineSep_ + commentSep_;
}
! public FileFormatVersion getFileFormatVersion()
! {
return version_;
}
! public void write(DicoCasInterface _inter, FileOperationSynthese _op)
! {
! DodicoAnalyze.Editor edit = new DodicoAnalyze.Editor();
! writeCas(_inter,edit);
! FileOperationSynthese.initAndClose(_op, edit, this, "Lecture Fichier Cas");
! }
!
! /**
! * @see org.fudaa.dodico.tr.TrWriterInterface#write()
! */
! public void writeCas(DicoCasInterface _inter,DodicoAnalyze.Editor _analyze)
! {
! DicoCasInterface interface_ = _inter;
! if (interface_ == null)
! {
! _analyze.addFatalError(DodicoLib.geti18n("Les données sont nulles"));
return;
}
! if (out_ == null)
! {
! _analyze.addFatalError(DodicoLib.geti18n("Le flux de sortie est nul."));
return;
}
//Hashtable entitesValues = interface_.getInputs();
! Set rest = interface_.getEntiteSet();
! String[] rubriques = version_.getDico().getRubriques();
! try
! {
! String dd = null;
! DicoEntite entNom = version_.getTitreEntite();
! if (entNom != null)
! {
! dd = interface_.getValue(entNom);
}
if (dd == null)
! dd = "nom inconnu";
writeEntete(dd);
if (progress_ != null)
progress_.setProgression(10);
! if ((rubriques == null) || (rubriques.length == 0))
! {
! DicoEntite[] ents = new DicoEntite[rest.size()];
rest.toArray(ents);
! writeRubrique(DodicoLib.geti18n("Inconnu"), ents, interface_,_analyze);
rest.clear();
if (progress_ != null)
progress_.setProgression(90);
}
! int n = rubriques.length;
! int m = n / 2;
! for (int i = 0; i < n; i++)
! {
if (rubriques[i] == null)
System.err.println("rubriques nulles");
! DicoEntite[] entToWrite = DicoEntite.getAndRemoveEntite(rubriques[i], rest);
! writeRubrique(rubriques[i], entToWrite, interface_,_analyze);
! if ((progress_ != null) && (i == m))
! {
progress_.setProgression(55);
}
--- 38,110 ----
* @param _ft
*/
! public DicoCasWriter(DicoCasFileFormatVersion _ft) {
! version_= _ft;
! com_= version_.getCommentChar();
! commentSep_=
! com_
! + "---------------------------------------------------------------------"
! + lineSep_;
! enteteFormat_=
! commentSep_
! + com_
! + " "
! + version_.getFileFormat().getID()
! + " Version ${VERSION} ${DATE}"
! + lineSep_
! + com_
! + " ${TITLE}"
! + lineSep_
! + commentSep_;
! enteteRubrique_=
! lineSep_ + commentSep_ + com_ + " ${RUBRIQUE}" + lineSep_ + commentSep_;
}
! public FileFormatVersion getFileFormatVersion() {
return version_;
}
! public void writeCas(DicoCasInterface _inter) {
! DicoCasInterface interface_= _inter;
! if (interface_ == null) {
! analyze_.addFatalError(DodicoLib.geti18n("Les données sont nulles"));
return;
}
! if (out_ == null) {
! analyze_.addFatalError(DodicoLib.geti18n("Le flux de sortie est nul."));
return;
}
//Hashtable entitesValues = interface_.getInputs();
! Set rest= interface_.getEntiteSet();
! String[] rubriques= version_.getDico().getRubriques();
! try {
! String dd= null;
! DicoEntite entNom= version_.getTitreEntite();
! if (entNom != null) {
! dd= interface_.getValue(entNom);
}
if (dd == null)
! dd= "nom inconnu";
writeEntete(dd);
if (progress_ != null)
progress_.setProgression(10);
! if ((rubriques == null) || (rubriques.length == 0)) {
! DicoEntite[] ents= new DicoEntite[rest.size()];
rest.toArray(ents);
! writeRubrique(DodicoLib.geti18n("Inconnu"), ents, interface_);
rest.clear();
if (progress_ != null)
progress_.setProgression(90);
}
! int n= rubriques.length;
! int m= n / 2;
! for (int i= 0; i < n; i++) {
if (rubriques[i] == null)
System.err.println("rubriques nulles");
! DicoEntite[] entToWrite=
! DicoEntite.getAndRemoveEntite(rubriques[i], rest);
! writeRubrique(rubriques[i], entToWrite, interface_);
! if ((progress_ != null) && (i == m)) {
progress_.setProgression(55);
}
***************
*** 119,126 ****
if (progress_ != null)
progress_.setProgression(95);
! }
! catch (IOException _e)
! {
! DodicoAnalyze.manageException(_e, _analyze);
}
}
--- 112,117 ----
if (progress_ != null)
progress_.setProgression(95);
! } catch (IOException _e) {
! DodicoAnalyze.manageException(_e, analyze_);
}
}
***************
*** 131,143 ****
* @throws IOException
*/
! private void writeEntete(String _nomEtude) throws IOException
! {
! String entete = FuLib.replace(enteteFormat_, "${TITLE}", _nomEtude);
! entete = FuLib.replace(entete, "${VERSION}", version_.getVersionName());
! entete = FuLib.replace(entete, "${DATE}", DateFormat.getDateInstance().format(Calendar.getInstance().getTime()));
! String r = "";
! String com = "" + version_.getCommentChar();
! for (StringTokenizer tk = new StringTokenizer(entete, lineSep_); tk.hasMoreTokens();)
! {
r += formatToMaxChar(tk.nextToken(), com) + lineSep_;
}
--- 122,138 ----
* @throws IOException
*/
! private void writeEntete(String _nomEtude) throws IOException {
! String entete= FuLib.replace(enteteFormat_, "${TITLE}", _nomEtude);
! entete= FuLib.replace(entete, "${VERSION}", version_.getVersionName());
! entete=
! FuLib.replace(
! entete,
! "${DATE}",
! DateFormat.getDateInstance().format(Calendar.getInstance().getTime()));
! String r= "";
! String com= "" + version_.getCommentChar();
! for (StringTokenizer tk= new StringTokenizer(entete, lineSep_);
! tk.hasMoreTokens();
! ) {
r += formatToMaxChar(tk.nextToken(), com) + lineSep_;
}
***************
*** 145,201 ****
}
! private void writeRubrique(String _rubrique, DicoEntite[] _ent, DicoCasInterface inter,DodicoAnalyze.Editor _analyze) throws IOException
! {
! if ((_ent == null) || (_ent.length == 0))
! {
return;
}
! int entiteNomMaxLength = geEntiteNomtMaxLength(_ent) + 1;
! String entete = FuLib.replace(enteteRubrique_, "${RUBRIQUE}", _rubrique);
writeln();
out_.write(entete);
! int n = _ent.length;
DicoEntite ent;
! int maxChar = version_.getMaxCharPerLine();
! for (int i = 0; i < n; i++)
! {
! ent = _ent[i];
! if (!version_.getDico().isKey(ent))
! {
! _analyze.addWarning("Entité inconnue pour ce format" + " " + ent.getNom(), -1);
! }
! else
! {
! String value = inter.getValue(ent);
! if (ent.containsStringDataType())
! {
! value = FuLib.replace(value, "'", "''");
! value = "'" + value + "'";
}
! String initNom = ent.getNom();
! String nom = DodicoLib.adjustSize(entiteNomMaxLength, initNom);
! if (nom.length() + value.length() + 1 > maxChar)
! {
! if (initNom.length() + value.length() + 1 <= maxChar)
! {
writeln(initNom + "=" + value);
! }
! else
! {
! if (initNom.length() + 1 > maxChar)
! {
! System.err.println("Les noms des parametres ne doivent pas dépasser 72 char");
! writeln(version_.getCommentChar() + DodicoLib.geti18n("Ce parametres depasse 72 caractères"));
}
writeln(initNom + "=");
! if (value.length() > maxChar)
! {
! value = formatToMaxChar(value);
}
writeln(value);
}
! }
! else
! {
writeln(nom + "=" + value);
}
--- 140,190 ----
}
! private void writeRubrique(
! String _rubrique,
! DicoEntite[] _ent,
! DicoCasInterface inter)
! throws IOException {
! if ((_ent == null) || (_ent.length == 0)) {
return;
}
! int entiteNomMaxLength= geEntiteNomtMaxLength(_ent) + 1;
! String entete= FuLib.replace(enteteRubrique_, "${RUBRIQUE}", _rubrique);
writeln();
out_.write(entete);
! int n= _ent.length;
DicoEntite ent;
! int maxChar= version_.getMaxCharPerLine();
! for (int i= 0; i < n; i++) {
! ent= _ent[i];
! if (!version_.getDico().isKey(ent)) {
! analyze_.addWarning(
! "Entité inconnue pour ce format" + " " + ent.getNom(),
! -1);
! } else {
! String value= inter.getValue(ent);
! if (ent.containsStringDataType()) {
! value= FuLib.replace(value, "'", "''");
! value= "'" + value + "'";
}
! String initNom= ent.getNom();
! String nom= DodicoLib.adjustSize(entiteNomMaxLength, initNom);
! if (nom.length() + value.length() + 1 > maxChar) {
! if (initNom.length() + value.length() + 1 <= maxChar) {
writeln(initNom + "=" + value);
! } else {
! if (initNom.length() + 1 > maxChar) {
! System.err.println(
! "Les noms des parametres ne doivent pas dépasser 72 char");
! writeln(
! version_.getCommentChar()
! + DodicoLib.geti18n("Ce parametres depasse 72 caractères"));
}
writeln(initNom + "=");
! if (value.length() > maxChar) {
! value= formatToMaxChar(value);
}
writeln(value);
}
! } else {
writeln(nom + "=" + value);
}
***************
*** 209,214 ****
* ligne. Un separateur de ligne ( et pas de prefixe) est ajoute.
*/
! private String formatToMaxChar(String _init)
! {
return formatToMaxChar(_init, "");
}
--- 198,202 ----
* ligne. Un separateur de ligne ( et pas de prefixe) est ajoute.
*/
! private String formatToMaxChar(String _init) {
return formatToMaxChar(_init, "");
}
***************
*** 218,229 ****
* ligne. Un separateur de ligne (et un prefixe optionnel) est ajoute.
*/
! private String formatToMaxChar(String _init, String _pref)
! {
! int maxChar = version_.getMaxCharPerLine() - _pref.length();
! StringBuffer valueFinal = new StringBuffer(_init);
! int vfLength = valueFinal.length();
! int lnLength = lineSep_.length() + _pref.length();
! for (int j = maxChar - 1; j < vfLength; j += (maxChar + lnLength))
! {
valueFinal.insert(j - lnLength, lineSep_ + _pref);
}
--- 206,215 ----
* ligne. Un separateur de ligne (et un prefixe optionnel) est ajoute.
*/
! private String formatToMaxChar(String _init, String _pref) {
! int maxChar= version_.getMaxCharPerLine() - _pref.length();
! StringBuffer valueFinal= new StringBuffer(_init);
! int vfLength= valueFinal.length();
! int lnLength= lineSep_.length() + _pref.length();
! for (int j= maxChar - 1; j < vfLength; j += (maxChar + lnLength)) {
valueFinal.insert(j - lnLength, lineSep_ + _pref);
}
***************
*** 235,250 ****
* Renvoie la taille max des noms des entites.
*/
! private int geEntiteNomtMaxLength(DicoEntite[] _ent)
! {
! int r = 0;
! int n = _ent.length - 1;
! int taille = 0;
! for (int i = n; i >= 0; i--)
! {
! taille = _ent[i].getNom().length();
if (taille > r)
! r = taille;
}
return r;
}
--- 221,258 ----
* Renvoie la taille max des noms des entites.
*/
! private int geEntiteNomtMaxLength(DicoEntite[] _ent) {
! int r= 0;
! int n= _ent.length - 1;
! int taille= 0;
! for (int i= n; i >= 0; i--) {
! taille= _ent[i].getNom().length();
if (taille > r)
! r= taille;
}
return r;
+ }
+
+ /**
+ *
+ */
+ protected void _write(Object _o) {
+ if (_o instanceof DicoCasWriter) {
+ writeCas((DicoCasInterface)_o);
+ } else {
+ _donneesInvalides(_o);
+ }
+
+ }
+
+ protected FileOperationSynthese write(DicoCasInterface _o) {
+ writeCas(_o);
+ return closeOperation(_o);
+ }
+
+ /**
+ *
+ */
+ public FileFormatVersion getVersion() {
+ return version_;
}
Index: DicoGenerator.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoGenerator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DicoGenerator.java 4 Jul 2003 12:08:51 -0000 1.2
--- DicoGenerator.java 22 Aug 2003 15:51:11 -0000 1.3
***************
*** 26,29 ****
--- 26,30 ----
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.fichiers.FileFormat;
import org.fudaa.dodico.fichiers.FileOperationAbstract;
***************
*** 34,38 ****
* @version $Id$
*/
! public class DicoGenerator extends FileOperationAbstract
{
private DicoEntiteGenerate[] chaineEntites_;
--- 35,39 ----
* @version $Id$
*/
! public class DicoGenerator //extends FileOperationAbstract
{
private DicoEntiteGenerate[] chaineEntites_;
***************
*** 41,47 ****
private File dir_;
private DicoEntiteGenerate[] entites_;
- // private String[][] rubriques_;
private HashMap entitesNum_;
- // private DicoEntiteGenerate[][] rubriqueEntites_;
private String lineSep_;
private String methodePrefix = "_";
--- 42,46 ----
***************
*** 53,61 ****
protected final String dataClass_ = "DicoDataType";
private String packageName_;
- private DodicoAnalyze.Editor analyze_;
- //private String className_;
private static final String varEntitesName__ = "entites_";
protected static final String varLanguageIndexName__ = "languageIndex_";
/**
--- 52,65 ----
protected final String dataClass_ = "DicoDataType";
private String packageName_;
private static final String varEntitesName__ = "entites_";
protected static final String varLanguageIndexName__ = "languageIndex_";
+ protected ProgressionInterface progress_;
+ private DodicoAnalyze.Editor analyze_;
+
+ public void setProgressReceiver(ProgressionInterface _progressReceiver) {
+ progress_= _progressReceiver;
+ }
+
/**
***************
*** 516,525 ****
}
! public void write(FileOperationSynthese _op)
{
analyze_ = new DodicoAnalyze.Editor();
writeDico();
! _op.initAndClose(_op, analyze_, this, "génération fichier dico");
!
}
--- 520,534 ----
}
! public DodicoAnalyze write()
{
analyze_ = new DodicoAnalyze.Editor();
+ analyze_.setDesc(DodicoLib.geti18n("génération fichier dico"));
writeDico();
! try {
! dicoOut_.close();
! } catch (IOException e) {
! e.printStackTrace();
! }
! return analyze_.toAnalyze();
}
***************
*** 678,684 ****
g.setTelemacDicoAnalyzer(anal);
g.setDirOut(_dirOut);
! FileOperationSynthese op = new FileOperationSynthese();
! g.write(op);
! r[1] = op.getAnalyze();
return r;
}
--- 687,692 ----
g.setTelemacDicoAnalyzer(anal);
g.setDirOut(_dirOut);
!
! r[1] = g.write();
return r;
}
Index: DicoParams.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoParams.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DicoParams.java 18 Aug 2003 11:05:19 -0000 1.2
--- DicoParams.java 22 Aug 2003 15:51:11 -0000 1.3
***************
*** 41,45 ****
ft_= _dico;
casFileEntite_= ft_.getFichierPrincipalEntite();
! if (contains(casFileEntite_)) {
removeValue(casFileEntite_);
}
--- 41,45 ----
ft_= _dico;
casFileEntite_= ft_.getFichierPrincipalEntite();
! if ( (casFileEntite_!=null) && (contains(casFileEntite_)) ){
removeValue(casFileEntite_);
}
|
|
From: <de...@us...> - 2003-08-22 21:49:15
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/h2d/reflux
Added Files:
H2dRefluxBordIndexGeneral.java H2dRefluxBordManager.java
H2dRefluxConditionLimite.java
H2dRefluxConditionLimiteMutable.java H2dRefluxDicoModel.java
H2dRefluxParametres.java H2dRefluxParametresCalcul.java
H2dRefluxSourceInterface.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
--- NEW FILE: H2dRefluxBordIndexGeneral.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: H2dRefluxBordManager.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: H2dRefluxConditionLimite.java ---
/*
* @file H2dConditionLimiteReflux.java
* @creation 25 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.reflux;
import org.fudaa.dodico.h2d.H2dConditionLimite;
import org.fudaa.dodico.h2d.H2dEvolution;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id: H2dRefluxConditionLimite.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dRefluxConditionLimite extends H2dConditionLimite {
double normale_;
H2dClType qType_;
H2dEvolution uTransitoireCourbe_;
H2dEvolution vTransitoireCourbe_;
H2dEvolution hTransitoireCourbe_;
H2dEvolution qTransitoireCourbe_;
double q_;
double rugosite_;
H2dClType rugositeType_;
H2dEvolution rugositeTransitoireCourbe_;
/**
*
*/
public H2dRefluxConditionLimite() {
super();
uType_= H2dClType.LIBRE;
vType_= H2dClType.LIBRE;
hType_= H2dClType.LIBRE;
qType_= H2dClType.LIBRE;
}
/**
*
*/
public double getNormale() {
return normale_;
}
/**
*
*/
public double getQ() {
return q_;
}
/**
*
*/
public H2dClType getQType() {
return qType_;
}
/**
*
*/
public H2dEvolution getHTransitoireCourbe() {
return hTransitoireCourbe_;
}
/**
*
*/
public H2dEvolution getUTransitoireCourbe() {
return uTransitoireCourbe_;
}
/**
*
*/
public H2dEvolution getVTransitoireCourbe() {
return vTransitoireCourbe_;
}
/**
*
*/
public H2dEvolution getQTransitoireCourbe() {
return qTransitoireCourbe_;
}
/**
* 1/Strickler
*/
public double getRugosite() {
return rugosite_;
}
/**
*
*/
public H2dEvolution getRugositeTransitoireCourbe() {
return rugositeTransitoireCourbe_;
}
/**
*
*/
public H2dClType getRugositeType() {
return rugositeType_;
}
}
--- NEW FILE: H2dRefluxConditionLimiteMutable.java ---
/*
* @file H2dConditionLimiteRefluxMutable.java
* @creation 26 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.reflux;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.h2d.H2dEvolution;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id: H2dRefluxConditionLimiteMutable.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dRefluxConditionLimiteMutable extends H2dRefluxConditionLimite
{
/**
*
*/
public H2dRefluxConditionLimiteMutable()
{
}
/**
*
*/
public void setNormale(double _d)
{
normale_ = DodicoLib.getAngle(_d);
}
/**
*
*/
public void setQ(double _d)
{
q_ = _d;
}
/**
*
*/
public void setQTransitoireCourbe(H2dEvolution _evolution)
{
qTransitoireCourbe_ = _evolution;
}
/**
*
*/
public void setQType(H2dClType _type)
{
qType_ = _type;
}
/**
*
*/
public void setH(double _d)
{
h_ = _d;
}
/**
*
*/
public void setHType(H2dClType _type)
{
hType_ = _type;
}
/**
*
*/
public void setIndexPt(int _i)
{
indexPt_ = _i;
}
/**
*
*/
public void setU(double _d)
{
u_ = _d;
}
/**
*
*/
public void setUType(H2dClType _type)
{
uType_ = _type;
}
/**
*
*/
public void setV(double _d)
{
v_ = _d;
}
/**
*
*/
public void setVType(H2dClType _type)
{
vType_ = _type;
}
/**
*
*/
public void setHTransitoireCourbe(H2dEvolution _reflux)
{
hTransitoireCourbe_ = _reflux;
}
/**
*
*/
public void setUTransitoireCourbe(H2dEvolution _reflux)
{
uTransitoireCourbe_ = _reflux;
}
/**
*
*/
public void setVTransitoireCourbe(H2dEvolution _reflux)
{
vTransitoireCourbe_ = _reflux;
}
/**
*
*/
public void setRugosite(double _d)
{
rugosite_ = _d;
}
/**
*
*/
public void setRugositeTransitoireCourbe(H2dEvolution _evolution)
{
rugositeTransitoireCourbe_ = _evolution;
}
/**
*
*/
public void setRugositeType(H2dClType _type)
{
rugositeType_ = _type;
}
}
--- NEW FILE: H2dRefluxDicoModel.java ---
/*
* @file H2dRefluxEntiteList.java
* @creation 27 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.reflux;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.fudaa.dodico.dico.DicoComponentVisitor;
import org.fudaa.dodico.dico.DicoDataType;
import org.fudaa.dodico.dico.DicoDataTypeGenerate;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.dico.DicoEntiteGenerate;
import org.fudaa.dodico.dico.DicoEntiteList;
import org.fudaa.dodico.dico.DicoGenerator;
import org.fudaa.dodico.dico.DicoLanguage;
import org.fudaa.dodico.dico.DicoModelAbstract;
/**
* @author deniger
* @version $Id: H2dRefluxDicoModel.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dRefluxDicoModel extends DicoModelAbstract
{
/**
*
*/
public H2dRefluxDicoModel()
{
super();
}
public H2dRefluxDicoModel(int _languageId)
{
super(_languageId);
}
public DicoEntite[] createEntites()
{
DicoEntite[] r = new DicoEntite[18];
int index = 0;
DicoDataType.Reel type = new DicoDataType.Reel();
type.setControle(0, 1);
String[] t = new String[2];
t[0] = t[1] = "Convection";
DicoEntite.Simple ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setNiveau(0);
ent.setIndex(index);
t[0] = t[1] = "1.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Diffusion";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "1.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Continuité linéaire";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "1.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Continuité non linéaire";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "1.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Gravitation";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "1.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Frottement";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "1.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Coriolis";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "0.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Contraintes de radiation";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "0.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
type = new DicoDataType.Reel();
type.setControle(0, 1);
t[0] = t[1] = "Forces du vent";
ent = new DicoEntite.Simple(t[languageIndex_], type);
ent.setIndex(index);
ent.setNiveau(0);
t[0] = t[1] = "0.0";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Coefficients contribution";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
int imprIndex = 0;
DicoDataType.Binaire typeBinaire = DicoDataType.Binaire.EMPTY;
t[0] = t[1] = "DONNEES";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "POINTEURS";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "TABLESELEM";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "TABLESGLOB";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "CIEL";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "INITIALISATION";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "MISE_A_JOUR";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "RESOLUTION";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
t[0] = t[1] = "ITERATION";
ent = new DicoEntite.Simple(t[languageIndex_], typeBinaire);
ent.setNiveau(0);
ent.setIndex(imprIndex++);
t[0] = t[1] = "false";
ent.setDefautValue(t[languageIndex_]);
t[0] = t[1] = "Impression";
ent.setRubrique(t[languageIndex_]);
r[index++] = ent.getImmutable();
return r;
}
/**
*
*/
protected String[] createNoms()
{
System.err.println("non implante");
return null;
}
/**
*
*/
public String getCodeName()
{
return "reflux";
}
/**
*
*/
public String getVersion()
{
return "5.0";
}
}
--- NEW FILE: H2dRefluxParametres.java ---
/*
* @file H2dParametresReflux.java
* @creation 26 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.reflux;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoParams;
import org.fudaa.dodico.h2d.H2dBordMutable;
import org.fudaa.dodico.h2d.H2dConditionLimite;
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.H2dParametres;
import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.reflux.io.INPInterface;
/**
* @author deniger
* @version $Id: H2dRefluxParametres.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dRefluxParametres extends H2dParametres {
H2dRefluxConditionLimite[] cls_;
DicoParams dicoParams_;
H2dRefluxBordManager bords_;
/**
*
*/
private H2dRefluxParametres(H2dMaillage maillage_) {
super(maillage_);
}
public DicoParams getDicoParams() {
return dicoParams_;
}
public H2dRefluxConditionLimite getRefluxCL(int _bordIdx) {
return cls_[_bordIdx];
}
public static H2dRefluxParametres init(
INPInterface _inter,
ProgressionInterface _prog,
INPFileFormat.INPVersion _ft,
DodicoAnalyze.Editor _analyze) {
if (_prog != null) {
_prog.setDesc("Analyse données");
_prog.setProgression(0);
}
H2dRefluxParametres r= new H2dRefluxParametres(_inter.getMaillage());
r.dicoParams_= new DicoParams(_inter.getEntiteValue(), _ft);
H2dRefluxConditionLimite[] initCl= _inter.getConditionLimite();
if (_prog != null) {
_prog.setProgression(20);
}
Arrays.sort(initCl, new H2dConditionLimite.ComparatorIdxPt());
int[] ptFrontiereIdx= r.maillage_.getPtsFrontiere().getArray();
if (ptFrontiereIdx.length != initCl.length) {
_analyze.addError(
DodicoLib.geti18n("Des conditions limites ne sont" + "pas spécifiées"));
}
r.cls_= new H2dRefluxConditionLimite[ptFrontiereIdx.length];
int n= ptFrontiereIdx.length - 1;
int idxPt;
for (int i= n; i >= 0; i--) {
idxPt= ptFrontiereIdx[i];
H2dRefluxConditionLimite cl=
(H2dRefluxConditionLimite)H2dConditionLimite.getCLFast(idxPt, initCl);
if (cl == null) {
if (_analyze != null)
_analyze.addError("Pas de cl pour le point de bord " + i);
H2dRefluxConditionLimiteMutable clN=
new H2dRefluxConditionLimiteMutable();
clN.setIndexPt(idxPt);
r.cls_[i]= clN;
} else {
r.cls_[i]= cl;
}
}
if (_prog != null) {
_prog.setProgression(60);
}
r.bords_=
H2dRefluxBordManager.init(
r.maillage_.getPtsFrontiere(),
_inter.getBords(),
_analyze);
if (_prog != null) {
_prog.setProgression(100);
}
System.out.println("FIN ANALYZE donnees");
return r;
}
/**
*
*/
public H2dRefluxBordManager getBords() {
return bords_;
}
}
--- NEW FILE: H2dRefluxParametresCalcul.java ---
/*
* @file H2dParametresCalculReflux.java
* @creation 26 juin 2003
* @modification $Date: 2003/08/22 15:51:12 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.reflux;
/**
* @author deniger
* @version $Id: H2dRefluxParametresCalcul.java,v 1.1 2003/08/22 15:51:12 deniger Exp $
*/
public class H2dRefluxParametresCalcul
{
// HashMap impressionValeur_;
//
// public H2dParametresCalculReflux()
// {
// impression_=new HashSet(H2dRefluxImpressionType.LIST.size());
// }
//
// public void addImpression(H2dRefluxImpressionType _s)
// {
// impression_.add(_s);
// }
//
// public void addImpression(String _refluxId)
// {
// H2dRefluxImpressionType type=H2dRefluxImpressionType.getTypeForRefluxId(_refluxId);
// if(type!=null) impression_.add(type);
// }
//
// public int getImpressionNb()
// {
// return impression_.size();
// }
//
// public H2dRefluxImpressionType[] getImpression()
// {
// H2dRefluxImpressionType[] r=new H2dRefluxImpressionType[impression_.size()];
// impression_.toArray(r);
// return r;
// }
//
// public boolean contains(H2dRefluxImpressionType _t)
// {
// return impression_.contains(_t);
// }
}
--- NEW FILE: H2dRefluxSourceInterface.java ---
(This appears to be a binary file; contents omitted.)
|
|
From: <de...@us...> - 2003-08-22 21:49:13
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/telemac
Modified Files:
TelemacDicoManager.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
Index: TelemacDicoManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TelemacDicoManager.java 19 Aug 2003 07:44:22 -0000 1.7
--- TelemacDicoManager.java 22 Aug 2003 15:51:12 -0000 1.8
***************
*** 66,70 ****
--- 66,72 ----
int _language) {
String name= Telemac2dFileFormat.getInstance().getName();
+
String lastVersion= "v5p3";
+
if ((lastVersion.equals(_v))
&& (DicoLanguage.getCurrentID() == _language)) {
***************
*** 72,78 ****
System.out.println("recupere instance telemac 2d");
if (telemac2dv5p3_ == null)
! telemac2dv5p3_=
! _ft.createVersion(createDico(name, lastVersion, _language));
! super.createVersionImpl(getFileFormat(name), lastVersion, _language);
return telemac2dv5p3_;
}
--- 74,78 ----
System.out.println("recupere instance telemac 2d");
if (telemac2dv5p3_ == null)
! telemac2dv5p3_= _ft.createVersion(createDico(name, _v, _language));
return telemac2dv5p3_;
}
***************
*** 84,92 ****
String _v,
int _language) {
! if (Telemac2dFileFormat.getInstance().getName().equals(_ft.getName()))
! return (DicoCasFileFormatVersion)createVersionImpl(
! (Telemac2dFileFormat)_ft,
! _v,
! _language);
return super.createVersionImpl(_ft, _v, _language);
--- 84,89 ----
String _v,
int _language) {
! if (Telemac2dFileFormat.getInstance() == _ft)
! return createVersionImpl((Telemac2dFileFormat)_ft, _v, _language);
return super.createVersionImpl(_ft, _v, _language);
|