Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/test/telemac
Modified Files:
SerafinArchConvertGUI.java TestCL.java TestCas.java
TestLiquide.java TestSerafin.java TestSerafinArchConvert.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: SerafinArchConvertGUI.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/SerafinArchConvertGUI.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SerafinArchConvertGUI.java 18 Aug 2003 11:05:20 -0000 1.3
--- SerafinArchConvertGUI.java 22 Aug 2003 15:51:13 -0000 1.4
***************
*** 53,58 ****
* @version $Id$
*/
! public class SerafinArchConvertGUI extends BuPanel implements ActionListener
! {
BuButton btConvert_;
BuLabel lbIn_;
--- 53,57 ----
* @version $Id$
*/
! public class SerafinArchConvertGUI extends BuPanel implements ActionListener {
BuButton btConvert_;
BuLabel lbIn_;
***************
*** 70,91 ****
ProgressionBuAdapter progression_;
! public SerafinArchConvertGUI(JFrame _f)
! {
super();
! f_ = _f;
build();
! defaultHome_ = new File(System.getProperty("user.home"));
! progression_ = new ProgressionBuAdapter();
}
! private final void build()
! {
setLayout(new BuBorderLayout());
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
! BuPanel bts = new BuPanel();
bts.setLayout(new BuBorderLayout());
! btConvert_ = new BuButton("convertir");
btConvert_.setActionCommand("CONVERT");
btConvert_.addActionListener(this);
--- 69,88 ----
ProgressionBuAdapter progression_;
! public SerafinArchConvertGUI(JFrame _f) {
super();
! f_= _f;
build();
! defaultHome_= new File(System.getProperty("user.home"));
! progression_= new ProgressionBuAdapter();
}
! private final void build() {
setLayout(new BuBorderLayout());
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
! BuPanel bts= new BuPanel();
bts.setLayout(new BuBorderLayout());
! btConvert_= new BuButton("convertir");
btConvert_.setActionCommand("CONVERT");
btConvert_.addActionListener(this);
***************
*** 93,130 ****
btConvert_.setToolTipText("Convertir");
bts.add(btConvert_, BuBorderLayout.EAST);
! bar_ = new BuTaskView();
bar_.setEmptyText("");
bar_.setVisible(true);
bar_.setBackground(Color.white);
bar_.setOpaque(true);
! BuScrollPane sp = new BuScrollPane(bar_);
sp.setPreferredSize(new Dimension(150, 80));
bts.add(sp, BuBorderLayout.WEST);
! BuPanel center = new BuPanel();
center.setLayout(new BuVerticalLayout(5, true, true));
! BuPanel in = new BuPanel();
in.setLayout(new BuGridLayout(2, 0, 0));
! BuButton chooseIn = new BuButton("...");
chooseIn.setActionCommand("CHOOSE_IN");
chooseIn.addActionListener(this);
in.add(chooseIn);
! lbIn_ = new BuLabel();
//lbIn_.setEditable(false);
lbIn_.setBackground(Color.white);
lbIn_.setAutoscrolls(true);
! BuScrollPane sclIn=new BuScrollPane(lbIn_);
sclIn.setAutoscrolls(true);
! sclIn.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
sclIn.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
in.add(sclIn);
in.add(new BuLabel("Format entrée: "));
! lbInFormat_ = new BuLabel("");
in.add(lbInFormat_);
in.add(new BuLabel("Nom : "));
! lbInName_ = new BuTextField(20);
lbInName_.setEditable(false);
lbInName_.setAutoscrolls(true);
! BuScrollPane sc = new BuScrollPane(lbInName_);
sc.setAutoscrolls(true);
in.add(sc);
--- 90,128 ----
btConvert_.setToolTipText("Convertir");
bts.add(btConvert_, BuBorderLayout.EAST);
! bar_= new BuTaskView();
bar_.setEmptyText("");
bar_.setVisible(true);
bar_.setBackground(Color.white);
bar_.setOpaque(true);
! BuScrollPane sp= new BuScrollPane(bar_);
sp.setPreferredSize(new Dimension(150, 80));
bts.add(sp, BuBorderLayout.WEST);
! BuPanel center= new BuPanel();
center.setLayout(new BuVerticalLayout(5, true, true));
! BuPanel in= new BuPanel();
in.setLayout(new BuGridLayout(2, 0, 0));
! BuButton chooseIn= new BuButton("...");
chooseIn.setActionCommand("CHOOSE_IN");
chooseIn.addActionListener(this);
in.add(chooseIn);
! lbIn_= new BuLabel();
//lbIn_.setEditable(false);
lbIn_.setBackground(Color.white);
lbIn_.setAutoscrolls(true);
! BuScrollPane sclIn= new BuScrollPane(lbIn_);
sclIn.setAutoscrolls(true);
! sclIn.setHorizontalScrollBarPolicy(
! JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
sclIn.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
in.add(sclIn);
in.add(new BuLabel("Format entrée: "));
! lbInFormat_= new BuLabel("");
in.add(lbInFormat_);
in.add(new BuLabel("Nom : "));
! lbInName_= new BuTextField(20);
lbInName_.setEditable(false);
lbInName_.setAutoscrolls(true);
! BuScrollPane sc= new BuScrollPane(lbInName_);
sc.setAutoscrolls(true);
in.add(sc);
***************
*** 132,144 ****
center.add(in);
! BuPanel out = new BuPanel();
out.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
out.setLayout(new BuGridLayout(2, 5, 5));
! btChooseOut_ = new BuButton("...");
btChooseOut_.setEnabled(false);
btChooseOut_.setActionCommand("CHOOSE_OUT");
btChooseOut_.addActionListener(this);
out.add(btChooseOut_);
! lbOut_ = new BuTextField(10);
lbOut_.setEditable(false);
lbOut_.setBackground(Color.white);
--- 130,142 ----
center.add(in);
! BuPanel out= new BuPanel();
out.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
out.setLayout(new BuGridLayout(2, 5, 5));
! btChooseOut_= new BuButton("...");
btChooseOut_.setEnabled(false);
btChooseOut_.setActionCommand("CHOOSE_OUT");
btChooseOut_.addActionListener(this);
out.add(btChooseOut_);
! lbOut_= new BuTextField(10);
lbOut_.setEditable(false);
lbOut_.setBackground(Color.white);
***************
*** 146,150 ****
out.add(new BuScrollPane(lbOut_));
out.add(new BuLabel("Format sortie: "));
! lbOutFormat_ = new BuLabel("");
out.add(lbOutFormat_);
center.add(out);
--- 144,148 ----
out.add(new BuScrollPane(lbOut_));
out.add(new BuLabel("Format sortie: "));
! lbOutFormat_= new BuLabel("");
out.add(lbOutFormat_);
center.add(out);
***************
*** 153,200 ****
}
! public void actionPerformed(ActionEvent _ae)
! {
! String com = _ae.getActionCommand();
! if ("CHOOSE_IN".equals(com))
! {
! BuFileChooser f = new BuFileChooser();
// f.setFileFilter(new BuFileFilter("*", "Serafin"));
f.setDialogType(BuFileChooser.OPEN_DIALOG);
f.setCurrentDirectory(defaultHome_);
f.setFileSelectionMode(BuFileChooser.FILES_ONLY);
! int i = f.showOpenDialog(this);
! if (i == BuFileChooser.APPROVE_OPTION)
! {
fileIn(f.getSelectedFile());
}
! }
! else if ("CHOOSE_OUT".equals(com))
! {
! BuFileChooser f = new BuFileChooser();
f.setDialogType(BuFileChooser.SAVE_DIALOG);
f.setCurrentDirectory(defaultHome_);
! int i = f.showOpenDialog(this);
! if (i == BuFileChooser.APPROVE_OPTION)
! {
fileOut(f.getSelectedFile());
}
! }
! else if ("CONVERT".equals(com))
! {
System.out.println("convert");
! if (si_ == null)
! {
new BuDialogError(null, null, "Fichier d'entree null").activate();
return;
}
! if (fileOut_ == null)
! {
new BuDialogError(null, null, "Fichier de sortie null").activate();
return;
}
! if (fileOut_.exists())
! {
! BuDialogConfirmation dia =
new BuDialogConfirmation(
null,
--- 151,187 ----
}
! public void actionPerformed(ActionEvent _ae) {
! String com= _ae.getActionCommand();
! if ("CHOOSE_IN".equals(com)) {
! BuFileChooser f= new BuFileChooser();
// f.setFileFilter(new BuFileFilter("*", "Serafin"));
f.setDialogType(BuFileChooser.OPEN_DIALOG);
f.setCurrentDirectory(defaultHome_);
f.setFileSelectionMode(BuFileChooser.FILES_ONLY);
! int i= f.showOpenDialog(this);
! if (i == BuFileChooser.APPROVE_OPTION) {
fileIn(f.getSelectedFile());
}
! } else if ("CHOOSE_OUT".equals(com)) {
! BuFileChooser f= new BuFileChooser();
f.setDialogType(BuFileChooser.SAVE_DIALOG);
f.setCurrentDirectory(defaultHome_);
! int i= f.showOpenDialog(this);
! if (i == BuFileChooser.APPROVE_OPTION) {
fileOut(f.getSelectedFile());
}
! } else if ("CONVERT".equals(com)) {
System.out.println("convert");
! if (si_ == null) {
new BuDialogError(null, null, "Fichier d'entree null").activate();
return;
}
! if (fileOut_ == null) {
new BuDialogError(null, null, "Fichier de sortie null").activate();
return;
}
! if (fileOut_.exists()) {
! BuDialogConfirmation dia=
new BuDialogConfirmation(
null,
***************
*** 203,207 ****
+ fileOut_.getAbsolutePath()
+ " existe. Voulez-vous l'effacer ?");
! int resp = dia.activate();
if (resp != JOptionPane.YES_OPTION)
return;
--- 190,194 ----
+ fileOut_.getAbsolutePath()
+ " existe. Voulez-vous l'effacer ?");
! int resp= dia.activate();
if (resp != JOptionPane.YES_OPTION)
return;
***************
*** 212,256 ****
}
! private void convert()
! {
! final OutputStream out;
! try
! {
! out = new FileOutputStream(fileOut_);
! }
! catch (Exception e)
! {
! new BuDialogError(null, null, "écriture impossible").activate();
! return;
! }
! BuTask t = new BuTask("ecriture")
! {
! public void run()
! {
! try
! {
! SerafinWriter w = new SerafinWriter(SerafinFileFormat.getInstance().getLastVersionImpl());
if (isInSparc_)
w.setMachineID(FortranBinaryInputStream.X86);
else
w.setMachineID(FortranBinaryInputStream.SPARC);
! w.setOut(out);
w.setProgressReceiver(progression_);
! FileOperationSynthese op=new FileOperationSynthese();
! w.write(si_,op);
! DodicoAnalyze a=op.getAnalyze();
! if (a != null)
! {
! new BuDialogMessage(null, null,a.getResume());
}
! }
! catch (Exception e)
! {
new BuDialogError(null, null, e.toString()).show();
! }
! finally
! {
super.run();
}
--- 199,227 ----
}
! private void convert() {
! BuTask t= new BuTask("ecriture") {
! public void run() {
! try {
! SerafinWriter w=
! SerafinFileFormat
! .getInstance()
! .getLastVersionImpl()
! .createSerafinWriter();
if (isInSparc_)
w.setMachineID(FortranBinaryInputStream.X86);
else
w.setMachineID(FortranBinaryInputStream.SPARC);
! w.setFile(fileOut_);
w.setProgressReceiver(progression_);
!
! DodicoAnalyze a= w.write(si_).getAnalyze().toAnalyze();
! if (a != null) {
! new BuDialogMessage(null, null, a.getResume());
}
! } catch (Exception e) {
new BuDialogError(null, null, e.toString()).show();
! } finally {
super.run();
}
***************
*** 270,317 ****
}
! void fileOut(File _fOut)
! {
! fileOut_ = _fOut;
lbOut_.setText(fileOut_.getAbsolutePath());
}
! private void fileIn(File _f)
! {
! final File file = _f;
! lbIn_.setText(file.getAbsolutePath());
! try
! {
! final SerafinReader reader = new SerafinReader(SerafinFileFormat.getInstance().getLastVersionImpl());
! reader.setFile(new FileInputStream(_f));
! reader.setProgressReceiver(progression_);
! final File parent = file.getParentFile();
if (parent != null)
! defaultHome_ = parent;
! BuTask t = new BuTask("lecture")
! {
! public void run()
! {
! try
! {
! si_ = reader.read(new FileOperationSynthese());
! isInSparc_ =
! FortranBinaryInputStream.isSparc(reader.getMachineId());
! if (isInSparc_)
! {
lbInFormat_.setText(FortranBinaryInputStream.SPARC_NAME);
lbOutFormat_.setText(FortranBinaryInputStream.X86_NAME);
! }
! else
! {
lbInFormat_.setText(FortranBinaryInputStream.X86_NAME);
lbOutFormat_.setText(FortranBinaryInputStream.SPARC_NAME);
}
lbInName_.setText(si_.getTitre());
! String dir = parent.getAbsolutePath();
! String fic = file.getName();
! int indexPoint = fic.lastIndexOf('.');
fileOut(
new File(
--- 241,282 ----
}
! void fileOut(File _fOut) {
! fileOut_= _fOut;
lbOut_.setText(fileOut_.getAbsolutePath());
}
! private void fileIn(final File _f) {
! lbIn_.setText(_f.getAbsolutePath());
! try {
! final File parent= _f.getParentFile();
if (parent != null)
! defaultHome_= parent;
! BuTask t= new BuTask("lecture") {
! public void run() {
! try {
! SerafinReader reader=
! new SerafinReader(
! SerafinFileFormat.getInstance().getLastVersionImpl());
! reader.setFile(_f);
! reader.setProgressReceiver(progression_);
! FileOperationSynthese s=reader.read();
! if(s.containsMessages()) s.getAnalyze().toAnalyze().printResume();
!
! si_= (SerafinInterface)s.getSource();
! isInSparc_= FortranBinaryInputStream.isSparc(reader.getMachineId());
! if (isInSparc_) {
lbInFormat_.setText(FortranBinaryInputStream.SPARC_NAME);
lbOutFormat_.setText(FortranBinaryInputStream.X86_NAME);
! } else {
lbInFormat_.setText(FortranBinaryInputStream.X86_NAME);
lbOutFormat_.setText(FortranBinaryInputStream.SPARC_NAME);
}
lbInName_.setText(si_.getTitre());
! String dir= parent.getAbsolutePath();
! String fic= _f.getName();
! int indexPoint= fic.lastIndexOf('.');
fileOut(
new File(
***************
*** 325,331 ****
btChooseOut_.setEnabled(true);
btConvert_.setEnabled(true);
! }
! catch (Exception e)
! {
e.printStackTrace();
new BuDialogError(null, null, e.toString()).activate();
--- 290,294 ----
btChooseOut_.setEnabled(true);
btConvert_.setEnabled(true);
! } catch (Exception e) {
e.printStackTrace();
new BuDialogError(null, null, e.toString()).activate();
***************
*** 337,346 ****
t.setTaskView(bar_);
t.start();
! // f_.pack();
// t.join();
! }
! catch (Exception e)
! {
new BuDialogError(null, null, e.toString()).activate();
}
--- 300,307 ----
t.setTaskView(bar_);
t.start();
! // f_.pack();
// t.join();
! } catch (Exception e) {
new BuDialogError(null, null, e.toString()).activate();
}
***************
*** 348,354 ****
}
! public static void main(String[] args)
! {
! JFrame f = new JFrame(DodicoLib.geti18n("Convertisseur Serafin"));
f.setContentPane(new SerafinArchConvertGUI(f));
f.pack();
--- 309,314 ----
}
! public static void main(String[] args) {
! JFrame f= new JFrame(DodicoLib.geti18n("Convertisseur Serafin"));
f.setContentPane(new SerafinArchConvertGUI(f));
f.pack();
Index: TestCL.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestCL.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TestCL.java 18 Aug 2003 11:05:20 -0000 1.6
--- TestCL.java 22 Aug 2003 15:51:13 -0000 1.7
***************
*** 11,15 ****
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dConditionLimiteTelemac;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
--- 11,15 ----
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
***************
*** 38,42 ****
{
assertNotNull(_inter);
! H2dConditionLimiteTelemac cls = _inter.getLine(0);
assertEquals(cls.getBordType(), H2dBordType.LIQUIDE_ONDE_INCIDENCE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
--- 38,42 ----
{
assertNotNull(_inter);
! H2dTelemacConditionLimite cls = _inter.getLine(0);
assertEquals(cls.getBordType(), H2dBordType.LIQUIDE_ONDE_INCIDENCE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
***************
*** 207,212 ****
TelemacCLInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=TelemacCLFileFormat.getInstance().getLastVersionImpl().write(tmpFile, inter, null);
! assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
--- 207,212 ----
TelemacCLInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=TelemacCLFileFormat.getInstance().getLastVersionImpl().writeMaillage(tmpFile, inter, null);
! assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
***************
*** 215,221 ****
public TelemacCLInterface getInter(File _f)
{
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! TelemacCLInterface r=TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, syntheseR, null);
! assertNull(syntheseR.getAnalyze());
return r;
}
--- 215,221 ----
public TelemacCLInterface getInter(File _f)
{
! FileOperationSynthese syntheseR= TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, null);
! TelemacCLInterface r=(TelemacCLInterface)syntheseR.getSource();
! assertFalse(syntheseR.containsMessages());
return r;
}
Index: TestCas.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestCas.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestCas.java 18 Aug 2003 11:05:20 -0000 1.3
--- TestCas.java 22 Aug 2003 15:51:13 -0000 1.4
***************
*** 64,69 ****
DicoCasInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=Telemac2dFileFormat.getInstance().getLastVersionImpl().writeCas(tmpFile, inter, null);
! assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
--- 64,69 ----
DicoCasInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=Telemac2dFileFormat.getInstance().getLastVersionImpl().writeMaillage(tmpFile, inter,null);
! assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
***************
*** 72,78 ****
public DicoCasInterface getInter(File _f)
{
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! DicoCasInterface r=Telemac2dFileFormat.getInstance().getLastVersionImpl().readCas(_f, syntheseR, null);
! assertNull(syntheseR.getAnalyze());
return r;
}
--- 72,78 ----
public DicoCasInterface getInter(File _f)
{
! FileOperationSynthese syntheseR= Telemac2dFileFormat.getInstance().getLastVersionImpl().read(_f, null);
! DicoCasInterface r=(DicoCasInterface)syntheseR.getSource();
! assertFalse(syntheseR.containsMessages());
return r;
}
Index: TestLiquide.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestLiquide.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TestLiquide.java 18 Aug 2003 11:05:20 -0000 1.5
--- TestLiquide.java 22 Aug 2003 15:51:13 -0000 1.6
***************
*** 76,81 ****
TelemacLiquideInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=TelemacLiquideFileFormat.getInstance().getLastVersionImpl().write(tmpFile, inter, null);
! assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
--- 76,81 ----
TelemacLiquideInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=TelemacLiquideFileFormat.getInstance().getLastVersionImpl().writeMaillage(tmpFile, inter, null);
! assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
***************
*** 84,90 ****
public TelemacLiquideInterface getInter(File _f)
{
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! TelemacLiquideInterface r=TelemacLiquideFileFormat.getInstance().getLastVersionImpl().read(_f, syntheseR, null);
! assertNull(syntheseR.getAnalyze());
return r;
}
--- 84,90 ----
public TelemacLiquideInterface getInter(File _f)
{
! FileOperationSynthese syntheseR= TelemacLiquideFileFormat.getInstance().getLastVersionImpl().read(_f, null);
! TelemacLiquideInterface r=(TelemacLiquideInterface)syntheseR.getSource();
! assertFalse(syntheseR.containsMessages());
return r;
}
Index: TestSerafin.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestSerafin.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TestSerafin.java 18 Aug 2003 11:05:20 -0000 1.10
--- TestSerafin.java 22 Aug 2003 15:51:13 -0000 1.11
***************
*** 19,23 ****
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dMaillage;
! import org.fudaa.dodico.h2d.H2dMaillageBord;
import org.fudaa.dodico.mnt.MNTSemis;
import org.fudaa.dodico.mnt.MNTZone;
--- 19,24 ----
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dMaillage;
! import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
! import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.dodico.mnt.MNTSemis;
import org.fudaa.dodico.mnt.MNTZone;
***************
*** 69,73 ****
assertEquals(maillage.getPtsNb(), 1676);
//NPPEL1
! assertEquals(maillage.getEltType(), H2dElement.T3);
//IKLE1
assertEquals(maillage.getElement(0).getPtIndex()[1], 1545);
--- 70,74 ----
assertEquals(maillage.getPtsNb(), 1676);
//NPPEL1
! assertEquals(maillage.getEltType(), H2dElementType.T3);
//IKLE1
assertEquals(maillage.getElement(0).getPtIndex()[1], 1545);
***************
*** 150,159 ****
SerafinInterface inter= inter_;
File tmpFile= createTempFile();
! SerafinWriter w= SerafinFileFormat.getInstance().getLastVersionImpl().createSerafinWriter();
w.setMachineSPARC();
! FileOperationSynthese syntheseR= FileFormatVersion.initOperation(w, null, tmpFile);
! w.write(inter, syntheseR);
! if (syntheseR.getAnalyze() != null)
! assertFalse(syntheseR.getAnalyze().containsErrors());
_interfaceTest(getInter(tmpFile));
--- 151,163 ----
SerafinInterface inter= inter_;
File tmpFile= createTempFile();
! SerafinWriter w=
! SerafinFileFormat
! .getInstance()
! .getLastVersionImpl()
! .createSerafinWriter();
w.setMachineSPARC();
! w.setFile(tmpFile);
! FileOperationSynthese syntheseR= w.write(inter);
! assertFalse(syntheseR.getAnalyze().containsErrors());
_interfaceTest(getInter(tmpFile));
***************
*** 161,169 ****
public SerafinInterface getInter(File _f) {
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! SerafinInterface r=
! SerafinFileFormat.getInstance().getLastVersionImpl().read(_f, syntheseR, null);
! if (syntheseR.getAnalyze() != null)
! assertFalse(syntheseR.getAnalyze().containsErrors());
return r;
}
--- 165,172 ----
public SerafinInterface getInter(File _f) {
! FileOperationSynthese syntheseR=
! SerafinFileFormat.getInstance().getLastVersionImpl().read(_f, null);
! SerafinInterface r= (SerafinInterface)syntheseR.getSource();
! assertFalse(syntheseR.getAnalyze().containsErrors());
return r;
}
***************
*** 172,176 ****
SerafinInterface inter= inter_;
H2dMaillage.computeBord(inter.getMaillage(), inter.getPtsFrontiere(), null);
! H2dMaillageBord b= inter.getMaillage().getPtsFrontiere();
assertEquals(b.getBordInternNb(), 1);
}
--- 175,179 ----
SerafinInterface inter= inter_;
H2dMaillage.computeBord(inter.getMaillage(), inter.getPtsFrontiere(), null);
! H2dMaillageFrontiere b= inter.getMaillage().getPtsFrontiere();
assertEquals(b.getBordInternNb(), 1);
}
***************
*** 178,182 ****
public void testRechercheFrontiereinterne() {
SerafinInterface inter= inter_;
! inter.getMaillage().computeBordV2(null);
assertTrue(
inter.getMaillage().getPtsFrontiere().isSame(inter.getPtsFrontiere()));
--- 181,185 ----
public void testRechercheFrontiereinterne() {
SerafinInterface inter= inter_;
! inter.getMaillage().computeBord(null);
assertTrue(
inter.getMaillage().getPtsFrontiere().isSame(inter.getPtsFrontiere()));
Index: TestSerafinArchConvert.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestSerafinArchConvert.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestSerafinArchConvert.java 18 Aug 2003 11:05:20 -0000 1.3
--- TestSerafinArchConvert.java 22 Aug 2003 15:51:13 -0000 1.4
***************
*** 27,34 ****
*/
! public class TestSerafinArchConvert
! {
!
!
/**
--- 27,31 ----
*/
! public class TestSerafinArchConvert {
/**
***************
*** 37,112 ****
* @param args
*/
! public static void main(String[] args)
! {
! SerafinFileFormat.SerafinVersion format=SerafinFileFormat.getInstance().getLastVersionImpl();
! if(args.length<2)
! {
System.out.println("fichier_entree fichier_sortieID format_sortieID");
System.out.println("format_sortieID optionnel");
System.out.println("format_sortieID= \"X86\" ou \"sparc\"");
!
! return ;
}
! try
! {
! File fic = new File(args[0]);
! File ficSortie = new File(args[1]);
! String sortieID=null;
! if(args.length>2) sortieID=args[2];
! else sortieID=System.getProperty("os.arch");
! sortieID=NativeBinaryInputStream.getMachineId(sortieID);
! if(!NativeBinaryInputStream.isMachineKnown(sortieID))
! {
! System.out.println("format de sortieID inconnue");
! System.out.println("format_sortieID= \"X86\" ou \"sparc\"");
! return ;
! }
! if(!fic.exists())
! {
! System.out.println("Le fichier d'entree n'existe pas");
! return ;
! }
! if(ficSortie.exists())
! {
! System.out.println("Le fichier de sortie existe deja");
! return ;
! }
! InputStream in = new FileInputStream(fic);
! SerafinReader t = new SerafinReader(format);
! t.setFile(in);
! System.out.println("les commentaires sur la lecture");
! FileOperationSynthese synthese=new FileOperationSynthese();
! SerafinInterface sinter=t.read(synthese);
! DodicoAnalyze a=synthese.getAnalyze();
! if(a!=null) a.printResume();
! in.close();
! if(t.getMachineId().equals(sortieID))
! {
! System.out.println("les formats d'entree et de sortie sont identiques");
! }
! OutputStream out=new FileOutputStream(ficSortie);
! SerafinWriter w = new SerafinWriter(format);
! w.setOut(out);
! w.setMachineID(sortieID);
! w.write(sinter, synthese);
! System.out.println("");
! DodicoAnalyze analyze=synthese.getAnalyze();
! if(analyze!=null)
! {
! System.out.println("les commentaires sur l'ecriture");
! analyze.printResume();
! }
}
! catch(IOException _e)
! {
! _e.printStackTrace();
}
}
-
-
-
}
-
-
--- 34,87 ----
* @param args
*/
! public static void main(String[] args) {
! SerafinFileFormat.SerafinVersion format=
! SerafinFileFormat.getInstance().getLastVersionImpl();
! if (args.length < 2) {
System.out.println("fichier_entree fichier_sortieID format_sortieID");
System.out.println("format_sortieID optionnel");
System.out.println("format_sortieID= \"X86\" ou \"sparc\"");
!
! return;
}
! File fic= new File(args[0]);
! File ficSortie= new File(args[1]);
! String sortieID= null;
! if (args.length > 2)
! sortieID= args[2];
! else
! sortieID= System.getProperty("os.arch");
! sortieID= NativeBinaryInputStream.getMachineId(sortieID);
! if (!NativeBinaryInputStream.isMachineKnown(sortieID)) {
! System.out.println("format de sortieID inconnue");
! System.out.println("format_sortieID= \"X86\" ou \"sparc\"");
! return;
}
! if (!fic.exists()) {
! System.out.println("Le fichier d'entree n'existe pas");
! return;
}
+ if (ficSortie.exists()) {
+ System.out.println("Le fichier de sortie existe deja");
+ return;
+ }
+ SerafinReader t= new SerafinReader(format);
+ t.setFile(fic);
+ System.out.println("les commentaires sur la lecture");
+ FileOperationSynthese synthese= t.read();
+ SerafinInterface sinter= (SerafinInterface)synthese.getSource();
+ if (synthese.containsMessages())
+ synthese.getAnalyze().toAnalyze().printResume();
+ if (t.getMachineId().equals(sortieID)) {
+ System.out.println("les formats d'entree et de sortie sont identiques");
+ }
+ SerafinWriter w= new SerafinWriter(format);
+ w.setFile(ficSortie);
+ w.setMachineID(sortieID);
+ synthese= w.write(sinter);
+ System.out.println("");
+ if (synthese.containsMessages())
+ synthese.getAnalyze().toAnalyze().printResume();
}
}
|