|
From: <bma...@us...> - 2015-03-17 16:00:29
|
Revision: 9088
http://sourceforge.net/p/fudaa/svn/9088
Author: bmarchan
Date: 2015-03-17 16:00:27 +0000 (Tue, 17 Mar 2015)
Log Message:
-----------
Corrections diverses
Modified Paths:
--------------
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivUtils.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivImportTransectAction.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivNewTransectAction.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProject.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProjectPersistence.java
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivUtils.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivUtils.java 2015-03-17 15:02:06 UTC (rev 9087)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivUtils.java 2015-03-17 16:00:27 UTC (rev 9088)
@@ -66,7 +66,7 @@
PivUtils.FILE_FLT_IMAGES=new BuFileFilter(new String[]{"jpg","jpeg","gif","png","pgm","tif","tiff","bmp"},PivResource.getS("Fichiers images"));
PivUtils.FILE_FLT_GRID=new BuFileFilter("dat",PivResource.getS("Fichier grid"));
PivUtils.FILE_FLT_GRP=new BuFileFilter("dat",PivResource.getS("Fichier GRP"));
- PivUtils.FILE_FLT_BATHY=new BuFileFilter("dat",PivResource.getS("Fichier bathy"));
+ PivUtils.FILE_FLT_BATHY=new BuFileFilter(new String[]{"dat",FILE_FLT_TRANS_BTH.getFirstExt()},PivResource.getS("Fichier bathy"));
}
/**
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivImportTransectAction.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivImportTransectAction.java 2015-03-17 15:02:06 UTC (rev 9087)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivImportTransectAction.java 2015-03-17 16:00:27 UTC (rev 9088)
@@ -62,10 +62,8 @@
impl.error(ret.getAnalyze().getResume());
return;
}
+ impl.getCurrentProject().addTransect(ret.getSource());
- PivTransect trans=ret.getSource();
- impl.getCurrentProject().setTransects(new PivTransect[]{trans});
-
impl.get2dFrame().getVisuPanel().setViewMode(PivVisuPanel.MODE_REAL_VIEW);
}
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivNewTransectAction.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivNewTransectAction.java 2015-03-17 15:02:06 UTC (rev 9087)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivNewTransectAction.java 2015-03-17 16:00:27 UTC (rev 9088)
@@ -131,16 +131,7 @@
transect.setStraight(_pl);
transect.setParams(params);
- PivTransect[] transects = pnCalques_.getProject().getTransects();
- PivTransect[] transnew;
- if (transects!=null)
- transnew=Arrays.copyOf(transects, transects.length+1);
- else
- transnew=new PivTransect[1];
-
- transnew[transnew.length-1]=transect;
-
- pnCalques_.getProject().setTransects(transnew);
+ pnCalques_.getProject().addTransect(transect);
hideWindow();
return true;
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProject.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProject.java 2015-03-17 15:02:06 UTC (rev 9087)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProject.java 2015-03-17 16:00:27 UTC (rev 9088)
@@ -841,6 +841,21 @@
}
/**
+ * Ajoute un transect aux transects existants.
+ * @param _trans Le transect \xE0 ajouter.
+ */
+ public void addTransect(PivTransect _trans) {
+ if (transects==null) {
+ transects=new PivTransect[]{_trans};
+ }
+ else {
+ transects=Arrays.copyOf(transects, transects.length+1);
+ transects[transects.length-1]=_trans;
+ }
+ setTransects(transects);
+ }
+
+ /**
* Definit les transects pour le calcul de d\xE9bit.
* @param _trans Les transects. <tt>null</tt> est autoris\xE9.
*/
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProjectPersistence.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProjectPersistence.java 2015-03-17 15:02:06 UTC (rev 9087)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivProjectPersistence.java 2015-03-17 16:00:27 UTC (rev 9088)
@@ -573,12 +573,25 @@
*/
public void saveTransects(PivProject prj_, PivTransect[] _trans, ProgressionInterface _prog) {
File dirTransect=new File(prj_.rootPath,PivProject.TRANSECTS_DIR);
- CtuluLibFile.deleteDir(dirTransect);
+ dirTransect.mkdir();
+ // Suppression des fichiers bathy
+ File[] files=dirTransect.listFiles(PivUtils.FILE_FLT_TRANS_BTH);
+ if (files!=null) {
+ for (File file : files) {
+ file.delete();
+ }
+ }
+ // Suppression des fichiers params
+ files=dirTransect.listFiles(PivUtils.FILE_FLT_TRANS_PAR);
+ if (files!=null) {
+ for (File file : files) {
+ file.delete();
+ }
+ }
+
if (_trans==null) return;
- dirTransect.mkdir();
-
for (int i = 0; i < _trans.length; i++) {
File bthFile = new File(dirTransect, "trans" + PivUtils.formatOn4Chars(i + 1) + "."+PivUtils.FILE_FLT_TRANS_BTH.getFirstExt());
new PivBathyWriter().write(_trans[i], bthFile, _prog);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|