|
From: <chr...@us...> - 2009-11-23 19:21:30
|
Revision: 5492
http://fudaa.svn.sourceforge.net/fudaa/?rev=5492&view=rev
Author: chrisc83
Date: 2009-11-23 19:21:19 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/config/ConfComparaison.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/io/ReaderConfig.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/io/TestReaderConfig.java
trunk/soft/fudaa-crue/dodico/src/test/resources/org/fudaa/dodico/crue/comparaison/io/testComparaison.xml
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2009-11-20 16:15:57 UTC (rev 5491)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2009-11-23 19:21:19 UTC (rev 5492)
@@ -68,8 +68,17 @@
}
private ResultatTest res;
+ private String id;
private String msg;
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
/**
* @return the msg
*/
@@ -178,6 +187,7 @@
public ExecuteComparaisonResult launch(final ConfComparaison cmp, final Object a, final Object b) {
if (!cmp.isActive()) { return null; }
final ExecuteComparaisonResult res = new ExecuteComparaisonResult();
+ res.id = cmp.getId();
res.msg = cmp.getNom();
res.analyze = new CtuluAnalyze();
final List<ConfCompare> compare = cmp.getCompare();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/config/ConfComparaison.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/config/ConfComparaison.java 2009-11-20 16:15:57 UTC (rev 5491)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/config/ConfComparaison.java 2009-11-23 19:21:19 UTC (rev 5492)
@@ -10,9 +10,18 @@
public class ConfComparaison {
private String nom;
+ private String id;
// private boolean active = true;
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
/**
* @return the active
*/
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/io/ReaderConfig.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/io/ReaderConfig.java 2009-11-20 16:15:57 UTC (rev 5491)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/io/ReaderConfig.java 2009-11-23 19:21:19 UTC (rev 5492)
@@ -3,6 +3,22 @@
import java.io.InputStream;
import java.net.URL;
+import org.apache.commons.lang.StringUtils;
+import org.fudaa.ctulu.CtuluAnalyze;
+import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
+import org.fudaa.dodico.crue.comparaison.config.AbstractConfSelectionItem;
+import org.fudaa.dodico.crue.comparaison.config.ConfComparaison;
+import org.fudaa.dodico.crue.comparaison.config.ConfComparaisonConteneur;
+import org.fudaa.dodico.crue.comparaison.config.ConfCompareListe;
+import org.fudaa.dodico.crue.comparaison.config.ConfCompareObject;
+import org.fudaa.dodico.crue.comparaison.config.ConfCompareSpecific;
+import org.fudaa.dodico.crue.comparaison.config.ConfOption;
+import org.fudaa.dodico.crue.comparaison.config.ConfSelection;
+import org.fudaa.dodico.crue.comparaison.config.ConfSelectionItemMerge;
+import org.fudaa.dodico.crue.comparaison.config.ConfSelectionItemRequete;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
@@ -12,13 +28,6 @@
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.io.xml.DomDriver;
-import org.apache.commons.lang.StringUtils;
-import org.fudaa.ctulu.CtuluAnalyze;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
-import org.fudaa.dodico.crue.comparaison.config.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
public class ReaderConfig {
private final static Logger LOGGER = LoggerFactory.getLogger(TestReaderConfig.class);
@@ -80,6 +89,7 @@
private void configureComparaison(final XStream xstream) {
xstream.alias("Comparaison", ConfComparaison.class);
+ xstream.aliasField("Id", ConfComparaison.class, "id");
xstream.aliasField("Nom", ConfComparaison.class, "nom");
// xstream.aliasAttribute(ConfComparaison.class, "active", "Active");
// xstream.registerLocalConverter(ConfComparaison.class, "Active", new AbstractSingleValueConverter() {
Modified: trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/io/TestReaderConfig.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/io/TestReaderConfig.java 2009-11-20 16:15:57 UTC (rev 5491)
+++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/io/TestReaderConfig.java 2009-11-23 19:21:19 UTC (rev 5492)
@@ -5,10 +5,18 @@
import junit.framework.TestCase;
+import org.fudaa.dodico.crue.comparaison.config.ConfComparaison;
+import org.fudaa.dodico.crue.comparaison.config.ConfComparaisonConteneur;
+import org.fudaa.dodico.crue.comparaison.config.ConfCompare;
+import org.fudaa.dodico.crue.comparaison.config.ConfCompareObject;
+import org.fudaa.dodico.crue.comparaison.config.ConfOption;
+import org.fudaa.dodico.crue.comparaison.config.ConfSelection;
+import org.fudaa.dodico.crue.comparaison.config.ConfSelectionItem;
+import org.fudaa.dodico.crue.comparaison.config.ConfSelectionItemMerge;
+import org.fudaa.dodico.crue.comparaison.config.ConfSelectionItemRequete;
+
import com.thoughtworks.xstream.XStream;
-import org.fudaa.dodico.crue.comparaison.config.*;
-
/**
* @author deniger
* @creation 1 juil. 2009
@@ -26,6 +34,7 @@
assertNotNull(read);
assertEquals(1, read.getComparaisons().size());
final ConfComparaison comparaison = read.getComparaisons().get(0);
+ assertEquals("testId8", comparaison.getId());
assertEquals("testIt", comparaison.getNom());
assertEquals(1, comparaison.getCompare().size());
final List<ConfSelectionItem> items = comparaison.getSelection().getItems();
@@ -61,6 +70,7 @@
cont.setComparaisons(new ArrayList<ConfComparaison>());
final ConfComparaison c1 = new ConfComparaison();
cont.getComparaisons().add(c1);
+ c1.setId("id");
c1.setNom("test");
final ConfCompareObject compare = new ConfCompareObject();
Modified: trunk/soft/fudaa-crue/dodico/src/test/resources/org/fudaa/dodico/crue/comparaison/io/testComparaison.xml
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/resources/org/fudaa/dodico/crue/comparaison/io/testComparaison.xml 2009-11-20 16:15:57 UTC (rev 5491)
+++ trunk/soft/fudaa-crue/dodico/src/test/resources/org/fudaa/dodico/crue/comparaison/io/testComparaison.xml 2009-11-23 19:21:19 UTC (rev 5492)
@@ -4,6 +4,7 @@
http://www.fudaa.fr/xsd/crue/comparaison-1.0.0.xsd">
<Comparaison>
+ <Id>testId8</Id>
<Nom>testIt</Nom>
<Selection>
<Merge Attribut="attToMerge" Description="Merge sur att ">
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java 2009-11-20 16:15:57 UTC (rev 5491)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java 2009-11-23 19:21:19 UTC (rev 5492)
@@ -11,12 +11,6 @@
import javax.swing.ListSelectionModel;
import javax.swing.table.DefaultTableCellRenderer;
-import com.memoire.bu.BuBorderLayout;
-import com.memoire.bu.BuCheckBox;
-import com.memoire.bu.BuList;
-import com.memoire.bu.BuPanel;
-import com.memoire.bu.BuResource;
-
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
@@ -38,6 +32,12 @@
import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import com.memoire.bu.BuBorderLayout;
+import com.memoire.bu.BuCheckBox;
+import com.memoire.bu.BuList;
+import com.memoire.bu.BuPanel;
+import com.memoire.bu.BuResource;
+
/**
* Classe qui se charge de charger en memoire un scénario donné.
*
@@ -103,6 +103,7 @@
return false;
}
+ String id;
String msg;
Object a;
String valueA;
@@ -112,16 +113,17 @@
@Override
public Object getValueAt(int column) {
- if (column == 1) { return ok; }
- if (column == 0) { return msg; }
- if (column == 2) { return valueA; }
- if (column == 3) { return valueB; }
+ if (column == 0) { return id; }
+ if (column == 1) { return msg; }
+ if (column == 2) { return ok; }
+ if (column == 3) { return valueA; }
+ if (column == 4) { return valueB; }
return nbObjectTested;
}
@Override
public int getColumnCount() {
- return 5;
+ return 6;
}
}
@@ -143,6 +145,7 @@
List<CompareTreeTableNode> noError = new ArrayList<CompareTreeTableNode>();
for (ExecuteComparaisonResult cmpRes : launch) {
CompareTreeTableNode node = new CompareTreeTableNode();
+ node.id = cmpRes.getId();
node.msg = cmpRes.getMsg();
node.nbObjectTested = cmpRes.getNbObjectTested();
if (cmpRes.getAnalyze().containsErrors()) {
@@ -175,6 +178,7 @@
}
DefaultTreeTableModel modeleJX = new DefaultTreeTableModel(root);
List<String> colonnes = new ArrayList<String>();
+ colonnes.add("Id");
colonnes.add("Message");
colonnes.add("Egal");
colonnes.add("Valeur Scénario courant");
@@ -186,7 +190,7 @@
final Icon no = BuResource.BU.getToolIcon("crystal_non");
final JXTreeTable table = new JXTreeTable(modeleJX);
- table.getColumn(1).setCellRenderer(new DefaultTableCellRenderer() {
+ table.getColumn(2).setCellRenderer(new DefaultTableCellRenderer() {
@Override
protected void setValue(Object value) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-11-27 17:09:23
|
Revision: 5503
http://fudaa.svn.sourceforge.net/fudaa/?rev=5503&view=rev
Author: chrisc83
Date: 2009-11-27 17:09:05 +0000 (Fri, 27 Nov 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueModeleBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueTreeProject.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFicheScenario.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dc
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dh
Modified: trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java 2009-11-26 16:57:55 UTC (rev 5502)
+++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java 2009-11-27 17:09:05 UTC (rev 5503)
@@ -11,8 +11,42 @@
import org.fudaa.dodico.crue.io.common.CrueData;
import org.fudaa.dodico.crue.io.common.CrueIOResu;
import org.fudaa.dodico.crue.io.common.IOMessages;
-import org.fudaa.dodico.crue.metier.emh.*;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPerm;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPermBrancheOrificeManoeuvre;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPermNoeudNiveauContinuQapp;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPermNoeudNiveauContinuZimpose;
+import org.fudaa.dodico.crue.metier.emh.CalcTrans;
+import org.fudaa.dodico.crue.metier.emh.CalcTransBrancheOrificeManoeuvre;
+import org.fudaa.dodico.crue.metier.emh.CalcTransBrancheSaintVenantQruis;
+import org.fudaa.dodico.crue.metier.emh.CalcTransNoeudNiveauContinuQapp;
+import org.fudaa.dodico.crue.metier.emh.CalcTransNoeudNiveauContinuTarage;
+import org.fudaa.dodico.crue.metier.emh.CatEMHBranche;
+import org.fudaa.dodico.crue.metier.emh.CatEMHNoeud;
+import org.fudaa.dodico.crue.metier.emh.DonCLimM;
+import org.fudaa.dodico.crue.metier.emh.DonCLimMScenario;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrt;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSeuilTransversal;
+import org.fudaa.dodico.crue.metier.emh.DonPrtCIniBranche;
+import org.fudaa.dodico.crue.metier.emh.DonPrtCIniNoeudNiveauContinu;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilTransversal;
+import org.fudaa.dodico.crue.metier.emh.EnumFormulePdc;
+import org.fudaa.dodico.crue.metier.emh.EnumSensOuv;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
+import org.fudaa.dodico.crue.metier.emh.EnumVerbosite;
+import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
+import org.fudaa.dodico.crue.metier.emh.Loi;
+import org.fudaa.dodico.crue.metier.emh.LoiDF;
+import org.fudaa.dodico.crue.metier.emh.LoiFF;
+import org.fudaa.dodico.crue.metier.emh.ParamCalcScenario;
+import org.fudaa.dodico.crue.metier.emh.ParamNumModeleBase;
+import org.fudaa.dodico.crue.metier.emh.Pdt;
+import org.fudaa.dodico.crue.metier.emh.PdtCst;
+import org.fudaa.dodico.crue.metier.emh.PtEvolutionFF;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.validation.ValidateEMHProperties;
+import org.fudaa.dodico.crue.validation.ValidateEMHProperties.IdValidator;
/**
* Tests junit pour les fichiers DH IO. fortran, .
@@ -36,6 +70,9 @@
protected static final String FICHIER_TEST_MODELE3_DLHY = "/fichierTest/Modele3.dlhy.xml";
protected static final String FICHIER_TEST_MODELE3_DCLM = "/fichierTest/Modele3.dclm.xml";
+ protected static final String FICHIER_TEST_M6_0_C9_DH = "/fichierTest/M6-0_c9.dh";
+ protected static final String FICHIER_TEST_M6_0_C9_DC = "/fichierTest/M6-0_c9.dc";
+
/**
* Test de lecture
*/
@@ -64,6 +101,34 @@
testAnalyser(readModele.getAnalyse());
}
+ public void testLectureM6_0_C9() {
+ final CrueIOResu<CrueData> data = readM6_0_C9();
+ testM6_0_C9(data);
+ }
+
+ private void testM6_0_C9(final CrueIOResu<CrueData> data) {
+ final ValidateEMHProperties propValidator = new ValidateEMHProperties();
+ final IdValidator res = propValidator.validateNoms(data.getMetier().getAllSimpleEMH());
+ final CtuluAnalyze nomValidationRes = res.getRes();
+
+ assertFalse(nomValidationRes.containsErrors());
+ /*
+ * final EMHBrancheSaintVenant findBrancheByReference = (EMHBrancheSaintVenant) data.getMetier()
+ * .findBrancheByReference("b27"); final DonCalcSansPrtBrancheSaintVenant dcsp =
+ * EMHHelper.getFirstOfClass(findBrancheByReference.getInfosEMH(), DonCalcSansPrtBrancheSaintVenant.class);
+ * assertDoubleEquals(0.25 * 1.25, dcsp.getCoefRuis()); final CalcTransBrancheSaintVenantQruis trans =
+ * EMHHelper.getFirstOfClass(findBrancheByReference.getInfosEMH(), CalcTransBrancheSaintVenantQruis.class);
+ * assertEquals(109, trans.getLoi().getEvolutionFF().getPtEvolutionFF().size());
+ */
+ }
+
+ private CrueIOResu<CrueData> readM6_0_C9() {
+ final CtuluAnalyze analyzer = new CtuluAnalyze(IOMessages.RESOURCE_BUNDLE);
+ final CrueIOResu<CrueData> data = readModele(analyzer, FICHIER_TEST_M6_0_C9_DC, FICHIER_TEST_M6_0_C9_DH);
+ testAnalyser(analyzer);
+ return data;
+ }
+
public void testLectureModele7() {
final CrueIOResu<CrueData> data = readModele7();
testModele7(data);
Added: trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dc
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dc (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dc 2009-11-27 17:09:05 UTC (rev 5503)
@@ -0,0 +1,293 @@
+* Donn\xE9es g\xE9n\xE9rales
+* --------------------------
+* 5 lignes de titre
+TITRE CrueX - Structuration des donn\xE9es
+TITRE
+TITRE Mod\xE8le de test pour les pas de temps variables
+TITRE
+TITRE PBa Nov09 sur la base de Modele3-0
+*
+* Configuration des r\xE8gles
+R_SLARGE 110.
+*
+* dal theta isorti
+COEFF 1.00 0.75 1
+*
+*
+* D\xE9finition des branches
+* --------------------------
+*
+* Branche B1: Saint-Venant
+BRANCHE Br_B1 Nd_N1 Nd_N2 20
+DISTANCE 100.00 100.00 100.00 100.00 100.00
+PROF ST_Prof11 St_PROF10 St_PROF9 St_PROF8 St_PROF7
+PROF St_PROF6A
+DISTMAX 50.
+*
+* Branche B2: Saint-Venant
+BRANCHE Br_B2 Nd_N2 Nd_N3 20
+DISTANCE 100.00 100.00 100.00
+PROF St_PROF6B St_PROF5 St_PROF4 St_PROF3A
+*
+* Branche B3: Seuil transversal
+BRANCHE Br_B3 Nd_N3 Nd_N4 2
+BORDA 1.
+* Larg Zseuil Cdebit Cpdc
+SEUIL 20.00 0.60 0.900
+SEUIL 8.00 2.20 0.900 1.000
+* nom des profils amont et aval
+PROF St_PROF3AM St_PROF3AV
+*
+* Branche B4: Saint-Venant
+BRANCHE Br_B4 Nd_N4 Nd_N5 20
+DISTANCE 100.00 100.00
+PROF St_PROF3B St_PROF2 St_PROF1
+*
+* Branche B5: Seuil lateral
+BRANCHE Br_B5 Nd_N2 Nd_N6 4
+BORDA 1.
+* Larg Zseuil Cdebit Cpdc
+SEUIL 100.00 3.78 0.900 1.000
+SEUIL 100.00 3.82 0.900
+*
+* Branche B6: Strickler
+BRANCHE Br_B6 Nd_N6 Nd_N7 6
+DISTANCE 400.00
+PROF St_PROFSTR1 St_PROFSTR2
+*
+* Branche B8: Orifice
+BRANCHE Br_B8 Nd_N7 Nd_N5 5
+CCTRMAX 0.65
+* Zrad Haut Larg Cdeb Sens
+CLAPET 3.00 1.50 20.0 0.90 0
+*
+*
+* D\xE9finition des frottements
+* --------------------------
+*
+STRIREF Fk_K0 0.00
+*
+* Branches Saint-Venant
+STRIREFZ Fk_Prof11MIN 0.00 30. 11.00 30.
+STRIREFZ Fk_Prof11MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF10MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF10MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF9MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF9MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF8MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF8MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF7MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF7MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF6AMIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF6AMAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF6BMIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF6BMAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF5MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF5MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF4MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF4MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF3AMIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF3AMAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF3BMIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF3BMAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF2MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF2MAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF1MIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF1MAJ 0.00 15. 10.00 15.
+*
+* Branches Strickler
+STRIREFZ Fk_PROFSTR1MIN 0.00 30. 11.00 30.
+STRIREFZ Fk_PROFSTR2MIN 0.00 30. 11.00 30.
+*
+* Branches seuil
+STRIREFZ Fk_PROF3AMMIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF3AMMAJ 0.00 15. 10.00 15.
+STRIREFZ Fk_PROF3AVMIN 0.00 30. 10.00 30.
+STRIREFZ Fk_PROF3AVMAJ 0.00 15. 10.00 15.
+*
+*
+* D\xE9finition des profils
+* --------------------------
+*
+* Profils Saint-Venant
+PROFIL ST_Prof11
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_Prof11MAJ Fk_Prof11MIN Fk_Prof11MAJ Fk_K0
+X/Z 0.00 6.10 2.00 5.10 32.00 4.10 62.00 3.10
+X/Z 66.00 1.10 86.00 1.10 90.00 3.10 120.00 4.10
+X/Z 150.00 5.10 152.00 6.10
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF10
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF10MAJ Fk_PROF10MIN Fk_PROF10MAJ Fk_K0
+X/Z 0.00 6.00 2.00 5.00 32.00 4.00 62.00 3.00
+X/Z 66.00 1.00 86.00 1.00 90.00 3.00 120.00 4.00
+X/Z 150.00 5.00 152.00 6.00
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF9
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF9MAJ Fk_PROF9MIN Fk_PROF9MAJ Fk_K0
+X/Z 0.00 5.90 2.00 4.90 32.00 3.90 62.00 2.90
+X/Z 66.00 0.90 86.00 0.90 90.00 2.90 120.00 3.90
+X/Z 150.00 4.90 152.00 5.90
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF8
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF8MAJ Fk_PROF8MIN Fk_PROF8MAJ Fk_K0
+X/Z 0.00 5.80 2.00 4.80 32.00 3.80 62.00 2.80
+X/Z 66.00 0.80 86.00 0.80 90.00 2.80 120.00 3.80
+X/Z 150.00 4.80 152.00 5.80
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF7
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF7MAJ Fk_PROF7MIN Fk_PROF7MAJ Fk_K0
+X/Z 0.00 5.70 2.00 4.70 32.00 3.70 62.00 2.70
+X/Z 66.00 0.70 86.00 0.70 90.00 2.70 120.00 3.70
+X/Z 150.00 4.70 152.00 5.70
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF6A
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF6AMAJ Fk_PROF6AMIN Fk_PROF6AMAJ Fk_K0
+X/Z 0.00 5.60 2.00 4.60 32.00 3.60 62.00 2.60
+X/Z 66.00 0.60 86.00 0.60 90.00 2.60 120.00 3.60
+X/Z 150.00 4.60 152.00 5.60
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIDEM St_PROF6B St_PROF6A 0.
+*
+PROFINT St_PROF5
+*
+PROFIL St_PROF4
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF4MAJ Fk_PROF4MIN Fk_PROF4MAJ Fk_K0
+X/Z 0.00 5.40 2.00 4.40 32.00 3.40 62.00 2.40
+X/Z 66.00 0.40 86.00 0.40 90.00 2.40 120.00 3.40
+X/Z 150.00 4.40 152.00 5.40
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF3A
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF3AMAJ Fk_PROF3AMIN Fk_PROF3AMAJ Fk_K0
+X/Z 0.00 5.30 2.00 4.30 32.00 3.30 62.00 2.30
+X/Z 66.00 0.30 86.00 0.30 90.00 2.30 120.00 3.30
+X/Z 150.00 4.30 152.00 5.30
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIDEM St_PROF3AM St_PROF3A
+*
+PROFIL St_PROF3AV
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF3AVMAJ Fk_PROF3AVMIN Fk_PROF3AVMAJ Fk_K0
+X/Z 0.00 5.30 2.00 4.30 32.00 3.30 62.00 2.30
+X/Z 66.00 0.30 86.00 0.30 90.00 2.30 120.00 3.30
+X/Z 150.00 4.30 152.00 5.30
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF3B
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF3BMAJ Fk_PROF3BMIN Fk_PROF3BMAJ Fk_K0
+X/Z 0.00 5.30 2.00 4.30 32.00 3.30 62.00 2.30
+X/Z 66.00 0.30 86.00 0.30 90.00 2.30 120.00 3.30
+X/Z 150.00 4.30 152.00 5.30
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF2
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF2MAJ Fk_PROF2MIN Fk_PROF2MAJ Fk_K0
+X/Z 0.00 5.20 2.00 4.20 32.00 3.20 62.00 2.20
+X/Z 66.00 0.20 86.00 0.20 90.00 2.20 120.00 3.20
+X/Z 150.00 4.20 152.00 5.20
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+PROFIL St_PROF1
+LIMITEJ 1 3 4 7 8 10
+STRIC Fk_K0 Fk_PROF1MAJ Fk_PROF1MIN Fk_PROF1MAJ Fk_K0
+X/Z 0.00 5.10 2.00 4.10 32.00 3.10 62.00 2.10
+X/Z 66.00 0.10 86.00 0.10 90.00 2.10 120.00 3.10
+X/Z 150.00 4.10 152.00 5.10
+ACTIF 2 3 4
+LIT Lt_MAJD 2
+LIT Lt_MINEUR 3
+LIT Lt_MAJG 4
+LIT Lt_STOCKAGE 1 5
+*
+* Profils Strickler
+PROFIL St_PROFSTR1
+LIMITEJ 1 4
+STRIC Fk_PROFSTR1MIN
+X/Z 0.00 2.00 0.00 0.80 50.00 0.80 50.00 2.00
+*
+PROFIL St_PROFSTR2
+STRIC Fk_PROFSTR2MIN
+LIMITEJ 1 4
+X/Z 0.00 2.00 0.00 0.40 50.00 0.40 50.00 2.00
+*
+*
+* D\xE9finition des casiers
+* --------------------------
+*
+CASIER Nd_N6
+RUIS 0.000000
+PROFCAS 100.00
+LIMITEJ 1 2
+X/Z 0.00 0.30 100.00 0.30
+PROFCAS 100.00
+LIMITEJ 2 4
+X/Z -100.00 0.50 0.00 0.40
+X/Z 50.00 0.30 100.00 0.20
+*
+CASIER Nd_N7
+RUIS 0.000000
+* nbval xlong ideb ifin
+PROFCAS 200.00
+LIMITEJ 1 2
+X/Z 0.00 0.20 100.00 0.20
Added: trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dh
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dh (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M6-0_c9.dh 2009-11-27 17:09:05 UTC (rev 5503)
@@ -0,0 +1,108 @@
+* Donn\xE9es g\xE9n\xE9rales
+* --------------------------
+* 5 lignes de titre
+CrueX - Structuration des donn\xE9es
+
+Mod\xE8le de test pour les pas de temps variables
+
+PBa Nov09 sur la base de Modele3-0
+*
+* ical cru cofqrq isorti ile trepr
+ 2 0 0 0 1 0 0 0 0
+*
+*
+* D\xE9bits initiaux dans les branches
+* --------------------------
+ Br_B1 100.000 Br_B2 100.000 Br_B3 100.000 Br_B4 100.000
+ Br_B5 .000 Br_B6 .000 Br_B8 .000
+FIN
+*
+*
+* Niveaux initiaux aux noeuds
+* --------------------------
+ Nd_N1 3.676 Nd_N2 3.222 Nd_N3 2.779 Nd_N4 2.624
+ Nd_N5 2.000 Nd_N6 2.926 Nd_N7 2.926
+FIN
+*
+*
+* Donn\xE9es permanentes
+* --------------------------
+* dtperm tolz tolq icalmx iprint ndecou
+ 0 1 0 0 0.001 0.01 40 0 1
+*
+* D\xE9finition des types des conditions aux limites
+Nd_N1 2
+Nd_N5 1
+Br_B8 41
+FIN
+*
+* Pseudo-pas de temps variable pour les calculs pseudo-permanents
+VARDT
+10 0 00 01 00
+100 0 01 00 00
+FIN
+*
+* Valeurs des conditions aux limites (r\xE9gimes permanents)
+ 100. 2.0 100.
+ 100. 1.5 90.
+FIN
+*
+*
+* Donnees transitoires
+* --------------------------
+* dt tmax tdeb hdeb nts
+0 00 01 00 0 24 00 00 0 00 00 00 0 00 00 00 60
+*
+* D\xE9finition des types des conditions aux limites
+Nd_N1 2
+Nd_N5 3
+Br_B8 41
+FIN
+*
+* Pas de temps variable pour le calcul transitoire
+VARDT
+0 00 00 00 0 00 01 00
+0 01 00 00 0 00 10 00
+FIN
+*
+* Valeurs des conditions aux limites: d\xE9bit entrant \xE0 l'amont (noeud N1)
+* ilecam
+ 2
+*
+* tj th tm ts Q
+ 0 0 0 0 100.
+ 0 1 0 0 100.
+ 0 3 0 0 125.
+ 0 4 0 0 150.
+ 0 5 0 0 200.
+ 0 7 0 0 400.
+ 0 9 0 0 450.
+ 0 11 0 0 480.
+ 0 12 0 0 500.
+ 0 13 0 0 480.
+ 0 15 0 0 450.
+ 0 17 0 0 400.
+ 0 19 0 0 200.
+ 0 20 0 0 150.
+ 0 21 0 0 125.
+ 0 23 0 0 100.
+ 0 24 0 0 100.
+FIN
+*
+* Valeurs des conditions aux limites: loi Q(Z) \xE0 l'aval (noeud N5)
+* Zbas Dz
+ 1. 0.5
+*
+ 0 -100. -150. -175. -200. -240. -300. -350. -400. -500.
+FIN
+*
+* Valeurs des conditions aux limites et manoeuvres: vanne manoeuvr\xE9e par le haut (branche B8)
+* ilecam
+ 2
+*
+* tj th tm ts Q
+ 0 0 0 0 90.
+ 0 5 0 0 90.
+ 0 6 0 0 50.
+ 0 24 0 0 100.
+FIN
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueModeleBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueModeleBuilder.java 2009-11-26 16:57:55 UTC (rev 5502)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueModeleBuilder.java 2009-11-27 17:09:05 UTC (rev 5503)
@@ -28,6 +28,7 @@
*/
public static BuIcon iconeScenario_ = FCrueResource.CRUE.getIcon("scenario_32");
public static BuIcon iconeModele_ = FCrueResource.CRUE.getIcon("modele_32");
+ public static BuIcon iconeSousModele_ = FCrueResource.CRUE.getIcon("sous-modele_32");
/**
* Construit une bu list avec l'ensemble des scenarios du logiciel
@@ -54,7 +55,12 @@
final DefaultListModel model = new DefaultListModel();
if (baseModeles != null) {
for (final ObjetNomme modele : baseModeles) {
- final BuLabel label = new BuLabel(iconeModele_);
+ final BuLabel label;
+ if (modele instanceof ManagerEMHSousModele) {
+ label = new BuLabel(iconeSousModele_);
+ } else {
+ label = new BuLabel(iconeModele_);
+ }
label.setText(modele.getNom());
model.addElement(label);
}
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueTreeProject.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueTreeProject.java 2009-11-26 16:57:55 UTC (rev 5502)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueTreeProject.java 2009-11-27 17:09:05 UTC (rev 5503)
@@ -152,6 +152,10 @@
return r == scenario.getRunCourant();
}
+ public boolean isLoaded() {
+ return scenario.isLoaded();
+ }
+
@Override
public Object getValueAt(final int column) {
if (column == 0) {
@@ -275,9 +279,11 @@
* Icone propre aux scenarios
*/
public static BuIcon iconeScenario = FCrueResource.CRUE.getIcon("scenario");
- public static BuIcon iconeScenarioCourant = FCrueResource.CRUE.getIcon("correct");
+ public static BuIcon iconeScenarioCourant = FCrueResource.CRUE.getIcon("element-courant-non-charge");
+ public static BuIcon iconeScenarioCourantCharge = FCrueResource.CRUE.getIcon("element-courant-charge");
public static BuIcon iconeRun = FCrueResource.CRUE.getIcon("run");
- public static BuIcon iconeRunCourant = FCrueResource.CRUE.getIcon("correct");
+ public static BuIcon iconeRunCourant = FCrueResource.CRUE.getIcon("element-courant-non-charge");
+ public static BuIcon iconeRunCourantCharge = FCrueResource.CRUE.getIcon("element-courant-charge");
public static BuIcon iconeModele = FCrueResource.CRUE.getIcon("modele");
public static BuIcon iconeSousModele = FCrueResource.CRUE.getIcon("sous-modele");
@@ -302,14 +308,15 @@
if (value instanceof TreeNodeScenario) {
if (((TreeNodeScenario) value).isCourant()) {
- setIcon(iconeScenarioCourant);
+ setIcon(((TreeNodeScenario) value).getS().isLoaded() ? iconeScenarioCourantCharge : iconeScenarioCourant);
} else {
setIcon(iconeScenario);
}
setToolTipText("Scénario");
} else if (value instanceof TreeNodeRun) {
- setIcon(((TreeNodeRun) value).isCourant() ? iconeRunCourant : iconeRun);
+ setIcon(((TreeNodeRun) value).isCourant() ? (((TreeNodeRun) value).isLoaded() ? iconeRunCourantCharge
+ : iconeRunCourant) : iconeRun);
} else if ((value instanceof TreeNodeModele) || (value instanceof TreeNodeModeleRun)) {
setIcon(iconeModele);
} else if (value instanceof TreeNodeSousModele) {
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFicheScenario.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFicheScenario.java 2009-11-26 16:57:55 UTC (rev 5502)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFicheScenario.java 2009-11-27 17:09:05 UTC (rev 5503)
@@ -215,10 +215,14 @@
if (crueProjet_.getProject().getScenarioCourant() != null
&& crueProjet_.getProject().getScenarioCourant() == scenario) {
- labelScenarCourant.setIcon(FCrueResource.CRUE.getIcon("correct"));
+ if (crueProjet_.getProject().getScenarioCourant().isLoaded()) {
+ labelScenarCourant.setIcon(FCrueResource.CRUE.getIcon("element-courant-charge"));
+ } else {
+ labelScenarCourant.setIcon(FCrueResource.CRUE.getIcon("element-courant-non-charge"));
+ }
labelScenarCourant.setText(Messages.getString("ihm.label.id.scenario.current.true"));
} else {
- labelScenarCourant.setIcon(FCrueResource.CRUE.getIcon("erreur-fatale"));
+ labelScenarCourant.setIcon(FCrueResource.CRUE.getIcon("element-non-courant"));
labelScenarCourant.setText(Messages.getString("ihm.label.id.scenario.current.false"));
}
labelId.setText(CtuluLibString.EMPTY_STRING);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-12-01 17:02:32
|
Revision: 5519
http://fudaa.svn.sourceforge.net/fudaa/?rev=5519&view=rev
Author: chrisc83
Date: 2009-12-01 17:02:25 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DefaultValues.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorsBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2009-11-30 16:57:22 UTC (rev 5518)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2009-12-01 17:02:25 UTC (rev 5519)
@@ -830,7 +830,7 @@
writeCom("");
writeCom(" Modulation du pas de temps au cours de la procedure de stabilisation ");
- ecritLignesD(pdtVar);
+ ecritLignesD(data.getParamCalc().getDateDebSce(), pdtVar);
}
// Ecriture Lignes E
@@ -1075,7 +1075,7 @@
writeCom("");
writeCom(" Modulation du pas de temps au cours de la procedure de stabilisation ");
- ecritLignesD(pdtVar);
+ ecritLignesD(pcal.getDateDebSce(), pdtVar);
}
// Ecriture Lignes E
@@ -1133,20 +1133,24 @@
* @param pdtVar
* @throws IOException
*/
- private void ecritLignesD(final PdtVar pdtVar) throws IOException {
+ private void ecritLignesD(final LocalDateTime hDeb, final PdtVar pdtVar) throws IOException {
// Ligne D1
fortranWriter.stringField(0, "VARDT");
fortranWriter.writeFields();
+ Duration startDuration = new Duration(hDeb.toDateTime().getMillis());
+
// Lignes D2
for (int i = 0, imax = pdtVar.getElemPdt().size(); i < imax; i++) {
final ElemPdt elemPdt = pdtVar.getElemPdt().get(i);
final int nbPas = elemPdt.getNbrPdt();
final Duration duree = elemPdt.getDureePdt();
- fortranWriter.intField(0, nbPas);
+ fortranWriter.stringField(0, DateDurationConverter.durationToCrueFormat(startDuration));
fortranWriter.stringField(1, DateDurationConverter.durationToCrueFormat(duree));
fortranWriter.writeFields();
+
+ startDuration = startDuration.plus(duree.getMillis() * nbPas);
}
// Ligne D3
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DefaultValues.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DefaultValues.java 2009-11-30 16:57:22 UTC (rev 5518)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DefaultValues.java 2009-12-01 17:02:25 UTC (rev 5519)
@@ -114,7 +114,7 @@
*Nombre de Froude limite supérieur pour l'annulation linéaire du terme d'inertie ; par défaut, égal à max(1,0 ;
* FrLinInf)
*/
- public static final double FR_LIN_SUP = CrueNumberUtils.INFINI;
+ public static final double FR_LIN_SUP = 1D;
/**
* Débit limite inférieur admissible
*/
@@ -171,6 +171,19 @@
public static final double PM_TOL_ND_Z = 0.01;
/**
+ * Écart de cotes dans le cadre de la définition d'une SectionIdem.
+ */
+ public static final double DZ_SECTION_IDEM = 0.0;
+ /**
+ * Coefficient de frottement de Strickler dans le lit de stockage (lit tel que IsLitActif=false).
+ */
+ public static final double K_STO = 0.0;
+ /**
+ * Cote de référence du modèle.
+ */
+ public static final double Z_REF = 0.0;
+
+ /**
* P0Y0M1DT0H0M0S
*/
public static final Duration DUREE_SCENARIO = DateDurationConverter.getDuration(1, 0, 0, 0);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorsBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorsBuilder.java 2009-11-30 16:57:22 UTC (rev 5518)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorsBuilder.java 2009-12-01 17:02:25 UTC (rev 5519)
@@ -10,14 +10,14 @@
import java.util.List;
import java.util.Map;
-import com.memoire.fu.FuLog;
-
import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.ctulu.CtuluLibFile;
-import org.fudaa.dodico.crue.common.CrueNumberUtils;
+import org.fudaa.dodico.crue.metier.emh.DefaultValues;
import org.fudaa.dodico.crue.metier.emh.EMH;
+import com.memoire.fu.FuLog;
+
/**
* Lit les limites des propriétés numériques dans un fichier.
*
@@ -80,41 +80,39 @@
private void buildDefaultValues() {
if (defaultValues == null) {
defaultValues = new TObjectDoubleHashMap();
- defaultValues.put("coefBeta", 1d);
- defaultValues.put("coefConv", 0d);
- defaultValues.put("coefCtrLim", 0.65d);
- defaultValues.put("coefD", 1d);
- defaultValues.put("coefDiv", 0d);
- defaultValues.put("coefPdc", 1d);
- defaultValues.put("coefPond", 0.5d);
- defaultValues.put("coefRelaxQ", 1d);
- defaultValues.put("coefRelaxZ", 1d);
- defaultValues.put("coefRuis", 1d);
- defaultValues.put("coefRuis", 1d);
- defaultValues.put("coefSinuo", 1d);
- defaultValues.put("crMaxFlu", CrueNumberUtils.INFINI);
- defaultValues.put("crMaxTor", CrueNumberUtils.INFINI);
- defaultValues.put("dzSectionIdem", 0);
- defaultValues.put("frLinInf", CrueNumberUtils.INFINI);
- defaultValues.put("frLinSup", CrueNumberUtils.INFINI);
- defaultValues.put("ksto", 0);
- defaultValues.put("nbrPdtDecoup", 1);
- defaultValues.put("NbrPdtMax", 40);
- defaultValues.put("pm_ProfPlat", 0.00001);
- defaultValues.put("pm_PenteRupture", 0.00001);
- defaultValues.put("pm_PenteRupture", 0.00001);
- defaultValues.put("pm_Decal", 0.02);
- defaultValues.put("pm_LargSeuil", 100);
- defaultValues.put("pm_PdxMax", 200);
- defaultValues.put("pm_VarPdxMax", 1);
- defaultValues.put("pm_PenteMax", 0.01);
- defaultValues.put("pm_TolNdZ", 0.01);
- defaultValues.put("qLimInf", -CrueNumberUtils.INFINI);
- defaultValues.put("qLimSup", CrueNumberUtils.INFINI);
- defaultValues.put("theta", 0.75);
- defaultValues.put("tolMaxQ", 0.01);
- defaultValues.put("tolMaxZ", 0.001);
- defaultValues.put("zref", 0.00);
+ defaultValues.put("coefBeta", DefaultValues.COEF_BETA);
+ defaultValues.put("coefConv", DefaultValues.COEF_CONV);
+ defaultValues.put("coefCtrLim", DefaultValues.COEF_CTR_LIM);
+ defaultValues.put("coefD", DefaultValues.COEF_D);
+ defaultValues.put("coefDiv", DefaultValues.COEF_DIV);
+ defaultValues.put("coefPdc", DefaultValues.COEF_PDC);
+ defaultValues.put("coefPond", DefaultValues.COEF_POND);
+ defaultValues.put("coefRelaxQ", DefaultValues.COEF_RELAX_Q);
+ defaultValues.put("coefRelaxZ", DefaultValues.COEF_RELAX_Z);
+ defaultValues.put("coefRuis", DefaultValues.COEF_RUIS);
+ defaultValues.put("coefSinuo", DefaultValues.COEF_SINUO);
+ defaultValues.put("crMaxFlu", DefaultValues.CR_MAX_FLU);
+ defaultValues.put("crMaxTor", DefaultValues.CR_MAX_TOR);
+ defaultValues.put("dzSectionIdem", DefaultValues.DZ_SECTION_IDEM);
+ defaultValues.put("frLinInf", DefaultValues.FR_LIN_INF);
+ defaultValues.put("frLinSup", DefaultValues.FR_LIN_SUP);
+ defaultValues.put("ksto", DefaultValues.K_STO);
+ defaultValues.put("nbrPdtDecoup", DefaultValues.NBR_PDT_DECOUP);
+ defaultValues.put("nbrPdtMax", DefaultValues.NBR_PDT_MAX);
+ defaultValues.put("pm_ProfPlat", DefaultValues.PM_PROF_PLAT);
+ defaultValues.put("pm_PenteRupture", DefaultValues.PM_PENTE_RUPTURE);
+ defaultValues.put("pm_Decal", DefaultValues.PM_DECAL);
+ defaultValues.put("pm_LargSeuil", DefaultValues.PM_LARG_SEUIL);
+ defaultValues.put("pm_PdxMax", DefaultValues.PM_PDX_MAX);
+ defaultValues.put("pm_VarPdxMax", DefaultValues.PM_VAR_PDX_MAX);
+ defaultValues.put("pm_PenteMax", DefaultValues.PM_PDX_MAX);
+ defaultValues.put("pm_TolNdZ", DefaultValues.PM_TOL_ND_Z);
+ defaultValues.put("qLimInf", DefaultValues.Q_LIM_INF);
+ defaultValues.put("qLimSup", DefaultValues.Q_LIM_SUP);
+ defaultValues.put("theta", DefaultValues.THETA);
+ defaultValues.put("tolMaxQ", DefaultValues.TOL_MAX_Q);
+ defaultValues.put("tolMaxZ", DefaultValues.TOL_MAX_Z);
+ defaultValues.put("zref", DefaultValues.Z_REF);
}
}
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java 2009-11-30 16:57:22 UTC (rev 5518)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java 2009-12-01 17:02:25 UTC (rev 5519)
@@ -12,6 +12,7 @@
import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader;
import org.fudaa.dodico.crue.io.neuf.FCBValueObject.AbstractEntete;
import org.fudaa.dodico.crue.metier.emh.EMH;
+import org.fudaa.dodico.crue.metier.emh.EMHModeleBase;
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
import org.fudaa.dodico.crue.metier.emh.InfosEMH;
import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
@@ -65,10 +66,31 @@
* @return modele du tree.
*/
public static DefaultTreeTableModel buildTreeScenario(final EMHScenario data) {
+ // TODO Traduire les différents textes des noeuds.
final DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode("root");
if (!data.isEmpty()) {
+ final TreeNodeString rootScenario = new TreeNodeString("Scénarios");
+ root.add(rootScenario);
+
+ addNodesForEMH(rootScenario, data);
+
+ final TreeNodeString rootModels = new TreeNodeString("Modèles");
+ root.add(rootModels);
+
+ final TreeNodeString rootSubModels = new TreeNodeString("Sous-modèles");
+ root.add(rootSubModels);
+
+ for (final EMHModeleBase emhModel : data.getModeles()) {
+ addNodesForEMH(rootModels, emhModel);
+
+ for (final EMH emh : emhModel.getSousModele()) {
+ addNodesForEMH(rootSubModels, emh);
+
+ }
+ }
+
final TreeNodeString rootNodes = new TreeNodeString("Noeuds");
root.add(rootNodes);
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java 2009-11-30 16:57:22 UTC (rev 5518)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java 2009-12-01 17:02:25 UTC (rev 5519)
@@ -7,15 +7,15 @@
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
-import com.memoire.bu.BuInternalFrame;
-import com.memoire.bu.BuList;
-
import org.fudaa.fudaa.crue.builder.EMHGeneralBuilder;
import org.fudaa.fudaa.crue.common.FCrueResource;
import org.fudaa.fudaa.crue.projet.CrueProjet;
import org.jdesktop.swingx.JXTreeTable;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import com.memoire.bu.BuInternalFrame;
+import com.memoire.bu.BuList;
+
/**
* Affichage rapide des EMH.
*
Modified: trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties 2009-11-30 16:57:22 UTC (rev 5518)
+++ trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties 2009-12-01 17:02:25 UTC (rev 5519)
@@ -74,7 +74,7 @@
ihm.frame.chgt.format.crue9.crue10 = G\u00E9n\u00E9ration Crue 9 <=> Crue 10
ihm.genererCrue10.action = G\u00E9n\u00E9rer les fichiers Crue 10
ihm.genererCrue9.action = G\u00E9n\u00E9rer les fichiers Crue 9
-ihm.gerer.emhs = GEstion des EMH
+ihm.gerer.emhs = Gestion des EMH
ihm.gerer.etude = G\u00E9rer \u00E9tude
ihm.gerer.modeles = G\u00E9rer mod\u00E8les
ihm.gerer.scenarios = G\u00E9rer sc\u00E9narios
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-12-02 17:06:14
|
Revision: 5520
http://fudaa.svn.sourceforge.net/fudaa/?rev=5520&view=rev
Author: chrisc83
Date: 2009-12-02 17:06:03 +0000 (Wed, 02 Dec 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -365,7 +365,7 @@
* @param msg le message
*/
public void manageException(final Exception _e, final String msg) {
- addRecord(Level.SEVERE, _e.getMessage()).setThrown(_e);
+ addRecord(Level.SEVERE, msg).setThrown(_e);
_e.printStackTrace();
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -8,7 +8,23 @@
import org.apache.commons.collections.CollectionUtils;
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.crue.io.common.CrueData;
-import org.fudaa.dodico.crue.metier.emh.*;
+import org.fudaa.dodico.crue.metier.emh.CatEMHBranche;
+import org.fudaa.dodico.crue.metier.emh.CatEMHSection;
+import org.fudaa.dodico.crue.metier.emh.DonFrt;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeo;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoBatiCasier;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilCasier;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilSection;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilSectionFenteData;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoSectionIdem;
+import org.fudaa.dodico.crue.metier.emh.EMH;
+import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
+import org.fudaa.dodico.crue.metier.emh.InfosEMH;
+import org.fudaa.dodico.crue.metier.emh.LitNomme;
+import org.fudaa.dodico.crue.metier.emh.LitNumerote;
+import org.fudaa.dodico.crue.metier.emh.PtEvolutionFF;
+import org.fudaa.dodico.crue.metier.emh.PtProfil;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
/**
@@ -24,8 +40,8 @@
analyser.addInfo("io.dptg.lecture.error");
} else {
// -- cas des SectionsProfils --//
- convertDaoToMetierSectionsProfils(dataLinked, dao.DonPrtGeoProfilSections, dataLinked.getAllSimpleEMH(), dataLinked
- .getFrottements().getListFrt(), analyser);
+ convertDaoToMetierSectionsProfils(dataLinked, dao.DonPrtGeoProfilSections, dataLinked.getAllSimpleEMH(),
+ dataLinked.getFrottements().getListFrt(), analyser);
// -- cas des Volumes --//
convertDaoToMetierCasierProfils(dataLinked, dao.DonPrtGeoCasiers, dataLinked.getAllSimpleEMH(), analyser);
@@ -43,7 +59,7 @@
return null;
}
- public CrueData getConverterData(CrueData in) {
+ public CrueData getConverterData(final CrueData in) {
return in;
}
@@ -58,53 +74,66 @@
res.DonPrtGeoBranches = new ArrayList<CrueDaoStructureDPTG.BrancheSaintVenant>();
res.DonPrtGeoSections = new ArrayList<CrueDaoStructureDPTG.SectionIdem>();
- List<EMH> allEMH = metier.getAllSimpleEMH();
- if (CollectionUtils.isEmpty(allEMH)) {
- analyser.addInfo("io.dptg.vide.error");
- } else {
- for (final EMH emh : allEMH) {
- if (emh.getDPTG() != null) {
+ final List<EMH> allEMH = metier.getAllSimpleEMH();
+ for (final EMH emh : allEMH) {
+ if (emh.getDPTG() != null) {
- final List<DonPrtGeo> donnees = emh.getDPTG();
+ final List<DonPrtGeo> donnees = emh.getDPTG();
- for (final DonPrtGeo donnee : donnees) {
+ for (final DonPrtGeo donnee : donnees) {
- // -- c'est un profil
- if (donnee instanceof DonPrtGeoProfilSection) {
- if (!listeProfilUniqueReference.contains(donnee)) {
- convertMetierToDaoSectionsProfils(res.DonPrtGeoProfilSections, (DonPrtGeoProfilSection) donnee,
- analyser);
- // -- on enregistre la reference --//
- listeProfilUniqueReference.add((DonPrtGeoProfilSection) donnee);
+ // -- c'est un profil
+ if (donnee instanceof DonPrtGeoProfilSection) {
+ final DonPrtGeoProfilSection donPrtGeoProfilSection = (DonPrtGeoProfilSection) donnee;
+ saveDonPrtGeoProfilSection(analyser, res, listeProfilUniqueReference, donPrtGeoProfilSection);
+ } else if (donnee instanceof DonPrtGeoProfilCasier) {
- }
- } else if (donnee instanceof DonPrtGeoProfilCasier) {
+ convertMetierToDaoCasiersProfils(res.DonPrtGeoCasiers, (DonPrtGeoProfilCasier) donnee, analyser);
- convertMetierToDaoCasiersProfils(res.DonPrtGeoCasiers, (DonPrtGeoProfilCasier) donnee, analyser);
+ } else if (donnee instanceof DonPrtGeoBatiCasier) {
+ final DonPrtGeoBatiCasier bati = (DonPrtGeoBatiCasier) donnee;
+ final CrueDaoStructureDPTG.BatiCasier batiCasier = new CrueDaoStructureDPTG.BatiCasier();
+ batiCasier.Nom = bati.getNom();
+ batiCasier.SplanBati = bati.getSplanBati();
+ batiCasier.ZBatiTotal = bati.getZBatiTotal();
+ res.DonPrtGeoCasiers.add(batiCasier);
+ }
- } else if (donnee instanceof DonPrtGeoBatiCasier) {
- final DonPrtGeoBatiCasier bati = (DonPrtGeoBatiCasier) donnee;
- final CrueDaoStructureDPTG.BatiCasier batiCasier = new CrueDaoStructureDPTG.BatiCasier();
- batiCasier.Nom = bati.getNom();
- batiCasier.SplanBati = bati.getSplanBati();
- batiCasier.ZBatiTotal = bati.getZBatiTotal();
- res.DonPrtGeoCasiers.add(batiCasier);
- }
+ else if (donnee instanceof DonPrtGeoSectionIdem) {
+ convertMetierToDaoSectionsIdem(res.DonPrtGeoSections, (DonPrtGeoSectionIdem) donnee, emh, analyser);
+ } else if (donnee instanceof DonPrtGeoBrancheSaintVenant) {
+ convertMetierToDaoBranches(res.DonPrtGeoBranches, emh, (DonPrtGeoBrancheSaintVenant) donnee, analyser);
+ }
- else if (donnee instanceof DonPrtGeoSectionIdem) {
- convertMetierToDaoSectionsIdem(res.DonPrtGeoSections, (DonPrtGeoSectionIdem) donnee, emh, analyser);
- } else if (donnee instanceof DonPrtGeoBrancheSaintVenant) {
- convertMetierToDaoBranches(res.DonPrtGeoBranches, emh, (DonPrtGeoBrancheSaintVenant) donnee, analyser);
- }
-
- }
}
}
}
+ List<InfosEMH> infosEMH = metier.getSousModele().getInfosEMH();
+ final List<DonPrtGeoProfilSection> selectClass = EMHHelper.selectClass(infosEMH, DonPrtGeoProfilSection.class);
+ for (final DonPrtGeoProfilSection donPrtGeoProfilSection : selectClass) {
+ saveDonPrtGeoProfilSection(analyser, res, listeProfilUniqueReference, donPrtGeoProfilSection);
+
+ }
return res;
}
/**
+ * @param analyser le receveur de log
+ * @param res l'endroit ou sont stockés les DAO
+ * @param uniqueRef la liste permettant d'eviter de restocker 2 fois le meme objets
+ * @param toSave l'objet metier a transformer en dao.
+ */
+ private void saveDonPrtGeoProfilSection(final CtuluAnalyze analyser, final CrueDaoDPTG res,
+ final Set<DonPrtGeoProfilSection> uniqueRef, final DonPrtGeoProfilSection toSave) {
+ if (!uniqueRef.contains(toSave)) {
+ convertMetierToDaoSectionsProfils(res.DonPrtGeoProfilSections, toSave, analyser);
+ // -- on enregistre la reference --//
+ uniqueRef.add(toSave);
+
+ }
+ }
+
+ /**
* Remplit la premiere partie du fichier DPTG avec le type d'objet: sections profils.
*
* @param listePersistante
@@ -246,74 +275,77 @@
// -- on recupere la branche qu'il faut --//
final String profil = profilPersist.Nom;
// -- on tente de trouver tous les objets referencé par ce profil --//
- final DonPrtGeoProfilSection profilGeo = crueData.getUsedProfilSection(profil);
+ DonPrtGeoProfilSection profilGeo = crueData.getUsedProfilSection(profil);
if (profilGeo == null) {
analyser.addInfo("io.dptg.convert.ProfilNotFound.error", profil);
- } else {
+ profilGeo = new DonPrtGeoProfilSection();
+ crueData.getSousModele().addInfosEMH(profilGeo);
+ }
+ // else {
- // -- on remplit son contenu --//
- profilGeo.setNom(profilPersist.Nom);
- if (profilPersist.LargeurFente != null) {
- final DonPrtGeoProfilSectionFenteData dataFente = new DonPrtGeoProfilSectionFenteData();
- dataFente.setLargeurFente(profilPersist.LargeurFente);
- dataFente.setProfondeurFente(profilPersist.ProfondeurFente);
- profilGeo.setFente(dataFente);
- }
+ // -- on remplit son contenu --//
+ profilGeo.setNom(profilPersist.Nom);
+ if (profilPersist.LargeurFente != null) {
+ final DonPrtGeoProfilSectionFenteData dataFente = new DonPrtGeoProfilSectionFenteData();
+ dataFente.setLargeurFente(profilPersist.LargeurFente);
+ dataFente.setProfondeurFente(profilPersist.ProfondeurFente);
+ profilGeo.setFente(dataFente);
+ }
- // -- on remplit les litsNommes --//
- if (profilPersist.LitNumerotes != null) {
- final List<LitNumerote> listeLits = new ArrayList<LitNumerote>();
+ // -- on remplit les litsNommes --//
+ if (profilPersist.LitNumerotes != null) {
+ final List<LitNumerote> listeLits = new ArrayList<LitNumerote>();
- for (final CrueDaoStructureDPTG.Lit litPersist : profilPersist.LitNumerotes) {
+ for (final CrueDaoStructureDPTG.Lit litPersist : profilPersist.LitNumerotes) {
- final LitNumerote litNum = new LitNumerote();
- litNum.setLimDeb(litPersist.LimDeb);
- litNum.setLimFin(litPersist.LimFin);
- litNum.setIsLitActif(litPersist.IsLitActif);
- litNum.setIsLitMineur(litPersist.IsLitMineur);
- litNum.setNomLit(new LitNomme(litPersist.LitNomme));
- // -- recherche de référence au bon DonFrt --//
- if (litPersist.Frot != null) {
- final String idFrottement = litPersist.Frot.NomRef;
- final DonFrt frottement = EMHHelper.findObjectNomme(frottements, idFrottement);
+ final LitNumerote litNum = new LitNumerote();
+ litNum.setLimDeb(litPersist.LimDeb);
+ litNum.setLimFin(litPersist.LimFin);
+ litNum.setIsLitActif(litPersist.IsLitActif);
+ litNum.setIsLitMineur(litPersist.IsLitMineur);
+ litNum.setNomLit(new LitNomme(litPersist.LitNomme));
+ // -- recherche de référence au bon DonFrt --//
+ if (litPersist.Frot != null) {
+ final String idFrottement = litPersist.Frot.NomRef;
+ final DonFrt frottement = EMHHelper.findObjectNomme(frottements, idFrottement);
- if (frottement != null) {
- litNum.setFrot(frottement);
- } else {
- analyser.addError("io.dptg.profil.ref.error", profil, idFrottement);
- }
-
+ if (frottement != null) {
+ litNum.setFrot(frottement);
+ } else {
+ analyser.addError("io.dptg.profil.ref.error", profil, idFrottement);
}
- // -- ajout du litnum dans metier --//
- listeLits.add(litNum);
}
- // -- ajout de la liste de litNum dans donprtgeo --//
- profilGeo.setLitNumerote(listeLits);
-
- } else {
- analyser.addInfo("io.dptg.convert.noLit.error", profilPersist.Nom);
+ // -- ajout du litnum dans metier --//
+ listeLits.add(litNum);
}
- // -- on remplit les séries --//
- if (profilPersist.EvolutionFF != null) {
- final List<PtProfil> listeProfils = new ArrayList<PtProfil>();
- if (profilPersist.EvolutionFF.getPtEvolutionFF() != null) {
- for (final PtEvolutionFF pt : profilPersist.EvolutionFF.getPtEvolutionFF()) {
- listeProfils.add(new PtProfil(pt.getX(), pt.getY()));
- }
+ // -- ajout de la liste de litNum dans donprtgeo --//
+ profilGeo.setLitNumerote(listeLits);
+
+ } else {
+ analyser.addInfo("io.dptg.convert.noLit.error", profilPersist.Nom);
+ }
+
+ // -- on remplit les séries --//
+ if (profilPersist.EvolutionFF != null) {
+ final List<PtProfil> listeProfils = new ArrayList<PtProfil>();
+ if (profilPersist.EvolutionFF.getPtEvolutionFF() != null) {
+ for (final PtEvolutionFF pt : profilPersist.EvolutionFF.getPtEvolutionFF()) {
+ listeProfils.add(new PtProfil(pt.getX(), pt.getY()));
}
- // -- ajout de la liste de profils dans le donprtgeo --//
- profilGeo.setPtProfil(listeProfils);
-
- } else {
- analyser.addInfo("io.dptg.convert.noProfil.error", profilPersist.Nom);
}
+ // -- ajout de la liste de profils dans le donprtgeo --//
+ profilGeo.setPtProfil(listeProfils);
+ } else {
+ analyser.addInfo("io.dptg.convert.noProfil.error", profilPersist.Nom);
}
+ // }
+
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -301,9 +301,25 @@
}
// -- on ajoute la limite fin du dernier elt, puisque les dernier elt n sont les premiers des n+1--//
if (listeLits.size() > 0) {
- final int indicePt = listeLimiteJ.get(listeLimiteJ.size() - 1);
- final PtProfil limiteFin = listeProfils.get(indicePt);
- listeLits.get(listeLits.size() - 1).setLimFin(limiteFin);
+ LitNumerote lastLit = listeLits.get(listeLits.size() - 1);
+ // si pas de limite de définies, le lit est definit avec le premier et dernier point:
+ // question de fred: normalement listLits.size doit valoir 1 ici avec LimDeb null pour ce lit
+ // le cas limitX ( limites définies avec des X position et non pas desindices) est embetant
+ if (listeLimiteJ.isEmpty() && listeLimiteX.isEmpty() && listeLits.size() == 1) {
+ lastLit.setLimFin(listeProfils.get(listeProfils.size() - 1));
+ lastLit.setLimDeb(listeProfils.get(0));
+ } else if (!listeLimiteX.isEmpty()) {
+ final double abscisseArraprocher = listeLimiteX.get(listeLimiteX.size() - 1);
+ final int limDebIdx = CrueHelper.getNearestPtProfilEnY(new PtProfil(abscisseArraprocher, 0), listeProfils,
+ litPrecedent == null);
+ final PtProfil limFin = limDebIdx >= 0 ? listeProfils.get(limDebIdx) : null;
+ lastLit.setLimFin(limFin);
+ }
+ if (!listeLimiteJ.isEmpty()) {
+ final int indicePt = listeLimiteJ.get(listeLimiteJ.size() - 1);
+ final PtProfil limiteFin = listeProfils.get(indicePt);
+ lastLit.setLimFin(limiteFin);
+ }
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -81,6 +81,7 @@
import org.fudaa.dodico.crue.metier.emh.PdtVar;
import org.fudaa.dodico.crue.metier.emh.PtEvolutionFF;
import org.fudaa.dodico.crue.metier.emh.PtProfil;
+import org.fudaa.dodico.crue.metier.emh.Regle;
import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBranche;
import org.fudaa.dodico.crue.metier.emh.ValParamDouble;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
@@ -269,7 +270,7 @@
LOGGER.debug(analyze_.getResource() + " end of file");
}
} catch (final Exception e) {
- analyze_.manageException(e);
+ analyze_.addError("io.dh.error", in_.getLineNumber());
// e.printStackTrace();
logError(e.getMessage(), in_ == null ? -1 : in_.getLineNumber(), e);
}
@@ -681,14 +682,14 @@
// Ligne A : DTPJ, DTPH, DTPM, DTPS, TOLZ, TOLQ, ICALMX, IPRINT, NDECOU
reader.readLine();
final Duration dtperm = readDuration(reader);
- final double tolz = reader.doubleField(4);
- final double tolq = reader.doubleField(5);
- final int icalmx = reader.intField(6);
- final int iprint = reader.intField(7);
- final int ndecou = reader.intField(8);
+ int nbField = reader.getNumberOfFields();
+ final double tolz = nbField > 4 ? reader.doubleField(4) : DefaultValues.TOL_MAX_Z;
+ final double tolq = nbField > 5 ? reader.doubleField(5) : DefaultValues.TOL_MAX_Q;
+ final int icalmx = nbField > 6 ? reader.intField(6) : DefaultValues.NBR_PDT_MAX;
+ // final int iprint = reader.intField(7);
+ final int ndecou = nbField > 8 ? reader.intField(8) : DefaultValues.NBR_PDT_DECOUP;
if (isFine()) {
- LOGGER.debug("dtperm" + dtperm + " | tolz " + tolz + "tolq " + tolq + " icalmx " + icalmx + " iprint " + iprint
- + " ndecou" + ndecou);
+ LOGGER.debug("dtperm" + dtperm + " | tolz " + tolz + "tolq " + tolq + " icalmx " + icalmx + " ndecou" + ndecou);
}
final ParamNumModeleBase pnum = getParamNumModeleBase(res);
// Pdt pdtPerm = new Pdt();
@@ -1732,6 +1733,14 @@
pcal.setVerbosite(isorti == 0 ? EnumVerbosite.ZERO : EnumVerbosite.UN);
final OrdPrtCIniModeleBase methodesInterpolation = createOpti(ile);
crueData.setMethodesInterpolation(methodesInterpolation);
+ // on ajoute la regle T_Z_INIT si ile vaut 2
+ if (ile == 2) {
+ OrdPrtGeoModeleBase prtGeoModeleBase = getPrtGeoModeleBase(metier);
+ boolean regleExist = EMHHelper.findObjectNomme(prtGeoModeleBase.getRegle(), Regle.computeNom(EnumRegle.TOL_ND_Z)) != null;
+ if (!regleExist) {
+ prtGeoModeleBase.addRegle(DefaultValues.createRegle(EnumRegle.TOL_ND_Z, DefaultValues.PM_TOL_ND_Z));
+ }
+ }
// Pas d'enregistrement de "ile" qui sert pour l'algo uniquement
@@ -1835,12 +1844,8 @@
getParamNumModeleBase(metier).setFrLinSup(CrueIODico.getCrue10Value(reader.doubleField(2)));
}
} else if (carte.equals(CrueIODico.TOL_Z_INIT)) {
- OrdPrtGeoModeleBase optg = metier.getPretraitementsGeom();
- if (optg == null) {
- optg = new OrdPrtGeoModeleBase();
- metier.setPretraitementsGeom(optg);
- }
- optg.addRegle(DefaultValues.createRegle(EnumRegle.TOL_ND_Z, CrueIODico.getCrue10Value(reader.doubleField(1))));
+ getPrtGeoModeleBase(metier).addRegle(
+ DefaultValues.createRegle(EnumRegle.TOL_ND_Z, CrueIODico.getCrue10Value(reader.doubleField(1))));
}
reader.readLine();
@@ -1849,6 +1854,15 @@
return metier;
}
+ private OrdPrtGeoModeleBase getPrtGeoModeleBase(final CrueData metier) {
+ OrdPrtGeoModeleBase optg = metier.getPretraitementsGeom();
+ if (optg == null) {
+ optg = new OrdPrtGeoModeleBase();
+ metier.setPretraitementsGeom(optg);
+ }
+ return optg;
+ }
+
private ParamNumCalcPseudoPerm getParamNumCalcPseudoPerm(final CrueData metier) {
final ParamNumModeleBase pnum = getParamNumModeleBase(metier);
ParamNumCalcPseudoPerm res = pnum.getParamNumCalcPseudoPerm();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -140,7 +140,8 @@
// Ecriture ligne A : titres sur 5 lignes
super.writeHeader(ioData, false);
CrueData data = ioData.getMetier();
- writeRegle(data);
+ final int ile = getILE(data);
+ writeRegle(data, ile);
writeCom("");
writeCom(" ical cru cofqrq isorti ile trepr ");
@@ -151,7 +152,7 @@
int cofqrq = 0;
String isorti = "0";
- final int ile = getILE(data);
+
LocalDateTime dateReprise = null;
// ical
@@ -451,9 +452,10 @@
/**
* @param data
+ * @param ile
* @throws IOException
*/
- private void writeRegle(final CrueData data) throws IOException {
+ private void writeRegle(final CrueData data, int ile) throws IOException {
// FrLinInf et FrLinSup
final ParamNumModeleBase pnum = data.getParamNumModeleBase();
// TODO vérifier si frLinInf doit etre -infini ?
@@ -494,23 +496,33 @@
crMaxFlu = crMaxFluTrans;
crMaxTor = crMaxTorTrans;
}
- // if (CrueNumberUtils.isNotInfini(crMaxTor) || CrueNumberUtils.isNotInfini(crMaxFlu)) {
writeCarteValeur(CrueIODico.DH_NB_COURANT_MAX, crMaxFlu, crMaxTor);
- // }
+ Double tolNdZ = getTolNdZ(data);
+ if (tolNdZ == null && ile == 2) {
+ tolNdZ = DefaultValues.PM_TOL_ND_Z;
+ }
+ if (tolNdZ != null) {
+ writeCarteValeur(CrueIODico.TOL_Z_INIT, tolNdZ);
+ }
+
+ }
+
+ /**
+ * @param data
+ * @return null si non trouve
+ */
+ protected Double getTolNdZ(CrueData data) {
final OrdPrtGeoModeleBase optg = data.getPretraitementsGeom();
- if (optg == null) { return; }
+ if (optg == null) { return null; }
final List<Regle> regles = optg.getRegle();
// // pas très bien codé mais faute de temps
for (final Regle regle : regles) {
if (EnumRegle.TOL_ND_Z.equals(regle.getType())) {
final double val = regle.getSeuilDetect();
- // if (!CtuluLib.isEquals(val, DefaultValues.PM_TOL_ND_Z, 1e-5)) {
- writeCarteValeur(CrueIODico.TOL_Z_INIT, val);
- break;
- // }
+ return Double.valueOf(val);
}
}
-
+ return null;
}
private int getILE(final CrueData data) {
@@ -830,7 +842,7 @@
writeCom("");
writeCom(" Modulation du pas de temps au cours de la procedure de stabilisation ");
- ecritLignesD(data.getParamCalc().getDateDebSce(), pdtVar);
+ ecritLignesD(pdtVar);
}
// Ecriture Lignes E
@@ -1075,7 +1087,7 @@
writeCom("");
writeCom(" Modulation du pas de temps au cours de la procedure de stabilisation ");
- ecritLignesD(pcal.getDateDebSce(), pdtVar);
+ ecritLignesD(pdtVar);
}
// Ecriture Lignes E
@@ -1133,24 +1145,20 @@
* @param pdtVar
* @throws IOException
*/
- private void ecritLignesD(final LocalDateTime hDeb, final PdtVar pdtVar) throws IOException {
+ private void ecritLignesD(final PdtVar pdtVar) throws IOException {
// Ligne D1
fortranWriter.stringField(0, "VARDT");
fortranWriter.writeFields();
- Duration startDuration = new Duration(hDeb.toDateTime().getMillis());
-
// Lignes D2
for (int i = 0, imax = pdtVar.getElemPdt().size(); i < imax; i++) {
final ElemPdt elemPdt = pdtVar.getElemPdt().get(i);
final int nbPas = elemPdt.getNbrPdt();
final Duration duree = elemPdt.getDureePdt();
- fortranWriter.stringField(0, DateDurationConverter.durationToCrueFormat(startDuration));
+ fortranWriter.intField(0, nbPas);
fortranWriter.stringField(1, DateDurationConverter.durationToCrueFormat(duree));
fortranWriter.writeFields();
-
- startDuration = startDuration.plus(duree.getMillis() * nbPas);
}
// Ligne D3
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -24,6 +24,7 @@
import org.fudaa.dodico.crue.metier.emh.DonPrtCIni;
import org.fudaa.dodico.crue.metier.emh.DonPrtGeo;
import org.fudaa.dodico.crue.metier.emh.DonPrtGeoNomme;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilSection;
import org.fudaa.dodico.crue.metier.emh.EMH;
import org.fudaa.dodico.crue.metier.emh.EMHModeleBase;
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
@@ -787,7 +788,12 @@
for (final EMHSousModele sousModele : ssModele) {
// on ajoute toutes les relationEMH.
res.getRelationEMH().addAll(selectClass(sousModele.getRelationEMH(), RelationEMHContient.class));
+
res.getFrtConteneur().addAllFrt(sousModele.getFrtConteneur().getListFrt());
+ // on ajoute les DonPrtGeoProfilSection stockées dans le sous-modele ( le non-utilises).
+ final List<DonPrtGeoProfilSection> selectClass = EMHHelper.selectClass(sousModele.getInfosEMH(),
+ DonPrtGeoProfilSection.class);
+ res.getInfosEMH().addAll(selectClass);
}
return res;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -256,20 +256,18 @@
for (int i = 0; i < propertyDescriptors.length; i++) {
final PropertyDescriptor desc = propertyDescriptors[i];
try {
- final Object resObjet = PropertyUtils.getProperty(o, desc.getName());
- if (resObjet instanceof PdtVar) {
- List<ElemPdt> elems = ((PdtVar) resObjet).getElemPdt();
- if (elems != null) {
- int nb = elems.size();
- for (int iElem = 0; iElem < nb; iElem++) {
- validateObject(prefixe + " PdtVar " + (iElem + 1), analyze, elems.get(iElem), ranges);
-
+ final PropertyValidator r = ranges.get(desc.getName());
+ if (r != null) {
+ final Object resObjet = PropertyUtils.getProperty(o, desc.getName());
+ if (resObjet instanceof PdtVar) {
+ List<ElemPdt> elems = ((PdtVar) resObjet).getElemPdt();
+ if (elems != null) {
+ int nb = elems.size();
+ for (int iElem = 0; iElem < nb; iElem++) {
+ validateObject(prefixe + " PdtVar " + (iElem + 1), analyze, elems.get(iElem), ranges);
+ }
}
- }
-
- } else {
- final PropertyValidator r = ranges.get(desc.getName());
- if (r != null) {
+ } else {
r.validate(prefixe, o, analyze);
}
}
@@ -468,7 +466,7 @@
res.setDesc(section.getNom());
validateObject(null, res, section, validator);
validePtProfil(section.getPtProfil(), validator.get("y"), validator.get("z"), res, null);
- return null;
+ return res;
}
protected CtuluAnalyze validateDonPrtGeoProfilSection(final DonPrtGeoProfilSection section,
@@ -510,7 +508,7 @@
}
}
- return null;
+ return res;
}
protected CtuluAnalyze validateLoiDF(final LoiDF loi, final Map<String, PropertyValidator> validator) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties 2009-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties 2009-12-02 17:06:03 UTC (rev 5520)
@@ -51,6 +51,7 @@
io.date.seconde.error = EvolutionDF {0}: impossible de r\u00E9cup\u00E9rer les secondes du contenu {1}
io.dc.brancheMalFormtee.error = Ligne Branche mal form\u00E9e, attendu: 5 elements. Ligne:{0}
io.dc.error = Une erreur est survenue lors de la lecture du fichier DC
+io.dh.error = Une erreur est survenue lors de la lecture du fichier DH. Ligne : {0}
io.dc.refFroSectionIdemNotFound = La r\u00E9f\u00E9rence {1} n''a pas \u00E9t\u00E9 trouv\u00E9 pour la section idem {0}
io.dclm.data.branchem.notfound.error = CalculTransitoire - BrancheOrificeManoeuvre : Donnee DCLM correspondant \u00E0 la r\u00E9f\u00E9rence {0} non trouv\u00E9e.
io.dclm.data.brancheo.notfound.error = CalculPermanent - BrancheOrificeOuv : Donnee DCLM correspondant \u00E0 la r\u00E9f\u00E9rence ...
[truncated message content] |
|
From: <chr...@us...> - 2009-12-08 17:00:45
|
Revision: 5545
http://fudaa.svn.sourceforge.net/fudaa/?rev=5545&view=rev
Author: chrisc83
Date: 2009-12-08 17:00:38 +0000 (Tue, 08 Dec 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CommonGuiLib.java
trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2009-12-08 00:59:30 UTC (rev 5544)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2009-12-08 17:00:38 UTC (rev 5545)
@@ -15,6 +15,8 @@
*/
public class FCBReader extends AbstractCrueBinaryReader<FCBSequentialReader> {
+ int sizeTitre = 256;
+
/**
* Retourne la liste des indices des pas de temps *
*
@@ -27,10 +29,10 @@
// le premier entier doit etre 800.
// cette premiere partie est un procede pour savoir si on est en little ou big endian.
// on sait que le premier entier doit etre 800; soit la longueur des 10 commentaires comportant
- // 80 caractères.
- final int firstInt = 800;
+ // 256 caractères.
+ final int firstInt = 10 * sizeTitre;
// on lit le premier enregistrement qui fait 800 p
- /* final int readAll = */helper.readAll(800 + 8);// 8 pour les 2 entiers avant/apres l'enregistrement
+ /* final int readAll = */helper.readAll(firstInt + 8);// 8 pour les 2 entiers avant/apres l'enregistrement
ByteBuffer bf = helper.getBuffer();
int tempInt = bf.getInt();
// le premier entier ne vaut pas 80: on inverse l'ordre de lecture
@@ -48,7 +50,7 @@
// -- on lit les 10 premieres lignes de titre DC et DH dans le Buffer--//
final int nbCommentDc = 5;
final int nbCommentDh = 5;
- final int nbCaractereParLigne = 800 / (nbCommentDc + nbCommentDh);
+ final int nbCaractereParLigne = firstInt / (nbCommentDc + nbCommentDh);
final List<String> commnentDc = new ArrayList<String>(nbCommentDc);
final List<String> commnentDh = new ArrayList<String>(nbCommentDh);
for (int i = 0; i < nbCommentDh; i++) {
@@ -81,8 +83,9 @@
infos.sousFente = (icodav >= 2);
infos.regulation = (icodav == 1 || icodav == 3);
final int nbBranches = bf.getInt();
- /* final String nomDc = */helper.getStingFromBuffer(60);
- /* final String nomDh = */helper.getStingFromBuffer(60);
+ int nbCharTitreDCDh = 256;
+ /* final String nomDc = */helper.getStingFromBuffer(nbCharTitreDCDh);
+ /* final String nomDh = */helper.getStingFromBuffer(nbCharTitreDCDh);
// -- on passe a la ligne contenant ibmax et iparam --//
// helper.skipRecord();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2009-12-08 00:59:30 UTC (rev 5544)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2009-12-08 17:00:38 UTC (rev 5545)
@@ -35,6 +35,8 @@
private int nbPoin;
private int iPrM;
private int nbHaut;
+ private final int nbCharTitreDcDh = 80;
+ int nbCharNomDcDh = 256;
@Override
protected STOSequentialReader internalReadResu() throws IOException {
@@ -197,13 +199,14 @@
String titreDc = "";
for (int i = 0; i < 5; i++) {
- final String temp = helper.getStingFromBuffer(80);
+
+ final String temp = helper.getStingFromBuffer(nbCharTitreDcDh);
titreDc += temp;
}
donnees.setTitreDc(titreDc);
// System.out.print("TitreDc = " + donnees.getTitreDc() + " | ");
- donnees.setNomDc(helper.getStingFromBuffer(60));
+ donnees.setNomDc(helper.getStingFromBuffer(nbCharNomDcDh));
// System.out.println("NomDc = " + donnees.getNomDc() + " | ");
data.setDonneesGenerales(donnees);
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CommonGuiLib.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CommonGuiLib.java 2009-12-08 00:59:30 UTC (rev 5544)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CommonGuiLib.java 2009-12-08 17:00:38 UTC (rev 5545)
@@ -6,6 +6,9 @@
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
@@ -15,13 +18,20 @@
import java.util.logging.Level;
import java.util.logging.LogRecord;
-import javax.swing.*;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.UIManager;
import javax.swing.tree.DefaultTreeCellRenderer;
-import com.memoire.bu.BuBorderLayout;
-import com.memoire.bu.BuBorders;
-import com.memoire.bu.BuResource;
-
import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.ctulu.CtuluDefaultLogFormatter;
@@ -34,6 +44,10 @@
import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import com.memoire.bu.BuBorderLayout;
+import com.memoire.bu.BuBorders;
+import com.memoire.bu.BuResource;
+
/**
* librairie commune fournit des methodes utiles.
*
@@ -41,6 +55,58 @@
*/
public class CommonGuiLib {
+ public static class CopyToClipboardRunnable implements Runnable {
+
+ private JTable table;
+
+ public CopyToClipboardRunnable(JTable table) {
+ super();
+ this.table = table;
+ }
+
+ /**
+ * @return the table
+ */
+ public JTable getTable() {
+ return table;
+ }
+
+ /**
+ * @param table the table to set
+ */
+ public void setTable(JTable table) {
+ this.table = table;
+ }
+
+ public String createString() {
+ final StringBuilder plainBuf = new StringBuilder(256);
+ final int nbCol = table.getColumnCount();
+ final int nbRow = table.getRowCount();
+ for (int row = 0; row < nbRow; row++) {
+ for (int col = 0; col < nbCol; col++) {
+ final Object obj = table.getValueAt(row, col);
+ final String val = ((obj == null) ? StringUtils.EMPTY : obj.toString());
+ // we want a newline at the end of each line and not a tab
+ final boolean isLast = col == nbCol - 1;
+ // a la fin, ce n'est pas la peine d'ajouter des espaces
+ plainBuf.append(val).append(isLast ? '\n' : " ");
+ }
+ }
+
+ // remove the last newline
+ plainBuf.deleteCharAt(plainBuf.length() - 1);
+ return plainBuf.toString();
+ }
+
+ protected Transferable createTransferable() {
+ return new StringSelection(createString());
+ }
+
+ public void run() {
+ Toolkit.getDefaultToolkit().getSystemClipboard().setContents(createTransferable(), null);
+ }
+ }
+
/**
*
*/
@@ -164,6 +230,9 @@
container.add(comp, BorderLayout.CENTER);
final JButton btContinue = new JButton(BuResource.BU.getString("Continuer"), EbliResource.EBLI
.getIcon("crystal_valider"));
+ final JButton btCopy = new JButton(FCrueResource.getS("viewError.copy"), EbliResource.EBLI.getIcon("copier"));
+ final CopyToClipboardRunnable copyToClipboard = new CopyToClipboardRunnable(table);
+
table.expandAll();
btContinue.addActionListener(new ActionListener() {
@@ -172,6 +241,14 @@
}
});
+
+ btCopy.addActionListener(new ActionListener() {
+
+ public void actionPerformed(ActionEvent arg0) {
+ copyToClipboard.run();
+ }
+ });
+
cbOnlyError.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
@@ -191,6 +268,7 @@
final JPanel pnBt = new JPanel();
pnBt.setLayout(new FlowLayout(FlowLayout.CENTER));
pnBt.add(btContinue);
+ pnBt.add(btCopy);
container.add(pnBt, BorderLayout.SOUTH);
dialog.setContentPane(container);
Modified: trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties 2009-12-08 00:59:30 UTC (rev 5544)
+++ trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties 2009-12-08 17:00:38 UTC (rev 5545)
@@ -139,3 +139,4 @@
valider.menu.action = Valider
viewError.showOnlyError = Afficher uniquement les erreurs
+viewError.copy = Copier
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2009-12-11 03:14:06
|
Revision: 5560
http://fudaa.svn.sourceforge.net/fudaa/?rev=5560&view=rev
Author: deniger
Date: 2009-12-11 03:13:54 +0000 (Fri, 11 Dec 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/AbstractTemplateEqualsTesterDouble.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterInteger.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterLong.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTI.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterETU.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterPCAL.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterPNUM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/EMHProjet.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermBrancheOrificeManoeuvre.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermBrancheSaintVenantQruis.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermCasierProfilQruis.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermNoeudNiveauContinuQapp.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermNoeudNiveauContinuZimpose.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcTransBrancheOrificeManoeuvre.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DefaultValues.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheBarrageFilEau.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheBarrageGenerique.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheNiveauxAssocies.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheQ.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniBranche.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniBrancheOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniNoeudNiveauContinu.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoBatiCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoProfilCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoProfilSectionFenteData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoSectionIdem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemPdt.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemSeuil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemSeuilAvecPdc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdPrtGeoModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamCalcScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumCalcPseudoPerm.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumCalcTrans.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PlanimetrageNbrPdzCst.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/RelationEMHSectionDansBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMHRelation.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorsBuilder.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestComparaisonFactory.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestEqualsTesterLoi.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestExecuteComparaison.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDC.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDCLMFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDCSPFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDPTGFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDPTIFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDRSOFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueOCALFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueOPTGFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCruePCALFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCruePNUMFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueValidationModele.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/common/TestCrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/metier/emh/TestCatEMHNoeud.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/ExampleNumberRangeValidator.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/ExampleValidationVariableBuilder.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestCruePrefix.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestEMHPropertiesValidator.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/CrueProjet.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioLoaderUI.java
trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueFileHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderNature.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderProperty.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueNumberParser.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueNumberUtils.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CruePropertyDefinitionContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CruePropertyDefinitionNatureLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CruePropertyDefinitionNatureLoaderDefault.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/NumberRangeValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/PropertyDefinition.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/PropertyNature.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/PropertyValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorBuilder.java
trunk/soft/fudaa-crue/dodico/src/main/resources/crue-nature.csv
trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/common/TestCrueFileHelper.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/property/
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/property/TestCrueNatureAndPropertyLoader.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueNumberUtils.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ComparaisonValuesLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/FactoryEqualsTesterSingleton.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/NumberRangeValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidator.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/comparaison.csv
trunk/soft/fudaa-crue/dodico/src/test/java/idea/
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestComparaisonValuesLoader.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/ExampleValidateRangeBuilder.java
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueFileHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueFileHelper.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueFileHelper.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -0,0 +1,85 @@
+package org.fudaa.dodico.crue.common;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.fudaa.ctulu.CtuluAnalyze;
+import org.fudaa.ctulu.CtuluLibFile;
+
+public final class CrueFileHelper {
+
+ private CrueFileHelper() {
+
+ }
+
+ public static List<String[]> readFile(final String file, final CtuluAnalyze analyze) {
+ InputStream in = null;
+ List<String[]> lines = null;
+ try {
+ in = CrueFileHelper.class.getResourceAsStream(file);
+ lines = readFile(new InputStreamReader(in), analyze);
+ } catch (final Exception e) {
+ analyze.manageException(e);
+
+ } finally {
+ CtuluLibFile.close(in);
+ }
+ return lines;
+ }
+
+ public static List<String[]> readFile(final File file, final CtuluAnalyze analyze) {
+ Reader in = null;
+ List<String[]> lines = null;
+ try {
+ in = new FileReader(file);
+ lines = readFile(in, analyze);
+ } catch (final Exception e) {
+ analyze.manageException(e);
+
+ } finally {
+ CtuluLibFile.close(in);
+ }
+ return lines;
+ }
+
+ public static List<String[]> readFile(final Reader in, final CtuluAnalyze analyze) throws IOException {
+ final List<String[]> lines = new ArrayList<String[]>(300);
+ if (in == null) { return lines; }
+ final LineNumberReader reader = new LineNumberReader(in);
+ String line = reader.readLine();
+ while (line != null) {
+ if (line.length() > 0 && line.charAt(0) != '#') {
+ String[] allTokens = StringUtils.splitPreserveAllTokens(line, ';');
+ if (allTokens != null) {
+ for (int i = 0; i < allTokens.length; i++) {
+ allTokens[i] = clearCsvString(allTokens[i]);
+ }
+ }
+ lines.add(allTokens);
+ }
+
+ line = reader.readLine();
+ }
+ return lines;
+ }
+
+ /**
+ * @param in la chaine a traiter
+ * @return enlever les quotes au debut et fin si necessaire.
+ */
+ public static String clearCsvString(String in) {
+ if (in == null || in.length() < 2) { return in; }
+ char zero = in.charAt(0);
+ char last = in.charAt(in.length() - 1);
+ if ((zero == '"' && last == '"') || (zero == '\'' && last == '\'')) { return in.substring(1, in.length() - 1); }
+ return in;
+ }
+}
Deleted: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueNumberUtils.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueNumberUtils.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueNumberUtils.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -1,59 +0,0 @@
-/**
- * Licence GPL
- * Copyright Genesis
- */
-package org.fudaa.dodico.crue.common;
-
-import org.fudaa.ctulu.CtuluLib;
-
-/**
- * @author deniger
- */
-public final class CrueNumberUtils {
-
- /**
- * L'infini sur les EMH
- */
- public final static double INFINI = 1E30;
- /**
- * La valeur de l'infini a utiliser pour les tests.
- */
- public final static double INFINI_FOR_TEST = 1E29;
-
- private CrueNumberUtils() {
-
- }
-
- /**
- * @param d le double a tester
- * @return true si superieur a +{@link #INFINI} ou inferieur à -{@link #INFINI}
- */
- public static boolean isInfini(final double d) {
- return isInfiniPositif(d) || isInfiniNegatif(d);
- }
-
- /**
- * @param d le double a tester
- * @return true si pas infini
- */
- public static boolean isNotInfini(final double d) {
- return !isInfini(d);
- }
-
- /**
- * @param d d le double a tester
- * @return true si superieur ou egal a +{@link #INFINI}
- */
- public static boolean isInfiniPositif(final double d) {
- return d >= INFINI_FOR_TEST || CtuluLib.isEquals(d, INFINI_FOR_TEST);
- }
-
- /**
- * @param d d le double a tester
- * @return true si inferieur ou egal à -{@link #INFINI}
- */
- public static boolean isInfiniNegatif(final double d) {
- return d <= -INFINI_FOR_TEST || CtuluLib.isEquals(d, -INFINI_FOR_TEST);
- }
-
-}
Deleted: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ComparaisonValuesLoader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ComparaisonValuesLoader.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ComparaisonValuesLoader.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -1,86 +0,0 @@
-package org.fudaa.dodico.crue.comparaison;
-
-import gnu.trove.TObjectDoubleHashMap;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.fudaa.ctulu.CtuluAnalyze;
-import org.fudaa.ctulu.CtuluLibFile;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Permet de lire les valeurs de comparaisons dans un fichier
- *
- * @author deniger
- * @creation 22 juin 2009
- * @version
- */
-public class ComparaisonValuesLoader {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ComparaisonValuesLoader.class);
-
- /**
- * Charge le fichier comparaison.csv
- *
- * @param analyze l'analyse recevant les erreur
- * @return la map identifiant variable-> eps de comparaison.
- */
- public TObjectDoubleHashMap load(final CtuluAnalyze analyze) {
- return load("comparaison.csv", analyze);
- }
-
- /**
- * @param file le nom du fichier a lire
- * @param analyze l'analyse recevant les erreur
- * @return la map identifiant variable ( avec une minuscule au debut)-> eps de comparaison.
- */
- public TObjectDoubleHashMap load(final String file, final CtuluAnalyze analyze) {
- final List<String[]> res = readFile(file, analyze);
- final TObjectDoubleHashMap values = new TObjectDoubleHashMap(res.size());
- for (final String[] strings : res) {
- if (strings.length == 2 && StringUtils.isNotBlank(strings[1])) {
- final String id = strings[0];
- try {
- strings[1] = StringUtils.replace(strings[1], "10-", "1E-", 1);
- final double value = Double.parseDouble(strings[1]);
- values.put(StringUtils.uncapitalize(id), value);
- } catch (final NumberFormatException e) {
- analyze.addError("comparaison.format.error", (Object) id);
- LOGGER.warn("comparaison.format.error in " + file + " for value " + strings[1], e);
- }
- }
- }
- return values;
-
- }
-
- private List<String[]> readFile(final String file, final CtuluAnalyze analyze) {
- InputStream in = null;
- final List<String[]> lines = new ArrayList<String[]>(300);
- try {
- in = ComparaisonValuesLoader.class.getResourceAsStream(file);
- final LineNumberReader reader = new LineNumberReader(new InputStreamReader(in));
- String line = reader.readLine();
- while (line != null) {
- if (line.length() > 0 && line.charAt(0) != '#') {
- lines.add(StringUtils.splitPreserveAllTokens(line, ';'));
- }
-
- line = reader.readLine();
- }
- } catch (final Exception e) {
- analyze.manageException(e);
-
- } finally {
- CtuluLibFile.close(in);
- }
- return lines;
- }
-
-}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -15,6 +15,7 @@
import org.fudaa.dodico.crue.comparaison.config.ConfCompare;
import org.fudaa.dodico.crue.comparaison.tester.FactoryEqualsTester;
import org.fudaa.dodico.crue.comparaison.tester.ResultatTest;
+import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
/**
* @author deniger
@@ -27,8 +28,8 @@
/**
* @param in
*/
- public ExecuteComparaison(final ConfComparaisonConteneur in) {
- this(in, FactoryEqualsTesterSingleton.INSTANCE);
+ public ExecuteComparaison(final ConfComparaisonConteneur in, CruePropertyDefinitionContainer props) {
+ this(in, new FactoryEqualsTester(props));
}
/**
Deleted: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/FactoryEqualsTesterSingleton.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/FactoryEqualsTesterSingleton.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/FactoryEqualsTesterSingleton.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -1,44 +0,0 @@
-/**
- * Licence GPL
- * Copyright Genesis
- */
-package org.fudaa.dodico.crue.comparaison;
-
-import gnu.trove.TObjectDoubleHashMap;
-
-import java.util.Collection;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
-import org.fudaa.ctulu.CtuluAnalyze;
-import org.fudaa.dodico.crue.comparaison.tester.FactoryEqualsTester;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author deniger
- */
-public final class FactoryEqualsTesterSingleton {
- private final static Logger LOGGER = LoggerFactory.getLogger(FactoryEqualsTesterSingleton.class);
-
- /**
- * Singleton sur la factory
- */
- public static final FactoryEqualsTester INSTANCE;
- static {
- final CtuluAnalyze analyze = new CtuluAnalyze();
- final ComparaisonValuesLoader loader = new ComparaisonValuesLoader();
- final TObjectDoubleHashMap res = loader.load(analyze);
- INSTANCE = new FactoryEqualsTester(res);
- if (analyze.containsErrors()) {
- LOGGER.error("can't load ComparaisonValuesLoader");
- Collection<LogRecord> records = analyze.getRecords();
- for (LogRecord logRecord : records) {
- if (logRecord.getLevel() == Level.SEVERE) {
- LOGGER.error(logRecord.getMessage());
- }
- }
- }
- }
-
-}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/AbstractTemplateEqualsTesterDouble.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/AbstractTemplateEqualsTesterDouble.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/AbstractTemplateEqualsTesterDouble.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -1,6 +1,6 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import org.fudaa.dodico.crue.common.CrueNumberUtils;
+import org.fudaa.dodico.crue.property.CrueNumberUtils;
/**
* un template pour comparer des long.
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterInteger.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterInteger.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterInteger.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -1,6 +1,6 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import org.fudaa.dodico.crue.common.CrueNumberUtils;
+import org.fudaa.dodico.crue.property.CrueNumberUtils;
/**
* @author denf01a
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterLong.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterLong.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterLong.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -1,6 +1,6 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import org.fudaa.dodico.crue.common.CrueNumberUtils;
+import org.fudaa.dodico.crue.property.CrueNumberUtils;
/**
* @author denf01a
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -1,7 +1,5 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import gnu.trove.TObjectDoubleHashMap;
-
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -10,6 +8,7 @@
import org.fudaa.dodico.crue.metier.emh.LoiDF;
import org.fudaa.dodico.crue.metier.emh.LoiFF;
import org.fudaa.dodico.crue.metier.emh.PtProfil;
+import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
/**
* @author denf01a
@@ -18,7 +17,7 @@
*/
public class FactoryEqualsTester {
- private final TObjectDoubleHashMap propEps;
+ private final CruePropertyDefinitionContainer propEps;
private final Map<Class, EqualsTesterItemBuilder> knownTesterBuilder;
private final Map<Class, EqualsTester> knownTester;
@@ -28,7 +27,7 @@
/**
* @param propEps la correspondance propertyName->Epsilon
*/
- public FactoryEqualsTester(final TObjectDoubleHashMap propEps) {
+ public FactoryEqualsTester(final CruePropertyDefinitionContainer propEps) {
super();
this.propEps = propEps;
knownTesterBuilder = new HashMap<Class, EqualsTesterItemBuilder>();
@@ -58,7 +57,7 @@
* @return l'epsilon cherche
*/
public double getEpsFor(final String id) {
- return (propEps == null) ? 0 : propEps.get(id);
+ return (propEps == null || !propEps.isPropertyDefined(id)) ? 0 : propEps.getProperty(id).getEpsilon();
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -31,6 +31,7 @@
import org.fudaa.dodico.crue.metier.emh.OrdResScenario;
import org.fudaa.dodico.crue.metier.emh.ParamCalcScenario;
import org.fudaa.dodico.crue.metier.emh.ParamNumModeleBase;
+import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
/**
* @author deniger
@@ -242,4 +243,20 @@
*/
List<EMHBrancheSaintVenant> getBranchesSaintVenant();
+ /**
+ * boolean pour indiquer les fichiers crue 9 contiennent des cartes distmax. Dans ce cas, la lecture des fichiers de resultats ne doivent pas se faire.
+ * @return true si contient distmax
+ */
+ public boolean isCrue9ContientDistmax();
+
+ /**
+ * boolean pour indiquer les fichiers crue 9 contiennent des cartes distmax. Dans ce cas, la lecture des fichiers de
+ * resultats ne doivent pas se faire.
+ *
+ * @param crue9ContientDistmax true si contient distmax
+ */
+ public void setCrue9ContientDistmax(boolean crue9ContientDistmax);
+
+ public CruePropertyDefinitionContainer getCruePropertyDefinitionContainer();
+
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2009-12-10 17:15:06 UTC (rev 5559)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2009-12-11 03:13:54 UTC (rev 5560)
@@ -37,6 +37,7 @@
import org.fudaa.dodico.crue.metier.emh.ParamCalcScenario;
import org.fudaa.dodico.crue.metier.emh.ParamNumModeleBase;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
/**
* CrueData est un conteneur de donn�es Crue, il contient des donnees EMH de chaque cat�gorie pour optimiser leur acc�s.
@@ -92,21 +93,48 @@
// private List<ResPrtGeo> rptg;
- private final EMHScenario scenarioData;
+ final EMHScenario scenarioData;
private final EMHSousModele ssModele;
private final EMHNoeudFactory nodeFactory;
+
/**
+ * boole...
[truncated message content] |
|
From: <de...@us...> - 2009-12-13 23:35:11
|
Revision: 5561
http://fudaa.svn.sourceforge.net/fudaa/?rev=5561&view=rev
Author: deniger
Date: 2009-12-13 23:34:59 +0000 (Sun, 13 Dec 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/EMHRun.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneur.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCLimMCommon.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrt.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrtConteneur.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonGeoLoc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonLoiHYConteneur.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIni.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniBranche.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeo.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModele.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/InfosEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/LitUtile.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdPrtCIniModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdPrtGeoModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheBarrageFilEau.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheBarrageGenerique.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBranchePdc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilLateral.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilTransversal.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheStrickler.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResNoeudNiveauContinu.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionSansGeometrie.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamCalcScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PdtCst.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PtProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtCIni.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeo.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoCasierContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSectionContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtReseau.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaverCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/PropertyValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/io/default-comparaison.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dpti-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDC.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDCSPFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDPTIFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDRSOFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/metier/helper/TestEMHHelper.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractInfosEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2009-12-11 03:13:54 UTC (rev 5560)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2009-12-13 23:34:59 UTC (rev 5561)
@@ -15,6 +15,7 @@
import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.common.CustomPropertyUtilsBeanInstaller;
import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
+import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -128,7 +129,7 @@
if (b != null) {
final EqualsTester resTester = getTesterToUse(o1, name, context, b);
if (resTester == null) { return true; }
- addDiff(res, name, a, b);
+ addDiff(o1, res, name, a, b);
return false;
}
@@ -137,7 +138,7 @@
if (tester == null) { return true; }
final boolean resB = tester.isSame(a, b, null, context);
if (!resB) {
- addDiff(res, name, a, b);
+ addDiff(o1, res, name, a, b);
return false;
}
}
@@ -168,9 +169,11 @@
return propToCompare != null && propToCompare.contains(name);
}
- private void addDiff(final ResultatTest res, final String propName, final Object a, final Object b) {
+ private void addDiff(final Object o1, final ResultatTest res, final String propName, final Object a, final Object b) {
if (res != null) {
- final ResultatTest item = new ResultatTest(a, b, ComparaisonMessages.getString("compare.property.diff", propName));
+ String pref = (o1 instanceof ObjetNomme) ? ((ObjetNomme) o1).getId() + ": " : StringUtils.EMPTY;
+ final ResultatTest item = new ResultatTest(a, b, pref
+ + ComparaisonMessages.getString("compare.property.diff", propName));
item.updatePrint();
res.addDiff(item);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2009-12-11 03:13:54 UTC (rev 5560)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2009-12-13 23:34:59 UTC (rev 5561)
@@ -52,15 +52,15 @@
* @return CrueData correspondant au scenario n'ayant un seul modele
*/
public static CrueData buildConcatFor(final EMHScenario sc) {
- final List<EMHModeleBase> fils = EMHHelper.getEMHInRelationEMHContient(sc, EnumTypeEMH.MODELE);
+ final List<EMHModeleBase> fils = EMHHelper.collectEMHInRelationEMHContient(sc, EnumTypeEMH.MODELE);
if (fils.size() > 1) { return null; }
final EMHModeleBase base = fils.get(0);
- return new CrueDataImpl(sc, base, base.getConcatSousModele());
+ return new CrueDataImpl(sc, base, base.getConcatSousModele(), sc.getPropertyDefinitionContainer());
}
public static CrueData buildConcatFor(final EMHScenario sc, final EMHModeleBase conteneur) {
- return new CrueDataImpl(sc, conteneur, conteneur.getConcatSousModele());
+ return new CrueDataImpl(sc, conteneur, conteneur.getConcatSousModele(), sc.getPropertyDefinitionContainer());
}
@@ -70,13 +70,14 @@
* @param conteneur le conteneur
* @return le crueData qui va bien
*/
- public static CrueData buildFor(final CatEMHConteneur conteneur) {
+ public static CrueData buildFor(final CatEMHConteneur conteneur,
+ final CruePropertyDefinitionContainer propertyDefContainer) {
if (conteneur.getCatType().equals(EnumTypeEMH.SCENARIO)) { return new CrueDataImpl((EMHScenario) conteneur, null,
- ((EMHScenario) conteneur).getConcatSousModele()); }
+ ((EMHScenario) conteneur).getConcatSousModele(), propertyDefContainer); }
if (conteneur.getCatType().equals(EnumTypeEMH.MODELE)) { return new CrueDataImpl(null, (EMHModeleBase) conteneur,
- ((EMHModeleBase) conteneur).getConcatSousModele()); }
+ ((EMHModeleBase) conteneur).getConcatSousModele(), propertyDefContainer); }
if (conteneur.getCatType().equals(EnumTypeEMH.SOUS_MODELE)) { return new CrueDataImpl(null, null,
- (EMHSousModele) conteneur); }
+ (EMHSousModele) conteneur, propertyDefContainer); }
return null;
}
@@ -120,34 +121,39 @@
*
* @param crue9ContientDistmax true si contient distmax
*/
- public void setCrue9ContientDistmax(boolean crue9ContientDistmax) {
+ public void setCrue9ContientDistmax(final boolean crue9ContientDistmax) {
this.crue9ContientDistmax = crue9ContientDistmax;
}
+ final CruePropertyDefinitionContainer propertyDefContainer;
+
/**
* Données STO
*/
private STOSequentialReader sto;
- public CrueDataImpl(CruePropertyDefinitionContainer propertyDefContainer) {
+ public CrueDataImpl(final CruePropertyDefinitionContainer propertyDefContainer) {
this(new EMHNoeudFactory(), propertyDefContainer);
}
- public CrueDataImpl(EMHNoeudFactory nodeFactory, CruePropertyDefinitionContainer propertyDefContainer) {
+ public CrueDataImpl(final EMHNoeudFactory nodeFactory, final CruePropertyDefinitionContainer propertyDefContainer) {
scenarioData = new EMHScenario(propertyDefContainer);
+ this.propertyDefContainer = propertyDefContainer;
ssModele = new EMHSousModele();
modele = new EMHModeleBase();
this.nodeFactory = nodeFactory;
}
- public CrueDataImpl(final EMHScenario scenarioData, final EMHModeleBase modele, final EMHSousModele ssModele) {
+ public CrueDataImpl(final EMHScenario scenarioData, final EMHModeleBase modele, final EMHSousModele ssModele,
+ final CruePropertyDefinitionContainer propertyDefContainer) {
super();
+ this.propertyDefContainer = propertyDefContainer;
this.scenarioData = scenarioData;
this.ssModele = ssModele;
this.modele = modele;
nodeFactory = new EMHNoeudFactory();
if (ssModele != null) {
- List<CatEMHNoeud> noeuds = ssModele.getNoeuds();
+ final List<CatEMHNoeud> noeuds = ssModele.getNoeuds();
if (CollectionUtils.isNotEmpty(noeuds)) {
nodeFactory.addAll(noeuds);
}
@@ -155,10 +161,10 @@
}
public CruePropertyDefinitionContainer getCruePropertyDefinitionContainer() {
- return scenarioData.getPropertyDefinitionContainer();
+ return propertyDefContainer;
}
- public EMHNoeudNiveauContinu createNode(String id) {
+ public EMHNoeudNiveauContinu createNode(final String id) {
return this.nodeFactory.getNode(id);
}
@@ -180,33 +186,33 @@
}
public CatEMHBranche findBrancheByReference(final String ref) {
- return EMHHelper.getEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.BRANCHE);
+ return EMHHelper.selectEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.BRANCHE);
}
public Calc findCalcByNom(final String nom) {
final DonCLimMScenario in = getConditionsLim();
if (in == null) { return null; }
- Calc res = EMHHelper.findObjectNomme(in.getCalcPseudoPerm(), nom);
+ Calc res = EMHHelper.selectObjectNomme(in.getCalcPseudoPerm(), nom);
if (res == null) {
- res = EMHHelper.findObjectNomme(in.getCalcTrans(), nom);
+ res = EMHHelper.selectObjectNomme(in.getCalcTrans(), nom);
}
return res;
}
public CatEMHCasier findCasierByReference(final String ref) {
- return EMHHelper.getEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.CASIER);
+ return EMHHelper.selectEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.CASIER);
}
public EMH findEMHByReference(final String ref) {
- return EMHHelper.getEMHInRelationEMHContientByRef(ssModele, ref);
+ return EMHHelper.selectEMHInRelationEMHContientByRef(ssModele, ref);
}
public CatEMHNoeud findNoeudByReference(final String ref) {
- return EMHHelper.getEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.NOEUD);
+ return EMHHelper.selectEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.NOEUD);
}
public CatEMHSection findSectionByReference(final String ref) {
- return EMHHelper.getEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.SECTION);
+ return EMHHelper.selectEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.SECTION);
}
/**
@@ -225,27 +231,27 @@
}
public List<CatEMHBranche> getBranches() {
- return EMHHelper.getEMHInRelationEMHContient(ssModele, EnumTypeEMH.BRANCHE);
+ return EMHHelper.collectEMHInRelationEMHContient(ssModele, EnumTypeEMH.BRANCHE);
}
public List<EMHBrancheSaintVenant> getBranchesSaintVenant() {
- return EMHHelper.selectClass(EMHHelper.getEMHInRelationEMHContient(ssModele, EnumTypeEMH.BRANCHE),
+ return EMHHelper.collectClass(EMHHelper.collectEMHInRelationEMHContient(ssModele, EnumTypeEMH.BRANCHE),
EMHBrancheSaintVenant.class);
}
public List<CatEMHCasier> getCasiers() {
- return EMHHelper.getEMHInRelationEMHContient(ssModele, EnumTypeEMH.CASIER);
+ return EMHHelper.collectEMHInRelationEMHContient(ssModele, EnumTypeEMH.CASIER);
}
/**
* @return the conditionsLim
*/
public DonCLimMScenario getConditionsLim() {
- return (DonCLimMScenario) EMHHelper.getInfoEMH(scenarioData, EnumInfosEMH.DON_CLIM_SCENARIO);
+ return (DonCLimMScenario) EMHHelper.selectInfoEMH(scenarioData, EnumInfosEMH.DON_CLIM_SCENARIO);
}
public DonFrtConteneur getFrottements() {
- return (DonFrtConteneur) EMHHelper.getInfoEMH(ssModele, EnumInfosEMH.DON_FRT_CONTENEUR);
+ return (DonFrtConteneur) EMHHelper.selectInfoEMH(ssModele, EnumInfosEMH.DON_FRT_CONTENEUR);
}
public DonLoiHYConteneur getLoiConteneur() {
@@ -260,7 +266,7 @@
}
public OrdPrtCIniModeleBase getMethodesInterpolation() {
- return (OrdPrtCIniModeleBase) EMHHelper.getInfoEMH(modele, EnumInfosEMH.ORD_PRT_CINI_MODELE_BASE);
+ return (OrdPrtCIniModeleBase) EMHHelper.selectInfoEMH(modele, EnumInfosEMH.ORD_PRT_CINI_MODELE_BASE);
}
public EMHModeleBase getModele() {
@@ -268,7 +274,7 @@
}
public List<CatEMHNoeud> getNoeuds() {
- return EMHHelper.getEMHInRelationEMHContient(ssModele, EnumTypeEMH.NOEUD);
+ return EMHHelper.collectEMHInRelationEMHContient(ssModele, EnumTypeEMH.NOEUD);
}
/**
@@ -291,11 +297,11 @@
}
public ParamNumModeleBase getParamNumModeleBase() {
- return (ParamNumModeleBase) EMHHelper.getInfoEMH(modele, EnumInfosEMH.PARAM_NUM_MODELE_BASE);
+ return (ParamNumModeleBase) EMHHelper.selectInfoEMH(modele, EnumInfosEMH.PARAM_NUM_MODELE_BASE);
}
public OrdPrtGeoModeleBase getPretraitementsGeom() {
- return (OrdPrtGeoModeleBase) EMHHelper.getInfoEMH(modele, EnumInfosEMH.ORD_PRT_GEO_MODELE_BASE);
+ return (OrdPrtGeoModeleBase) EMHHelper.selectInfoEMH(modele, EnumInfosEMH.ORD_PRT_GEO_MODELE_BASE);
}
// /**
@@ -313,7 +319,7 @@
}
public List<CatEMHSection> getSections() {
- return EMHHelper.getEMHInRelationEMHContient(ssModele, EnumTypeEMH.SECTION);
+ return EMHHelper.collectEMHInRelationEMHContient(ssModele, EnumTypeEMH.SECTION);
}
public EMHSousModele getSousModele() {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java 2009-12-11 03:13:54 UTC (rev 5560)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java 2009-12-13 23:34:59 UTC (rev 5561)
@@ -135,7 +135,7 @@
final List<CatEMHCasier> casiers = data.getCasiers();
if (CollectionUtils.isNotEmpty(casiers)) {
for (final CatEMHCasier casier : casiers) {
- final List<DonCalcSansPrtCasierProfil> listeDoncalc = EMHHelper.selectClass(casier.getDCSP(),
+ final List<DonCalcSansPrtCasierProfil> listeDoncalc = EMHHelper.collectClass(casier.getDCSP(),
DonCalcSansPrtCasierProfil.class);
if (CollectionUtils.isNotEmpty(listeDoncalc)) {
if (listeDoncalc.size() > 1) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2009-12-11 03:13:54 UTC (rev 5560)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2009-12-13 23:34:59 UTC (rev 5561)
@@ -109,7 +109,7 @@
}
}
List<InfosEMH> infosEMH = metier.getSousModele().getInfosEMH();
- final List<DonPrtGeoProfilSection> selectClass = EMHHelper.selectClass(infosEMH, DonPrtGeoProfilSection.class);
+ final List<DonPrtGeoProfilSection> selectClass = EMHHelper.collectClass(infosEMH, DonPrtGeoProfilSection.class);
for (final DonPrtGeoProfilSection donPrtGeoProfilSection : selectClass) {
saveDonPrtGeoProfilSection(analyser, res, listeProfilUniqueReference, donPrtGeoProfilSection);
@@ -308,7 +308,7 @@
// -- recherche de référence au bon DonFrt --//
if (litPersist.Frot != null) {
final String idFrottement = litPersist.Frot.NomRef;
- final DonFrt frottement = EMHHelper.findObjectNomme(frottements, idFrottement);
+ final DonFrt frottement = EMHHelper.selectObjectNomme(frottements, idFrottement);
if (frottement != null) {
litNum.setFrot(frottement);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java 2009-12-11 03:13:54 UTC (rev 5560)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java 2009-12-13 23:34:59 UTC (rev 5561)
@@ -36,7 +36,7 @@
}
@Override
- public ResPrtGeoCasier readResultat() {
+ public ResPrtGeoCasier getResultat() {
return res;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2009-12-11 03:13:54 UTC (rev 5560)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2009-12-13 23:34:59 UTC (rev 5561)
@@ -3,6 +3,7 @@
import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -35,6 +36,7 @@
import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtCasierProfil;
import org.fudaa.dodico.crue.metier.emh.DonFrt;
import org.fudaa.dodico.crue.metier.emh.DonFrtStrickler;
+import org.fudaa.dodico.crue.metier.emh.DonPrtCIniCasierProfil;
import org.fudaa.dodico.crue.metier.emh.DonPrtGeoBatiCasier;
import org.fudaa.dodico.crue.metier.emh.DonPrtGeoBrancheSaintVenant;
import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilCasier;
@@ -74,6 +76,7 @@
import org.fudaa.dodico.crue.metier.emh.PtProfil;
import org.fudaa.dodico.crue.metier.emh.Regle;
import org.fudaa.dodico.crue.metier.emh.RelationEMH;
+import org.fudaa.dodico.crue.metier.emh.RelationEMHBrancheContientSection;
import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBranche;
import org.fudaa.dodico.crue.metier.emh.ValParamEntier;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
@@ -325,9 +328,9 @@
final List<RelationEMHSectionDansBranche> sectionEMH = branche.getListeSections();
if (CollectionUtils.isEmpty(sectionEMH)) { return; }
- branche.getRelationEMH().removeAll(sectionEMH);
+ branche.removeAllRelations(sectionEMH);
// branche.getRelationEMH().add(relation2);
- branche.getRelationEMH().add(sectionEMH.get(0));
+ branche.addRelationEMH(sectionEMH.get(0));
for (int i = 0; i < sectionEMH.size() - 1; i++) {
final RelationEMHSectionDansBranche relation1 = sectionEMH.get(i);
// -- si la relation concerne les sections --//
@@ -359,12 +362,12 @@
.getCruePropertyDefinitionContainer());
// -- ajout dans metier --//
data.add(interpol);
- branche.getRelationEMH().add(relation);
+ branche.addRelationEMH(relation);
}
}
- branche.getRelationEMH().add(relation2);
+ branche.addRelationEMH(relation2);
}
}
@@ -519,7 +522,7 @@
List<PtEvolutionFF> listePoints = new ArrayList<PtEvolutionFF>();
listeEvolution.setPtEvolutionFF(listePoints);
LoiFF newLoi = new LoiFF();
- newLoi.setNom(CruePrefix.getNom(EnumTypeLoi.LoiQZam, idBranche));
+ newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQZam));
newLoi.setType(EnumTypeLoi.LoiQZam);
newLoi.setEvolutionFF(listeEvolution);
dataDCSP.setLoiQZam(newLoi);
@@ -527,7 +530,7 @@
listePoints = new ArrayList<PtEvolutionFF>();
listeEvolution.setPtEvolutionFF(listePoints);
newLoi = new LoiFF();
- newLoi.setNom(CruePrefix.getNom(EnumTypeLoi.LoiQDz, idBranche));
+ newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQDz));
newLoi.setType(EnumTypeLoi.LoiQDz);
newLoi.setEvolutionFF(listeEvolution);
dataDCSP.setLoiQDz(newLoi);
@@ -861,7 +864,9 @@
branche.addInfosEMH(dataDCSP);
// -- la donnée DPTG de st venant --//
- DonPrtGeoBrancheSaintVenant dataDPTG = null;
+ final DonPrtGeoBrancheSaintVenant dataDPTG = new DonPrtGeoBrancheSaintVenant(metier
+ .getCruePropertyDefinitionContainer());
+ branche.addInfosEMH(dataDPTG);
// String nomSectionPilote = null;
double distMAX = 0;
// -- la liste des sections branches --//
@@ -940,7 +945,7 @@
// -- SINUO de DCSP--//
if (typeLigne.toUpperCase().equals(CrueIODico.BRANCHE_SINUO)) {
// -- concerne données DPTG --//
- dataDPTG = new DonPrtGeoBrancheSaintVenant(metier.getCruePropertyDefinitionContainer());
+
// ex SINUO 600.0 500.0 (si LongMineur = 600 m et LongMajeur = 500 m) :
final double longMineur = in_.doubleField(1);
@@ -948,7 +953,6 @@
final double coeff = longMineur / longMajeur;
dataDPTG.setCoefSinuo(coeff);
- branche.addInfosEMH(dataDPTG);
} else {
errorCarteNotRecognized(typeLigne);
@@ -1320,6 +1324,8 @@
newCasier.setNoeud(noeudRef);
}
+ // on ajoute la valeur par défaut pour dpti:
+ newCasier.addInfosEMH(new DonPrtCIniCasierProfil(metier.getCruePropertyDefinitionContainer()));
metier.add(newCasier);
// -- listes des X/Z --//
@@ -1573,7 +1579,7 @@
// -- on recherche la reference du frottement sinon on ajoute --//
DonFrt frottements = null;
if (metier.getFrottements() != null) {
- frottements = EMHHelper.findDFRTByReference(reference, metier.getFrottements());
+ frottements = EMHHelper.selectDFRTByReference(reference, metier.getFrottements());
}
// -- ajout du frottements associé au profil --//
if (frottements != null) {
@@ -2051,6 +2057,7 @@
metier.add(sectionCree);
} else {
replaceSection(metier, sectionToreplace, sectionCree);
+
}
lireSuite();
// // -- on remplace les relations et les infos emh --//
@@ -2088,13 +2095,19 @@
private void replaceSection(final CrueData metier, final CatEMHSection sectionToreplace,
final CatEMHSection newSection) {
if (sectionToreplace != null) {
- final List<RelationEMH> relationContenant = EMHHelper.getDeepRelationEMHsByRef(metier.getSousModele(),
+ final List<RelationEMH> relationContenant = EMHHelper.collectDeepRelationEMHsByRef(metier.getSousModele(),
sectionToreplace.getNom());
if (relationContenant != null) {
for (final RelationEMH relationEMH : relationContenant) {
relationEMH.setEmh(newSection);
}
}
+ // on met a jour les relations.
+ Collection<RelationEMHBrancheContientSection> findRelationOfType = EMHHelper.selectRelationOfType(
+ sectionToreplace, RelationEMHBrancheContientSection.class);
+ for (RelationEMHBrancheContientSection relationToChange : findRelationOfType) {
+ newSection.addRelationEMH(relationToChange);
+ }
// EMHBrancheHelper.replaceSectioninAllConnectedBranche(sectionToreplace, newSection, metier.getBranches());
// metier.getSections().remove(sectionToreplace);
}
@@ -2164,11 +2177,13 @@
} else if (upperCase.equals(CrueIODico.R_DXMAX)) {
regle = new Regle(EnumRegle.PDX_MAX);
regle.setActive(true);
- regle.setValParam(new ValParamEntier(regle.getValParamNom(), (int) in_.doubleField(1)));
+ // regle.setValParam(new ValParamEntier(regle.getValParamNom(), (int) in_.doubleField(1)));
+ regle.setSeuilDetect(in_.doubleField(1));
} else if (upperCase.equals(CrueIODico.R_VDXMAX)) {
regle = new Regle(EnumRegle.VAR_PDX_MAX);
regle.setActive(true);
regle.setValParam(new ValParamEntier(regle.getValParamNom(), (int) in_.doubleField(1)));
+ // regle.setSeuilDetect(in_.doubleField(1));
} else if (upperCase.equals(CrueIODico.R_PENMAX)) {
regle = new Regle(EnumRegle.PENTE_MAX);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2009-12-11 03:13:54 UTC (rev 5560)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2009-12-13 23:34:59 UTC (rev 5561)
@@ -237,7 +237,6 @@
} else if (EnumRegle.VAR_PDX_MAX.equals(regle.getType())) {
final ValParamEntier val = (Val...
[truncated message content] |
|
From: <de...@us...> - 2009-12-22 01:55:02
|
Revision: 5570
http://fudaa.svn.sourceforge.net/fudaa/?rev=5570&view=rev
Author: deniger
Date: 2009-12-22 01:54:50 +0000 (Tue, 22 Dec 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/TesterHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/Crue10FileFormat.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterPNUM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructure.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCSP.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDFRT.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDLHY.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTI.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDRSO.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureETU.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureOCAL.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureOPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureOPTI.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureORES.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructurePCAL.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructurePNUM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/EMHProjet.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermBrancheOrificeManoeuvre.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermBrancheSaintVenantQruis.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermCasierProfilQruis.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermNoeudNiveauContinuQapp.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPermNoeudNiveauContinuZimpose.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcTransBrancheOrificeManoeuvre.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DefaultValues.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheBarrageFilEau.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheBarrageGenerique.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheNiveauxAssocies.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheQ.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniBranche.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniBrancheOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniNoeudNiveauContinu.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtCIniSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoBatiCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoProfilCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoProfilSectionFenteData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoSectionIdem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemPdt.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemSeuil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemSeuilAvecPdc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumTypeLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdPrtGeoModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamCalcScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumCalcPseudoPerm.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumCalcTrans.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PlanimetrageNbrPdzCst.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/RelationEMHSectionDansBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMHRelation.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderNature.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderProperty.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueNumberParser.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/PropertyValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ScenarioWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateModeleScenarioWithSchema.java
trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/crue-nature.csv
trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/configLoi-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-common-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dcsp-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dfrt-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/scenario-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestComparaisonFactory.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestEqualsTesterLoi.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestExecuteComparaison.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/AbstractIOTestCase.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestConfigLoiReader.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDCLMFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDFRTFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDLHYFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueOCALFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/common/TestCrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/property/TestCrueNatureAndPropertyLoader.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/ExampleValidationVariableBuilder.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestValidateModeleScenario.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3-1.dcsp.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dlhy.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele4.dcsp.xml
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueTreeProject.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CrueEditorImplementation.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/CrueProjet.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderConfigLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderProperties.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderPropertiesDefault.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueProperties.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CruePropertyContext.java
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dlhy-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueOPTGFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueOPTIFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueORESFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCruePCALFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCruePNUMFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueSTO.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueSTR.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/EMHHelper/
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueConfigLoiLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CruePropertyDefinitionContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CruePropertyDefinitionNatureLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CruePropertyDefinitionNatureLoaderDefault.java
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dfrt-1.0.0.xsd.svntmp
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueOCALFile.java.svntmp
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -15,7 +15,7 @@
import org.fudaa.dodico.crue.comparaison.config.ConfCompare;
import org.fudaa.dodico.crue.comparaison.tester.FactoryEqualsTester;
import org.fudaa.dodico.crue.comparaison.tester.ResultatTest;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* @author deniger
@@ -28,7 +28,7 @@
/**
* @param in
*/
- public ExecuteComparaison(final ConfComparaisonConteneur in, CruePropertyDefinitionContainer props) {
+ public ExecuteComparaison(final ConfComparaisonConteneur in, CrueProperties props) {
this(in, new FactoryEqualsTester(props));
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -15,6 +15,7 @@
import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.common.CustomPropertyUtilsBeanInstaller;
import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
+import org.fudaa.dodico.crue.metier.emh.InfosEMH;
import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -156,7 +157,11 @@
*/
private EqualsTester getTesterToUse(final Object parentObject, final String name, final TesterContext context,
final Object init) {
+ if ("emh".equals(name)) {
+ if (parentObject instanceof InfosEMH) { return null; }
+ }
final EqualsTester tester = factory.buildTesterFor(parentObject.getClass(), init.getClass(), name);
+
final boolean isComplexTest = TesterContextImpl.isComplexEqualsTester(tester);
if (isComplexTest) {
// la comparaison a été demandée explicitement par le user.
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -8,7 +8,7 @@
import org.fudaa.dodico.crue.metier.emh.LoiDF;
import org.fudaa.dodico.crue.metier.emh.LoiFF;
import org.fudaa.dodico.crue.metier.emh.PtProfil;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* @author denf01a
@@ -17,9 +17,9 @@
*/
public class FactoryEqualsTester {
- private final CruePropertyDefinitionContainer propEps;
+ private final CrueProperties propEps;
- public CruePropertyDefinitionContainer getPropEps() {
+ public CrueProperties getPropEps() {
return propEps;
}
@@ -31,7 +31,7 @@
/**
* @param propEps la correspondance propertyName->Epsilon
*/
- public FactoryEqualsTester(final CruePropertyDefinitionContainer propEps) {
+ public FactoryEqualsTester(final CrueProperties propEps) {
super();
this.propEps = propEps;
knownTesterBuilder = new HashMap<Class, EqualsTesterItemBuilder>();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/TesterHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/TesterHelper.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/TesterHelper.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -4,7 +4,7 @@
import java.util.Iterator;
import org.apache.commons.collections.CollectionUtils;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* Methode utilitaire pour comparer des données
@@ -22,7 +22,7 @@
* @param props
* @return true si null, de taille 1 ou si tous les elements sont egaux.
*/
- public static boolean isSame(final Collection toCompare, final CruePropertyDefinitionContainer props) {
+ public static boolean isSame(final Collection toCompare, final CrueProperties props) {
if (CollectionUtils.isEmpty(toCompare) || toCompare.size() == 1) { return true; }
final Iterator it = toCompare.iterator();
final Object first = it.next();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/Crue10FileFormat.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/Crue10FileFormat.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/Crue10FileFormat.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -12,7 +12,7 @@
import org.fudaa.dodico.crue.io.common.CrueFileType;
import org.fudaa.dodico.crue.io.common.CrueIOResu;
import org.fudaa.dodico.crue.io.dao.CrueXmlReaderWriter;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
import com.memoire.bu.BuFileFilter;
@@ -220,7 +220,7 @@
// }
public final boolean writeMetierDirect(final M metier, final File f, final CtuluAnalyze analyzer,
- CruePropertyDefinitionContainer props) {
+ CrueProperties props) {
return readerWriter.writeXMLMetier(new CrueIOResu<M>(metier), f, analyzer, props);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -31,7 +31,7 @@
import org.fudaa.dodico.crue.metier.emh.OrdResScenario;
import org.fudaa.dodico.crue.metier.emh.ParamCalcScenario;
import org.fudaa.dodico.crue.metier.emh.ParamNumModeleBase;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* @author deniger
@@ -257,6 +257,6 @@
*/
public void setCrue9ContientDistmax(boolean crue9ContientDistmax);
- public CruePropertyDefinitionContainer getCruePropertyDefinitionContainer();
+ public CrueProperties getCruePropertyDefinitionContainer();
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -37,7 +37,7 @@
import org.fudaa.dodico.crue.metier.emh.ParamCalcScenario;
import org.fudaa.dodico.crue.metier.emh.ParamNumModeleBase;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* CrueData est un conteneur de donn�es Crue, il contient des donnees EMH de chaque cat�gorie pour optimiser leur acc�s.
@@ -71,7 +71,7 @@
* @return le crueData qui va bien
*/
public static CrueData buildFor(final CatEMHConteneur conteneur,
- final CruePropertyDefinitionContainer propertyDefContainer) {
+ final CrueProperties propertyDefContainer) {
if (conteneur.getCatType().equals(EnumTypeEMH.SCENARIO)) { return new CrueDataImpl((EMHScenario) conteneur, null,
((EMHScenario) conteneur).getConcatSousModele(), propertyDefContainer); }
if (conteneur.getCatType().equals(EnumTypeEMH.MODELE)) { return new CrueDataImpl(null, (EMHModeleBase) conteneur,
@@ -125,18 +125,18 @@
this.crue9ContientDistmax = crue9ContientDistmax;
}
- final CruePropertyDefinitionContainer propertyDefContainer;
+ final CrueProperties propertyDefContainer;
/**
* Données STO
*/
private STOSequentialReader sto;
- public CrueDataImpl(final CruePropertyDefinitionContainer propertyDefContainer) {
+ public CrueDataImpl(final CrueProperties propertyDefContainer) {
this(new EMHNoeudFactory(), propertyDefContainer);
}
- public CrueDataImpl(final EMHNoeudFactory nodeFactory, final CruePropertyDefinitionContainer propertyDefContainer) {
+ public CrueDataImpl(final EMHNoeudFactory nodeFactory, final CrueProperties propertyDefContainer) {
scenarioData = new EMHScenario(propertyDefContainer);
this.propertyDefContainer = propertyDefContainer;
ssModele = new EMHSousModele();
@@ -145,7 +145,7 @@
}
public CrueDataImpl(final EMHScenario scenarioData, final EMHModeleBase modele, final EMHSousModele ssModele,
- final CruePropertyDefinitionContainer propertyDefContainer) {
+ final CrueProperties propertyDefContainer) {
super();
this.propertyDefContainer = propertyDefContainer;
this.scenarioData = scenarioData;
@@ -160,7 +160,7 @@
}
}
- public CruePropertyDefinitionContainer getCruePropertyDefinitionContainer() {
+ public CrueProperties getCruePropertyDefinitionContainer() {
return propertyDefContainer;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -1,16 +1,16 @@
package org.fudaa.dodico.crue.io.dao;
-import com.thoughtworks.xstream.XStream;
-
import org.fudaa.dodico.crue.io.common.AbstractSingleConverter;
import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
import org.fudaa.dodico.crue.metier.emh.Loi;
import org.fudaa.dodico.crue.metier.emh.PtEvolutionFF;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.thoughtworks.xstream.XStream;
+
/**
* Classe abstraite qui permet de factoriser les attributs communs de toutes les lois
*/
@@ -35,9 +35,9 @@
private static final class EnumTypeLoiConverter extends AbstractSingleConverter {
- final CruePropertyDefinitionContainer crueProps;
+ final CrueProperties crueProps;
- public EnumTypeLoiConverter(CruePropertyDefinitionContainer crueProps) {
+ public EnumTypeLoiConverter(CrueProperties crueProps) {
super();
assert crueProps != null;
this.crueProps = crueProps;
@@ -64,10 +64,10 @@
private final static SingleConverterPointFF POINT_FF = new SingleConverterPointFF();
- public static void configureXstream(final XStream xstream, CruePropertyDefinitionContainer data) {
+ public static void configureXstream(final XStream xstream, CrueProperties data) {
xstream.alias("EvolutionFF", EvolutionFF.class);
xstream.alias("PointFF", PtEvolutionFF.class);
- xstream.aliasAttribute(AbstractDaoLoi.class, "Type", "xsi:type");
+ // xstream.aliasAttribute(AbstractDaoLoi.class, "Type", "xsi:type");
xstream.useAttributeFor(AbstractDaoLoi.class, "Type");
xstream.useAttributeFor(AbstractDaoLoi.class, "Nom");
xstream.registerConverter(POINT_FF);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterPNUM.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterPNUM.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterPNUM.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -21,7 +21,7 @@
import org.fudaa.dodico.crue.metier.emh.Pdt;
import org.fudaa.dodico.crue.metier.emh.PdtCst;
import org.fudaa.dodico.crue.metier.emh.PdtVar;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* Classe qui se charge de remplir les structures DAO du fichier PNUM avec les donnees metier et inversement.
@@ -66,7 +66,7 @@
return dao;
}
- private Pdt daoToMetierPdt(final DaoPdt daoPdt, CruePropertyDefinitionContainer defs) {
+ private Pdt daoToMetierPdt(final DaoPdt daoPdt, CrueProperties defs) {
if (daoPdt == null) { return null; }
if (daoPdt.PdtCst == null) {
final PdtVar var = new PdtVar();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructure.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructure.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructure.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -4,7 +4,7 @@
package org.fudaa.dodico.crue.io.dao;
import org.fudaa.ctulu.CtuluAnalyze;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
import com.thoughtworks.xstream.XStream;
@@ -20,6 +20,6 @@
* @param analyze l'anayze recevant les erreurs
* @param props les propriétés utilisées pour récuperer les types de loi.
*/
- void configureXStream(XStream xstream, CtuluAnalyze analyze, CruePropertyDefinitionContainer props);
+ void configureXStream(XStream xstream, CtuluAnalyze analyze, CrueProperties props);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -11,7 +11,7 @@
import org.fudaa.dodico.crue.io.common.CrueFileType;
import org.fudaa.dodico.crue.io.common.EnumsConverter;
import org.fudaa.dodico.crue.metier.emh.EnumSensOuv;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* Structures utilisees dans la classe CrueDaoPersistDCLM
@@ -26,7 +26,7 @@
*
* @param xstream Parser XML
*/
- public void configureXStream(final XStream xstream, CtuluAnalyze analyze, CruePropertyDefinitionContainer props) {
+ public void configureXStream(final XStream xstream, CtuluAnalyze analyze, CrueProperties props) {
xstream.alias(CrueFileType.DCLM.toString(), CrueDaoDCLM.class);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCSP.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCSP.java 2009-12-21 16:02:40 UTC (rev 5569)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCSP.java 2009-12-22 01:54:50 UTC (rev 5570)
@@ -7,7 +7,7 @@
import org.fudaa.dodico.crue.io.common.EnumsConverter;
import org.fudaa.dodico.crue.metier.emh.EnumFormulePdc;
import org.fudaa.dodico.crue.metier.emh.EnumSensOrifice;
-import org.fudaa.dodico.crue.property.CruePropertyDefinitionContainer;
+import org.fudaa.dodico.crue.property.CrueProperties;
import com.thoughtworks.xstream.XS...
[truncated message content] |
|
From: <de...@us...> - 2009-12-23 02:48:52
|
Revision: 5571
http://fudaa.svn.sourceforge.net/fudaa/?rev=5571&view=rev
Author: deniger
Date: 2009-12-23 02:48:43 +0000 (Wed, 23 Dec 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterIsIncludeCollection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTI.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTI.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractInfosEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneur.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCLimMCommon.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHModeleEnchainement.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModeleEnchainement.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumInfosEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumCalcPseudoPerm.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumCalcTrans.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ParamNumCalcVraiPerm.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ValParam.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ValParamBooleen.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ValParamDouble.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ValParamEntier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateConnectionModele.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/io/default-comparaison.xml
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/metier/emh/TestCatEMHNoeud.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueScenarioBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueTreeProject.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleScenarioManager.java
Added Paths:
-----------
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/AbstractTreeNode.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/TreeNodeCleValeur.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/TreeNodeEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/TreeNodeString.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterIsIncludeCollection.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterIsIncludeCollection.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterIsIncludeCollection.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -57,12 +57,6 @@
@Override
public boolean isSameSafe(final Collection o1, final Collection o2, final ResultatTest res, TesterContext context)
throws Exception {
- // if (o1.size() != o2.size()) {
- // if (res != null) {
- // res.addFils(new ComparaisonResult(o1.size(), o2.size(), "comparaison.collection.size"));
- // }
- // return false;
- // }
final String[] prop = StringUtils.split(propName, ",");
final Set propInA = ConvertSelectOnItemMerge.getSet(o1, prop);
propInA.remove(null);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTI.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTI.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTI.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -209,12 +209,7 @@
branchePersist = new BrancheBarrageFilEau();
} else if (branche instanceof EMHBrancheBarrageGenerique) {
branchePersist = new BrancheBarrageGenerique();
- }
- // else if (branche instanceof EMHBrancheBarrageRhone) {
- // final EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche;
- // branchePersist = new BrancheBarrageRhone();
- // }
- else if (branche instanceof EMHBrancheEnchainement) {
+ } else if (branche instanceof EMHBrancheEnchainement) {
branchePersist = new BrancheEnchainement();
} else if (branche instanceof EMHBrancheNiveauxAssocies) {
branchePersist = new BrancheNiveauxAssocies();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -242,7 +242,7 @@
if (branchePersist != null) {
// -- commun --//
final BrancheAbstract br = branchePersist;
- br.IsActive = branche.getActive();
+ br.IsActive = branche.getUserActive();
br.Nom = branche.getNom();
if (branche.getNoeudAmont() != null) {
br.NdAm = new NdAm(branche.getNoeudAmont().getNom());
@@ -336,7 +336,7 @@
if (branche != null) {
// -- commun --//
- branche.setActive(branchePersist.IsActive);
+ branche.setUserActive(branchePersist.IsActive);
// branche.setNom(branchePersist.Nom);
if (branchePersist.NdAm != null) {
final CatEMHNoeud noeudAmont = res.findNoeudByReference(branchePersist.NdAm.NomRef);
@@ -408,7 +408,7 @@
}
// -- commun --//
if (casierPersist != null) {
- casierPersist.IsActive = casier.getActive();
+ casierPersist.IsActive = casier.getUserActive();
if (casier.getNoeud() != null) {
casierPersist.Noeud = new ReferenceNoeud(casier.getNoeud().getNom());
}
@@ -468,7 +468,7 @@
// -- commun aux objets --//
if (casier != null) {
- casier.setActive(casierPersist.IsActive);
+ casier.setUserActive(casierPersist.IsActive);
if (casierPersist.Noeud != null) {
final String reference = casierPersist.Noeud.NomRef;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTI.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTI.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTI.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -58,9 +58,10 @@
xstream.alias("DonPrtCIniBranche", BrancheStrickler.class);
xstream.alias("DonPrtCIniBranche", BrancheSeuilTransversal.class);
xstream.alias("DonPrtCIniBranche", BrancheBarrageFilEau.class);
+ xstream.alias("DonPrtCIniBranche", BrancheNiveauxAssocies.class);
xstream.alias("DonPrtCIniBranche", BranchePdc.class);
- xstream.alias("BrancheNiveauxAssocies", BrancheNiveauxAssocies.class);
+ // xstream.alias("BrancheNiveauxAssocies", BrancheNiveauxAssocies.class);
// -- mettre attribut Nom comme attribut de la balise branche,noeud et section et son converter appropri� --//
// -- mettre le nom de la branche dans la balise --//
xstream.useAttributeFor(BrancheAbstract.class, "NomRef");
@@ -134,124 +135,6 @@
protected static class BrancheNiveauxAssocies extends BrancheAbstract {}
- // /**
- // * le converter abstract pour les branches. Il faudra ensuite en d�clarer un pour chaque type de branche afin de
- // cr�er
- // * le bon type de modele.
- // *
- // * @author Adrien Hadoux
- // */
- // private static abstract class BrancheConverter implements SingleValueConverter {
- // public String toString(final Object obj) {
- // return ((BrancheAbstract) obj).NomRef;
- // }
- //
- // public abstract Object fromString(String name);
- //
- // public boolean canConvert(final Class type) {
- // return type.isInstance(BrancheAbstract.class);
- // }
- // }
- //
- // private static class BrancheSaintVenantConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheSaintVenant branche = new BrancheSaintVenant();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheSeuilLateralConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheSeuilLateral branche = new BrancheSeuilLateral();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheStricklerConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheStrickler branche = new BrancheStrickler();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheOrificeConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheOrifice branche = new BrancheOrifice();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheSeuilTransversalConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheSeuilTransversal branche = new BrancheSeuilTransversal();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheBarrageFilEauConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheBarrageFilEau branche = new BrancheBarrageFilEau();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BranchePdcConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BranchePdc branche = new BranchePdc();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheBarrageGeneriqueConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheBarrageGenerique branche = new BrancheBarrageGenerique();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheBarrageRhoneConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheBarrageRhone branche = new BrancheBarrageRhone();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheEnchainementConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheEnchainement branche = new BrancheEnchainement();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
- //
- // private static class BrancheNiveauxAssociesConverter extends BrancheConverter {
- // @Override
- // public Object fromString(final String name) {
- // final BrancheNiveauxAssocies branche = new BrancheNiveauxAssocies();
- // branche.NomRef = name;
- // return branche;
- // }
- // }
-
// *************************GESTION DES CASIERS *************************
protected static class CasierAbstract {
protected String NomRef;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -81,8 +81,8 @@
import org.fudaa.dodico.crue.metier.emh.ValParamEntier;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.metier.helper.FactoryEMH;
+import org.fudaa.dodico.crue.property.CrueLoaderPropertiesDefault;
import org.fudaa.dodico.crue.property.CrueNumberUtils;
-import org.fudaa.dodico.crue.property.CrueLoaderPropertiesDefault;
import org.fudaa.dodico.crue.validation.CruePrefix;
/**
@@ -282,17 +282,26 @@
for (final int indiceLitActif : listeLitsActifs) {
if (indiceLitActif == cpt) {
lit.setIsLitActif(true);
+ break;
}
}
}
// -- ajout du lit dans dptg --//
- dataDPTG.getLitNumerote().add(lit);
+ dataDPTG.addLitNumerote(lit);
litPrecedent = lit;
cpt++;
}
// -- on ajoute la limite fin du dernier elt, puisque les dernier elt n sont les premiers des n+1--//
if (listeLits.size() > 0) {
+ // for (LitNumerote lit : listeLits) {
+ // if (lit.getNomLit() != null && "MAJG".equals(lit.getNomLit().getNom())) {
+ // System.err.println(sectionProfil.getId() + "-->aie " + lit.getIsLitActif());
+ //
+ // }
+ //
+ // }
+
LitNumerote lastLit = listeLits.get(listeLits.size() - 1);
// si pas de limite de définies, le lit est definit avec le premier et dernier point:
// question de fred: normalement listLits.size doit valoir 1 ici avec LimDeb null pour ce lit
@@ -719,11 +728,9 @@
final String typeLigne = in_.stringField(0);
if (typeLigne.toUpperCase().equals(CrueIODico.BRANCHE_CCTRMAX)) {
- // if (elementOrifice != null) {
- // listeElem.add(elementOrifice);
- //
- // }
- elementOrifice = new ElemOrifice(metier.getCruePropertyDefinitionContainer());
+ if (elementOrifice == null) {
+ elementOrifice = new ElemOrifice(metier.getCruePropertyDefinitionContainer());
+ }
// ex CCTRMAX 0.65
final double coeff = in_.doubleField(1);
elementOrifice.setCoefCtrLim(coeff);
@@ -732,18 +739,13 @@
if (elementOrifice == null) {
elementOrifice = new ElemOrifice(metier.getCruePropertyDefinitionContainer());
}
- // * Zrad Haut Larg Cdeb Sens
- // ex CLAPET 3.00 1.50 20.0 0.90 0
- final double zrad = in_.doubleField(1);
- final double haut = in_.doubleField(2);
- final double larg = in_.doubleField(3);
- final double cdeb = in_.doubleField(4);
final String sens = CtuluLibString.getString((int) in_.doubleField(5));
-
- elementOrifice.setHaut(haut);
- elementOrifice.setLargeur(larg);
- elementOrifice.setZseuil(zrad);
- elementOrifice.setCoefD(cdeb);
+ elementOrifice.setZseuil(in_.doubleField(1));
+ elementOrifice.setHaut(in_.doubleField(2));
+ elementOrifice.setLargeur(in_.doubleField(3));
+ if (in_.getNumberOfFields() > 4) {
+ elementOrifice.setCoefD(in_.doubleField(4));
+ }
final EnumSensOrifice enumSens = (EnumSensOrifice) this.enumSensOrificeMapCrue9.fromString(sens);
// if (enumSens == null) {
// analyze_.addFatalError(EnumsConverter.CODE_CONVERT_ENUM_ERROR, sens);
@@ -1051,7 +1053,9 @@
final ElemSeuilAvecPdc seuil = new ElemSeuilAvecPdc(metier.getCruePropertyDefinitionContainer());
seuil.setLargeur(in_.doubleField(1));
seuil.setZseuil(in_.doubleField(2));
- seuil.setCoefD(in_.doubleField(3));
+ if (in_.getNumberOfFields() > 3) {
+ seuil.setCoefD(in_.doubleField(3));
+ }
// lecture de cpert
if (in_.getNumberOfFields() > 4) {
seuil.setCoefPdc(in_.doubleField(4));
@@ -1137,7 +1141,9 @@
final ElemSeuilAvecPdc seuil = new ElemSeuilAvecPdc(metier.getCruePropertyDefinitionContainer());
seuil.setLargeur(in_.doubleField(1));
seuil.setZseuil(in_.doubleField(2));
- seuil.setCoefD(in_.doubleField(3));
+ if (in_.getNumberOfFields() > 3) {
+ seuil.setCoefD(in_.doubleField(3));
+ }
// -- ajout du seuil --//
dataDCSP.addElemSeuilAvecPdc(seuil);
// }
@@ -1316,7 +1322,7 @@
final EMHCasierProfil newCasier = new EMHCasierProfil(CruePrefix.changePrefix(idNoeud, CruePrefix.P_NOEUD,
CruePrefix.P_CASIER));
- newCasier.setActive(true);
+ newCasier.setUserActive(true);
CatEMHNoeud noeudRef = metier.findNoeudByReference(idNoeud);
if (noeudRef == null) {
@@ -1745,7 +1751,7 @@
if (branche != null) {
branche.setNoeudAmont(noeudAmont);
branche.setNoeudAval(noeudAval);
- branche.setActive(true);
+ branche.setUserActive(true);
metier.add(branche);
} else {
@@ -1755,7 +1761,7 @@
if (branche != null) {
branche.setNoeudAmont(noeudAmont);
branche.setNoeudAval(noeudAval);
- branche.setActive(true);
+ branche.setUserActive(true);
metier.add(branche);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -391,7 +391,7 @@
} else {
for (final CatEMHCasier casier : metier.getCasiers()) {
- if (casier.getActive()) {
+ if (casier.getUserActive()) {
// -- ecriture du nom du Noeud associé au casier --//
// ex CASIER N6
fortranWriter.stringField(0, CrueIODico.CASIER_TYPE);
@@ -1144,8 +1144,8 @@
indiceFortran = 0;
fortranWriter.stringField(indiceFortran++, CrueIODico.BRANCHE_DZQ);
}
+ fortranWriter.doubleField(indiceFortran++, pt.getY());
fortranWriter.doubleField(indiceFortran++, pt.getX());
- fortranWriter.doubleField(indiceFortran++, pt.getY());
}
fortranWriter.writeFields();
}
@@ -1367,7 +1367,7 @@
for (final CatEMHBranche branche : data.getBranches()) {
// -- on ecrit au format crue 9 que si la branche est active --//
- if (branche.getActive()) {
+ if (branche.getUserActive()) {
// -- le type de la branche --//
int typeBranche = -1;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -921,7 +921,7 @@
final CalcPseudoPerm calcPerm = new CalcPseudoPerm();
- calcPerm.setNom(CruePrefix.P_CALCUL + (nbEtatPermanent + 1));
+ calcPerm.setNom(CruePrefix.P_CALCUL + "P" + (nbEtatPermanent + 1));
calcPerm.setDescription("Calcul permanent " + (nbEtatPermanent + 1));
// pour le premier on prend en compte la reprise éventuelle
boolean first = ocal.getOrdCalc().isEmpty();
@@ -1183,7 +1183,7 @@
// Un seul calcul transitoire possible en version crue 9
final CalcTrans calcTrans = new CalcTrans();
- calcTrans.setNom(CruePrefix.P_CALCUL + "Trans1");
+ calcTrans.setNom(CruePrefix.P_CALCUL + "T1");
calcTrans.setDescription("Calcul transitoire 1");
dclm.addCalcTrans(calcTrans);
final OrdCalcTransIniCalcPrecedent prec = new OrdCalcTransIniCalcPrecedent();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -441,7 +441,7 @@
nbCaractWritten = 0;
for (final CatEMHNoeud noeud : noeuds) {
final CatEMHCasier casier = noeud.getCasier();
- if (casier == null || !casier.getActive()) {
+ if (casier == null || !casier.getUserActive()) {
continue;
}
final List<DonCalcSansPrtCasierProfil> dcsps = EMHHelper.collectClass(casier.getInfosEMH(),
@@ -569,7 +569,7 @@
double res = 0;
final double eps = data.getCruePropertyDefinitionContainer().getEpsilon("coefRuisQdm");
for (final EMHBrancheSaintVenant brancheSaintVenant : branchesSaintVenant) {
- if (brancheSaintVenant.getActive()) {
+ if (brancheSaintVenant.getUserActive()) {
final List<DonCalcSansPrtBrancheSaintVenant> dcsps = EMHHelper.collectClass(brancheSaintVenant.getInfosEMH(),
DonCalcSansPrtBrancheSaintVenant.class);
for (final DonCalcSansPrtBrancheSaintVenant dcsp : dcsps) {
@@ -605,7 +605,7 @@
for (int j = 1, jmax = calcQruis.size(); j < jmax; j++) {
final CalcPseudoPermBrancheSaintVenantQruis brancheSV = calcQruis.get(j);
- if (((CatEMHActivable) brancheSV.getEmh()).getActive()) {
+ if (((CatEMHActivable) brancheSV.getEmh()).getUserActive()) {
if (!qruisSet) {
qruisSet = true;
qruis = brancheSV.getQruis();
@@ -621,7 +621,7 @@
for (int j = 1, jmax = calcCasierQruis.size(); j < jmax; j++) {
final CalcPseudoPermCasierProfilQruis casier = calcCasierQruis.get(j);
- if (((CatEMHActivable) casier.getEmh()).getActive()) {
+ if (((CatEMHActivable) casier.getEmh()).getUserActive()) {
if (!qruisSet) {
qruisSet = true;
qruis = casier.getQruis();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -15,6 +15,9 @@
import org.apache.commons.lang.ArrayUtils;
import org.fudaa.ctulu.CtuluLibFile;
+import org.fudaa.dodico.crue.metier.emh.EMH;
+import org.fudaa.dodico.crue.metier.emh.EnumInfosEMH;
+import org.fudaa.dodico.crue.metier.emh.InfosEMH;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -167,6 +170,53 @@
}
+ public class ResultatInfoEMH<T extends FCBValueObject.AbstractEntete, R extends FCBValueObject.AbstractRes>
+ implements InfosEMH {
+
+ final EMH emh;
+ final EnteteContainer<T, R> entete;
+
+ /**
+ * @param emh
+ * @param entete
+ */
+ public ResultatInfoEMH(EMH emh, EnteteContainer<T, R> entete) {
+ super();
+ this.emh = emh;
+ this.entete = entete;
+ }
+
+ public boolean getActivated() {
+ return true;
+ }
+
+ public EnumInfosEMH getCatType() {
+ return EnumInfosEMH.RESULTAT;
+ }
+
+ public EMH getEmh() {
+ return emh;
+ }
+
+ public String getType() {
+ return getClass().getSimpleName();
+ }
+
+ public void setEmh(EMH emh) {}
+
+ /**
+ * @param idxPt
+ * @param nomEMH
+ * @param inout
+ * @return le resultat lu
+ * @throws IOException
+ */
+ public R read(final int idxPt, final R inout) throws IOException {
+ return entete.read(idxPt, emh.getId(), inout);
+ }
+
+ }
+
/**
* @author denf01a
* @creation 27 mai 2009
@@ -193,6 +243,14 @@
nb = listData.size();
}
+ /**
+ * @param emh l'emh en question
+ * @return le resultat contenu dans une infoEMH
+ */
+ public ResultatInfoEMH createInfoEMH(EMH emh) {
+ return new ResultatInfoEMH<T, R>(emh, this);
+ }
+
protected ResBuilder<R> getResBuilder() {
return resBuilder;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractInfosEMH.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractInfosEMH.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractInfosEMH.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -16,7 +16,7 @@
}
public final boolean getActivated() {
- return getEmh() != null && getEmh().getActivated();
+ return getEmh() != null && getEmh().getActuallyActive();
}
public final EMH getEmh() {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -16,7 +16,7 @@
private boolean active;
/** @pdOid adf7fd8e-2133-4f9f-a463-e263df0c7557 */
- public boolean getActive() {
+ public boolean getUserActive() {
return active;
}
@@ -24,7 +24,7 @@
* @param newIsActive
* @pdOid 9c6ae571-14f8-4227-b75a-e320a4e581d9
*/
- public void setActive(final boolean newIsActive) {
+ public void setUserActive(final boolean newIsActive) {
active = newIsActive;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -36,11 +36,11 @@
}
@Override
- public boolean getActivated() {
- boolean res = super.getActivated();
+ public boolean getActuallyActive() {
+ boolean res = super.getActuallyActive();
if (res) {
CatEMHNoeud noeud = getNoeud();
- return noeud != null && noeud.getActivated();
+ return noeud != null && noeud.getActuallyActive();
}
return res;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneur.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneur.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneur.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -20,7 +20,7 @@
}
@Override
- public final boolean getActive() {// NOPMD
+ public final boolean getUserActive() {// NOPMD
return true;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java 2009-12-22 01:54:50 UTC (rev 5570)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java 2009-12-23 02:48:43 UTC (rev 5571)
@@ -17,18 +17,18 @@
}
@Override
- public final boolean getActive() {// NOPMD
+ public final boolean...
[truncated message content] |
|
From: <de...@us...> - 2010-01-06 23:25:12
|
Revision: 5593
http://fudaa.svn.sourceforge.net/fudaa/?rev=5593&view=rev
Author: deniger
Date: 2010-01-06 23:25:04 +0000 (Wed, 06 Jan 2010)
Log Message:
-----------
fudaa-crue 0.13
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/configLoi-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestConfigLoiReader.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDC.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDFRTFile.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/test-configLoi.xml
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/TreeNodeString.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CommonGuiLib.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CrueEditorImplementation.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/CrueProjet.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFicheScenario.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleScenarioManager.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/M3-0_e1c9.dc
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3-1-erreur.dc
trunk/soft/fudaa-crue/fudaa/CrueFilleScenarioManager.zip
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/UserPreferencesSaver.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -111,14 +111,6 @@
protected final static String DH_NB_COURANT_MAX = "NB_COURANT_MAX";
protected final static String DH_COEFF_RELAX_DZ = "COEFF_RELAX_DZ";
protected final static String DH_COEFF_RELAX_DQ = "COEFF_RELAX_DQ";
- // protected final static String DH_R_PRPLAT = "R_PRPLAT";
- // protected final static String DH_R_RUPENT = "R_RUPENT";
- // protected final static String DH_R_DECAL = "R_DECAL";
- // protected final static String DH_R_REBDEB = "R_REBDEB";
- // protected final static String DH_R_SLARGE = "R_SLARGE";
- // protected final static String DH_R_DXMAX = "R_DXMAX";
- // protected final static String DH_R_VDXMAX = "R_VDXMAX";
- // protected final static String DH_R_PENMAX = "R_PENMAX";
protected final static String DH_MODRU = "MODRU";
@@ -132,8 +124,8 @@
return val <= -99999 || CtuluLib.isEquals(-99999, val);
}
- public final static String CRUE9_INFINI = "99999.";
- public final static String CRUE9_MOINS_INFINI = "-99999.";
+ public final static String CRUE9_INFINI = "1E+30";
+ public final static String CRUE9_MOINS_INFINI = "-1E+30";
public static double getCrue10Value(double v) {
if (isCrue9PlusInfini(v)) { return CrueNumberUtils.INFINI; }
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -5,15 +5,16 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.Map.Entry;
-import com.memoire.fu.FuLogCrue;
-import com.thoughtworks.xstream.converters.SingleValueConverter;
-
import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.ListUtils;
import org.apache.commons.lang.StringUtils;
+import org.fudaa.ctulu.CtuluLib;
import org.fudaa.ctulu.CtuluLibString;
import org.fudaa.dodico.crue.io.common.CrueData;
import org.fudaa.dodico.crue.io.common.CrueDataImpl;
@@ -85,6 +86,9 @@
import org.fudaa.dodico.crue.property.CrueNumberUtils;
import org.fudaa.dodico.crue.validation.CruePrefix;
+import com.memoire.fu.FuLogCrue;
+import com.thoughtworks.xstream.converters.SingleValueConverter;
+
/**
* Reader pour le format DC crue 9.
*
@@ -92,6 +96,16 @@
*/
public class DCFileReader extends AbstractCrue9Reader {
+ /**
+ * @param in la chaine a tester
+ * @return si identifie un lit mineur
+ */
+ protected static boolean isLitMineur(String in) {
+ if (CtuluLibString.isEmpty(in)) { return false; }
+ String inUpper = in.toUpperCase();
+ return inUpper.startsWith("LT_MINEUR") || inUpper.startsWith("MINEUR");
+ }
+
private SingleValueConverter enumFormulePdcMapCrue9;
/**
@@ -100,6 +114,37 @@
private SingleValueConverter enumSensOrificeMapCrue9;
/**
+ * Contient les noms de sections utilisées par les branches.
+ */
+ final Set<String> usedNomSection = new HashSet<String>(100);
+ /**
+ * Contient les noms des sections réellement trouvées dans la partie profiles
+ */
+ final Set<String> createdNomSection = new HashSet<String>(100);
+
+ boolean warnDoneForDvers;
+
+ private boolean warnDoneForDigue;
+
+ private final Map<EMHSectionIdem, String> sectionIdemWithNoRef = new HashMap<EMHSectionIdem, String>();
+
+ private void analyzeDistanceInterProfil(final String idBranche, final List<Double> listeDistance) {
+ if (CollectionUtils.isEmpty(listeDistance)) {
+ analyze_.addFatalError("dc.distance.intersection.null", idBranche);
+ return;
+ }
+ double eps = dataLinked.getCruePropertyDefinitionContainer().getEpsilon("xp");
+ for (Double dis : listeDistance) {
+ final double val = dis.doubleValue();
+ if (val < 0 || CtuluLib.isZero(val, eps)) {
+ analyze_.addFatalError("dc.distance.intersection.null", idBranche);
+ return;
+ }
+
+ }
+ }
+
+ /**
* Complete la branche avec la liste des infos lues sur chaque branche spécifiques.
*
* @author Adrien Hadoux
@@ -450,10 +495,7 @@
// -- peut y avoir 1 ou plusieurs coefficients --//
for (int i = 1; i < in_.getNumberOfFields(); i++) {
final String nomSection = in_.stringField(i);
- CatEMHSection profil = metier.findSectionByReference(nomSection);
- if (profil == null) {
- profil = new EMHSectionProfil(nomSection);
- }
+ CatEMHSection profil = createInitSectionForBranche(metier, nomSection);
listeSectionBranche.add(profil);
}
} else if (typeLigne.toUpperCase().equals(CrueIODico.BRANCHE_NOMREF)) {
@@ -584,10 +626,7 @@
// -- peut y avoir 1 ou plusieurs coefficients --//
for (int i = 1; i < in_.getNumberOfFields(); i++) {
final String nomSection = in_.stringField(i);
- CatEMHSection profil = metier.findSectionByReference(nomSection);
- if (profil == null) {
- profil = new EMHSectionProfil(nomSection);
- }
+ CatEMHSection profil = createInitSectionForBranche(metier, nomSection);
listeSectionBranche.add(profil);
}
} else if (typeLigne.toUpperCase().equals(CrueIODico.BRANCHE_NOMREF)) {
@@ -901,10 +940,7 @@
// -- peut y avoir 1 ou plusieurs coefficients --//
for (int i = 1; i < in_.getNumberOfFields(); i++) {
final String nomSection = in_.stringField(i);
- CatEMHSection profil = metier.findSectionByReference(nomSection);
- if (profil == null) {
- profil = new EMHSectionProfil(nomSection);
- }
+ CatEMHSection profil = createInitSectionForBranche(metier, nomSection);
listeSectionBranche.add(profil);
}
// listeSectionBranche.add(sections);
@@ -915,8 +951,10 @@
if (typeLigne.toUpperCase().equals(CrueIODico.BRANCHE_DISTMAX)) {
metier.setCrue9ContientDistmax(true);
- // TODO: DISTMAX a gerer , demander CNR, le dico dit abandonné dans crue 10...--//
distMAX = in_.doubleField(1);
+ if (distMAX <= 0) {
+ analyze_.addFatalError("dc.distmax.null", in_.getLineNumber(), idBranche);
+ }
} else
// -- coefficients cconv --//
@@ -969,12 +1007,15 @@
// -- on lit la suite en passant les commentaires sans mot clef --//
lireSuite();
lineRead = in_.getLine();
+
}// on boucle sur le while.
+ // test des distance.
+ analyzeDistanceInterProfil(idBranche, listeDistance);
// -- on remplit avec les infos spécifiques de la branche --//
completeBrancheWithInfosRead(metier, branche, listeDistance, listeCconv, listeCpond, listeCdiv, listeSectionBranche);
- if (distMAX != 0) {
+ if (distMAX > 0) {
completeSaintVenantWithDistMax(branche, distMAX, metier);
}
@@ -1157,10 +1198,7 @@
// -- peut y avoir 1 ou plusieurs coefficients --//
for (int i = 1; i < in_.getNumberOfFields(); i++) {
final String nomSection = in_.stringField(i);
- CatEMHSection profil = metier.findSectionByReference(nomSection);
- if (profil == null) {
- profil = new EMHSectionProfil(nomSection);
- }
+ CatEMHSection profil = createInitSectionForBranche(metier, nomSection);
listeSectionBranche.add(profil);
}
// listeSectionBranche.add(sections);
@@ -1283,10 +1321,7 @@
// -- peut y avoir 1 ou plusieurs coefficients --//
for (int i = 1; i < in_.getNumberOfFields(); i++) {
final String nomSection = in_.stringField(i);
- CatEMHSection profil = metier.findSectionByReference(nomSection);
- if (profil == null) {
- profil = new EMHSectionProfil(nomSection);
- }
+ CatEMHSection profil = createInitSectionForBranche(metier, nomSection);
listeSectionBranche.add(profil);
}
// listeSectionBranche.add(sections);
@@ -1298,6 +1333,7 @@
lireSuite();
lineRead = in_.getLine();
}
+ analyzeDistanceInterProfil(idBranche, listeDistance);
// -- on remplit avec les infos spécifiques de la branche --//
completeBrancheWithInfosRead(metier, branche, listeDistance, listeCconv, listeCpond, listeCdiv, listeSectionBranche);
return branche;
@@ -1466,20 +1502,35 @@
}
- boolean warnDoneForDvers;
+ private OrdPrtGeoModeleBase createDefaultOPTG(final CrueData metier) {
+ final OrdPrtGeoModeleBase reglesOPTG = new OrdPrtGeoModeleBase(metier.getCruePropertyDefinitionContainer());
+ // -- ajout des données métier dans le cruedata --//
+ metier.setPretraitementsGeom(reglesOPTG);
+ return reglesOPTG;
+ }
- private boolean warnDoneForDigue;
-
/**
- * @param in la chaine a tester
- * @return si identifie un lit mineur
+ * A utiliser lors de la lecture des branches: cree des sections temporaires et stockes les nomSxtio
+ *
+ * @param metier le metier
+ * @param nomSection le nom de la section
+ * @return la section qui va bien
*/
- protected static boolean isLitMineur(String in) {
- if (CtuluLibString.isEmpty(in)) { return false; }
- String inUpper = in.toUpperCase();
- return inUpper.startsWith("LT_MINEUR") || inUpper.startsWith("MINEUR");
+ private CatEMHSection createInitSectionForBranche(final CrueData metier, final String nomSection) {
+ CatEMHSection profil = metier.findSectionByReference(nomSection);
+ if (profil == null) {
+ this.usedNomSection.add(nomSection.toUpperCase());
+ profil = new EMHSectionProfil(nomSection);
+ }
+ return profil;
}
+ private void createParamNum(final CrueData metier) {
+ if (metier.getParamNumModeleBase() == null) {
+ metier.setParamNumModeleBase(new ParamNumModeleBase(metier.getCruePropertyDefinitionContainer()));
+ }
+ }
+
/**
* Creer une section profile classique.
*
@@ -1892,11 +1943,23 @@
final CatEMHSection ref = metier.findSectionByReference(it.getValue());
it.getKey().setSectionRef(ref);
if (ref == null) {
- analyze_.addError("io.dc.refFroSectionIdemNotFound", it.getKey().getNom(), it.getValue());
+ analyze_.addFatalError("io.dc.refFroSectionIdemNotFound", it.getKey().getNom(), it.getValue());
}
}
}
+ // erreur si un profil utilisés n'est pas défini
+ Collection usedButNotCreationProfils = ListUtils.removeAll(usedNomSection, createdNomSection);
+ if (!usedButNotCreationProfils.isEmpty()) {
+ analyze_.addFatalError(usedButNotCreationProfils.size() == 1 ? "io.dc.sectionUsedButNotExist.one"
+ : "io.dc.sectionUsedButNotExist.multi", StringUtils.join(usedButNotCreationProfils, ", "));
+ }
+ Collection createdButNotUsed = ListUtils.removeAll(createdNomSection, usedNomSection);
+ if (!createdButNotUsed.isEmpty()) {
+ analyze_.addWarn(createdButNotUsed.size() == 1 ? "io.dc.sectionCreatedButNotUsed.one"
+ : "io.dc.sectionCreatedButNotUsed.multi", StringUtils.join(createdButNotUsed, ", "));
+ }
+
if (resu.getMetier().getPretraitementsGeom() == null) {
createDefaultOPTG(resu.getMetier());
}
@@ -1973,6 +2036,36 @@
}
/**
+ * Lit l'header du fichier fortran. 5 lignes de titre Commun a DC et DH.
+ *
+ * @throws IOException
+ */
+ @Override
+ public void readHeader(final CrueIOResu<CrueData> res) throws IOException {
+
+ final StringBuilder comm = new StringBuilder(420);
+ boolean readSuite = true;
+ for (int i = 0; i < AbstractCrue9Reader.NB_LINES_TITLE; i++) {
+ final String readAndAvoidLabel = readAndAvoidLabel(in_).trim();
+ if (readAndAvoidLabel.startsWith(CrueIODico.TITRE)) {
+ if (comm.length() > 0) {
+ comm.append('|');
+ }
+ comm.append(StringUtils.removeStart(in_.getLine(), CrueIODico.TITRE));
+ } else {
+ readSuite = false;
+ break;
+ }
+ }
+ res.setCrueCommentaire(comm.toString());
+ if (readSuite) {
+ // -- on lit la suite --//
+ lireSuite();
+ }
+
+ }
+
+ /**
* Lit la partie des noeuds du fichier DC.
*
* @param metier données métier.
@@ -2004,8 +2097,6 @@
}
}
- private final Map<EMHSectionIdem, String> sectionIdemWithNoRef = new HashMap<EMHSectionIdem, String>();
-
/**
* Lit les profils
*
@@ -2022,6 +2113,7 @@
final String element = in_.stringField(0);
final String nomProfil = in_.stringField(1);
final String upperCase = element.toUpperCase();
+ createdNomSection.add(nomProfil.toUpperCase());
if (upperCase.equals(CrueIODico.PROFIL)) {
sectionCree = createSectionProfilClassique(metier, nomProfil);
@@ -2045,6 +2137,8 @@
} else {
metier.add(newSection);
}
+ // une section qui sert de support est utilisee.
+ this.usedNomSection.add(nomReference.toUpperCase());
// on met les ref dans cette map temporaire.
sectionIdemWithNoRef.put(newSection, nomReference);
@@ -2105,27 +2199,6 @@
}
- private void replaceSection(final CrueData metier, final CatEMHSection sectionToreplace,
- final CatEMHSection newSection) {
- if (sectionToreplace != null) {
- final List<RelationEMH> relationContenant = EMHHelper.collectDeepRelationEMHsByRef(metier.getSousModele(),
- sectionToreplace.getNom());
- if (relationContenant != null) {
- for (final RelationEMH relationEMH : relationContenant) {
- relationEMH.setEmh(newSection);
- }
- }
- // on met a jour les relations.
- Collection<RelationEMHBrancheContientSection> findRelationOfType = EMHHelper.selectRelationOfType(
- sectionToreplace, RelationEMHBrancheContientSection.class);
- for (RelationEMHBrancheContientSection relationToChange : findRelationOfType) {
- newSection.addRelationEMH(relationToChange);
- }
- // EMHBrancheHelper.replaceSectioninAllConnectedBranche(sectionToreplace, newSection, metier.getBranches());
- // metier.getSections().remove(sectionToreplace);
- }
- }
-
/**
* Lit les regles du debut de fichier
*
@@ -2223,47 +2296,25 @@
}
}
- private OrdPrtGeoModeleBase createDefaultOPTG(final CrueData metier) {
- final OrdPrtGeoModeleBase reglesOPTG = new OrdPrtGeoModeleBase(metier.getCruePropertyDefinitionContainer());
- // -- ajout des données métier dans le cruedata --//
- metier.setPretraitementsGeom(reglesOPTG);
- return reglesOPTG;
- }
-
- private void createParamNum(final CrueData metier) {
- if (metier.getParamNumModeleBase() == null) {
- metier.setParamNumModeleBase(new ParamNumModeleBase(metier.getCruePropertyDefinitionContainer()));
- }
- }
-
- /**
- * Lit l'header du fichier fortran. 5 lignes de titre Commun a DC et DH.
- *
- * @throws IOException
- */
- @Override
- public void readHeader(final CrueIOResu<CrueData> res) throws IOException {
-
- final StringBuilder comm = new StringBuilder(420);
- boolean readSuite = true;
- for (int i = 0; i < AbstractCrue9Reader.NB_LINES_TITLE; i++) {
- final String readAndAvoidLabel = readAndAvoidLabel(in_).trim();
- if (readAndAvoidLabel.startsWith(CrueIODico.TITRE)) {
- if (comm.length() > 0) {
- comm.append('|');
+ private void replaceSection(final CrueData metier, final CatEMHSection sectionToreplace,
+ final CatEMHSection newSection) {
+ if (sectionToreplace != null) {
+ final List<RelationEMH> relationContenant = EMHHelper.collectDeepRelationEMHsByRef(metier.getSousModele(),
+ sectionToreplace.getNom());
+ if (relationContenant != null) {
+ for (final RelationEMH relationEMH : relationContenant) {
+ relationEMH.setEmh(newSection);
}
- comm.append(StringUtils.removeStart(in_.getLine(), CrueIODico.TITRE));
- } else {
- readSuite = false;
- break;
}
+ // on met a jour les relations.
+ Collection<RelationEMHBrancheContientSection> findRelationOfType = EMHHelper.selectRelationOfType(
+ sectionToreplace, RelationEMHBrancheContientSection.class);
+ for (RelationEMHBrancheContientSection relationToChange : findRelationOfType) {
+ newSection.addRelationEMH(relationToChange);
+ }
+ // EMHBrancheHelper.replaceSectioninAllConnectedBranche(sectionToreplace, newSection, metier.getBranches());
+ // metier.getSections().remove(sectionToreplace);
}
- res.setCrueCommentaire(comm.toString());
- if (readSuite) {
- // -- on lit la suite --//
- lireSuite();
- }
-
}
public void stop() {}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -6,8 +6,6 @@
import java.util.HashMap;
import java.util.List;
-import com.thoughtworks.xstream.converters.SingleValueConverter;
-
import org.apache.commons.collections.CollectionUtils;
import org.fudaa.ctulu.CtuluActivity;
import org.fudaa.ctulu.CtuluLib;
@@ -70,6 +68,8 @@
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.metier.helper.LoiHelper;
+import com.thoughtworks.xstream.converters.SingleValueConverter;
+
/**
* Writer de la structure DC.
*
@@ -205,6 +205,8 @@
fortranWriter.stringField(1, "1.0");
fortranWriter.stringField(2, CrueIODico.getCrue9Value(metier.getParamNumModeleBase().getParamNumCalcTrans()
.getThetaPreissmann()));
+ // FIXME a verifier
+ fortranWriter.stringField(3, "0");
fortranWriter.writeFields();
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -8,7 +8,15 @@
import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.DonneesSectionOuProfil;
import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.DonneesSectionPourBranche;
import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.SectionPourAutreBranche;
-import org.fudaa.dodico.crue.metier.emh.*;
+import org.fudaa.dodico.crue.metier.emh.DonFrt;
+import org.fudaa.dodico.crue.metier.emh.DonFrtStrickler;
+import org.fudaa.dodico.crue.metier.emh.EnumLitPosition;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
+import org.fudaa.dodico.crue.metier.emh.LoiFF;
+import org.fudaa.dodico.crue.metier.emh.ResPrtData;
+import org.fudaa.dodico.crue.metier.emh.ResPrtDataLitPos;
+import org.fudaa.dodico.crue.metier.emh.ResPrtGeo;
+import org.fudaa.dodico.crue.metier.emh.ResPrtGeoSection;
import org.fudaa.dodico.crue.metier.helper.LoiFactory;
import org.fudaa.dodico.crue.validation.CruePrefix;
@@ -159,7 +167,13 @@
final EnumLitPosition[] valuesEnum = EnumLitPosition.values();
final EnumLitPosition[] enums = new EnumLitPosition[listeLitsExtremes.length];
for (int i = 0, imax = listeLitsExtremes.length; i < imax; i++) {
- enums[i] = valuesEnum[listeLitsExtremes[i]];
+ int j = listeLitsExtremes[i];
+ if (j >= 0 && j < valuesEnum.length) {
+ enums[i] = valuesEnum[j];
+ }
+ // else {
+ // System.err.println("aie");
+ // }
}
litPos.setPositions(enums);
rptgSection.setLitPos(litPos);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -164,11 +164,11 @@
}
for (final EnteteProfil prof : res.getContainerProfil().getListData()) {
final String id = prof.getNom().toUpperCase();
- CatEMHSection foundSection = data.findSectionByReference(id);
+ final CatEMHSection foundSection = data.findSectionByReference(id);
if (StringUtils.isNotEmpty(id) && foundSection == null) {
analyze.addError("res.section.notFound", id);
error = true;
- } else {
+ } else if (foundSection != null) {
foundSection.addInfosEMH(res.getContainerBranches().createInfoEMH(foundSection));
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties 2010-01-06 23:25:04 UTC (rev 5593)
@@ -15,6 +15,12 @@
dc.limFin.NotFound = La limite fin du lit num\u00E9rot\u00E9 {1} de la section {0} n''a pas \u00E9t\u00E9 trouv\u00E9e dans la liste des points profil.
dc.ptProfilLitUtilDeb.NotFound = La limite d\u00E9but du lit utile du casier {0} n''a pas \u00E9t\u00E9 trouv\u00E9e dans dans la liste des points profil.
dc.ptProfilLitUtilFin.NotFound = La limite fin du lit utile du casier {0} n''a pas \u00E9t\u00E9 trouv\u00E9e dans la liste des points profil.
+dc.distmax.null =Ligne {0}: le distmax utilise pour la branche {1} est n\xE9gatif ou null.
+dc.distance.intersection.null=Branche {0}: une distance inter-profil est n\xE9gative ou null
+io.dc.sectionUsedButNotExist.one=Ce sc\xE9nario contient une SectionProfil qui fait r\xE9f\xE9rence \xE0 un ProfilSection qui n''existe pas: {0}
+io.dc.sectionUsedButNotExist.multi=Ce sc\xE9nario contient des SectionProfil qui font r\xE9f\xE9rence \xE0 des ProfilSection qui n''existe pas: {0}
+io.dc.sectionCreatedButNotUsed.multi=Ce sc\xE9nario contient des ProfilSection qui ne sont pas utilis\xE9s par un SectionProfil: {0}
+io.dc.sectionCreatedButNotUsed.one=Ce sc\xE9nario contient un ProfilSection qui n''est utilis\xE9 par aucune SectionProfil: {0}
dcsp.tooMuchDonForCasier = Le casier {0} poss\u00E8de trop de DonCalcSansPrtCasierProfil
Modified: trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/configLoi-1.0.0.xsd
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/configLoi-1.0.0.xsd 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/configLoi-1.0.0.xsd 2010-01-06 23:25:04 UTC (rev 5593)
@@ -50,7 +50,7 @@
<xs:element name="ConfigLois">
<xs:complexType>
<xs:sequence>
- <xs:element ref="Commentaire" minOccurs="0" />
+ <xs:element name="Commentaire" type="xs:string" minOccurs="0" />
<xs:element name="ConfigLoi" type="TypeConfigLoi"
minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
Modified: trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -66,7 +66,7 @@
EMHHelper.addRelationContientEMH(modele, nd);
EMHHelper.addRelationContientEMH(modele, nd2);
final JXPathContext path = JXPathContext.newContext(modele);
- final List selectNodes = path.selectNodes("simpleEMH[active='true']");
+ final List selectNodes = path.selectNodes("simpleEMH[userActive='true']");
assertEquals(1, selectNodes.size());
assertEquals(nd, selectNodes.get(0));
}
Modified: trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestConfigLoiReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestConfigLoiReader.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestConfigLoiReader.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -11,8 +11,8 @@
import org.fudaa.dodico.crue.io.common.CrueIOResu;
import org.fudaa.dodico.crue.property.ConfigLoi;
import org.fudaa.dodico.crue.property.CrueLoaderConfigLoi;
+import org.fudaa.dodico.crue.property.CrueLoaderPropertiesDefault;
import org.fudaa.dodico.crue.property.CrueProperties;
-import org.fudaa.dodico.crue.property.CrueLoaderPropertiesDefault;
import org.fudaa.dodico.crue.property.EnumExtrapolation;
import org.fudaa.dodico.crue.property.PropertyDefinition;
@@ -53,7 +53,7 @@
loader = new CrueLoaderConfigLoi(vars);
readConfigLoi = loader.readConfigLoi(TestConfigLoiReader.class.getResource(file));
analyse = readConfigLoi.getAnalyse();
- assertFalse(analyse.containsFatalError());// des lois ne sont pas définies
+ assertTrue(analyse.containsFatalError());// des lois ne sont pas définies
List<ConfigLoi> metier = readConfigLoi.getMetier();
assertEquals(2, metier.size());
int idx = 0;
Modified: trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDC.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDC.java 2010-01-06 18:15:21 UTC (rev 5592)
+++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDC.java 2010-01-06 23:25:04 UTC (rev 5593)
@@ -15,6 +15,7 @@
import org.fudaa.dodico.crue.metier.emh.CatEMHCasier;
import org.fudaa.dodico.crue.metier.emh.DonFrt;
import org.fudaa.dodico.crue.metier.emh.DonPrtGeoBatiCasier;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilCasier;
import org.fudaa.dodico.crue.metier.emh.EMHSectionIdem;
import org.fudaa.dodico.crue.metier.emh.OrdPrtGeoModeleBase;
import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBranche;
@@ -31,6 +32,7 @@
protected static final String EXEMPLE_CUSTOM = "/fichierTest/exempleDCbrancheOnly.dc";
protected static final String FICHIER_TEST_MODELE3_1_DC = "/fichierTest/Modele3-1.dc";
+ protected static final String FICHIER_TEST_MODELE3_1_DC_ERREUR = "/fichierTest/Modele3-1-erreur.dc";
protected static final String FICHIER_TEST_MODELE3_2_DC = "/fichierTest/Modele3-2.dc";
public static final String FICHIER_TEST_MODELE3_DC...
[truncated message content] |
|
From: <de...@us...> - 2010-01-29 00:09:53
|
Revision: 5655
http://fudaa.svn.sourceforge.net/fudaa/?rev=5655&view=rev
Author: deniger
Date: 2010-01-29 00:09:41 +0000 (Fri, 29 Jan 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ConvertCompare.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterETU.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureETU.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureORES.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/EMHProjet.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/EMHRun.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemSeuil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumInfosEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EvolutionFF.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtReseau.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/resources/default.ores.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/common/comparaisonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/io/default-comparaison.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-ores-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueSTO.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueSTR.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/CrueModeleBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CrueCommonImplementation.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CrueEditorImplementation.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/UserPreferencesSaver.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/CrueProjet.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFicheScenario.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleInfosGenerales.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleScenarioManager.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/DoubleComparator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/ResPrtReseauCrue9Adapter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractResPrtGeoCasierContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractResPrtGeoSectionContainer.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoCasierContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSectionContainer.java
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/DoubleComparator.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/DoubleComparator.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/DoubleComparator.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -0,0 +1,32 @@
+/**
+ *
+ */
+package org.fudaa.dodico.crue.common;
+
+import java.util.Comparator;
+
+/**
+ * @author deniger
+ */
+public class DoubleComparator implements Comparator<Double> {
+
+ private final double epsPdt;
+
+ /**
+ * @param epsPdt
+ */
+ public DoubleComparator(double epsPdt) {
+ super();
+ this.epsPdt = epsPdt;
+ }
+
+ public int compare(Double o1, Double o2) {
+ if (o1 == o2) { return 0; }
+ if (o1 == null) { return -1; }
+ if (o2 == null) { return 1; }
+ double eps = o1.doubleValue() - o2.doubleValue();
+ if (Math.abs(eps) < epsPdt) { return 0; }
+ return eps > 0 ? 1 : -1;
+ }
+
+}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ConvertCompare.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ConvertCompare.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ConvertCompare.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -7,11 +7,12 @@
import org.fudaa.dodico.crue.comparaison.config.ConfCompare;
import org.fudaa.dodico.crue.comparaison.config.ConfCompareListe;
import org.fudaa.dodico.crue.comparaison.config.ConfCompareObject;
-import org.fudaa.dodico.crue.comparaison.tester.*;
+import org.fudaa.dodico.crue.comparaison.tester.EqualsTesterBean;
+import org.fudaa.dodico.crue.comparaison.tester.EqualsTesterIsIncludeCollection;
+import org.fudaa.dodico.crue.comparaison.tester.FactoryEqualsTester;
/**
* @author deniger
- *
*/
public class ConvertCompare {
@@ -40,13 +41,14 @@
final Class inClass = in.getClass();
if (ConfCompareObject.class.equals(inClass)) {
final ConfCompareObject inObject = (ConfCompareObject) in;
+
final EqualsTesterBean res = new EqualsTesterBean(factory);
res.getContextFactory().setMaxDeep(inObject.getDeep());
res.setPropToCompare(inObject.getAttributs());
if (CollectionUtils.isNotEmpty(inObject.getOptions())) {
analyze.addWarn("options.notManaged.forCompareObject");
}
- return new ExecuteCompareActionOnObject(res);
+ return new ExecuteCompareActionOnObject(res, factory);
} else if (ConfCompareListe.class.equals(inClass)) {
final ConfCompareListe inObject = (ConfCompareListe) in;
final EqualsTesterIsIncludeCollection res = new EqualsTesterIsIncludeCollection(inObject.getAttribut(), inObject
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -8,14 +8,22 @@
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.crue.comparaison.tester.EqualsTester;
import org.fudaa.dodico.crue.comparaison.tester.EqualsTesterCollection;
+import org.fudaa.dodico.crue.comparaison.tester.FactoryEqualsTester;
import org.fudaa.dodico.crue.comparaison.tester.ResultatTest;
import org.fudaa.dodico.crue.comparaison.tester.TesterContext;
public class ExecuteCompareActionOnObject implements CompareActionBuilder {
final EqualsTester tester;
+ final FactoryEqualsTester factory;
- public ExecuteCompareActionOnObject(EqualsTester tester) {
+ /**
+ * @param tester
+ * @param factory
+ */
+ public ExecuteCompareActionOnObject(EqualsTester tester, FactoryEqualsTester factory) {
+ super();
this.tester = tester;
+ this.factory = factory;
}
public boolean launch(ComparaisonNodeFinal target, ResultatTest parent, CtuluAnalyze collector) {
@@ -43,7 +51,15 @@
for (int i = 0; i < size; i++) {
TesterContext create = tester.getContextFactory().create();
create.setError(collector);
- res = res & tester.isSame(a.get(i), b.get(i), parent, create);
+ EqualsTester toUse = tester;
+ EqualsTester other = factory.getMainKnownTester(a.get(i));
+ if (other == null) {
+ other = factory.getMainKnownTester(b.get(i));
+ }
+ if (other != null) {
+ toUse = other;
+ }
+ res = res & toUse.isSame(a.get(i), b.get(i), parent, create);
}
} catch (Exception e) {
collector.manageException(e);
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -0,0 +1,72 @@
+package org.fudaa.dodico.crue.comparaison.tester;
+
+import java.util.TreeMap;
+
+import org.fudaa.dodico.crue.common.DoubleComparator;
+import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalcul;
+import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalculPasDeTemps;
+import org.fudaa.dodico.crue.io.neuf.FCBValueObject.AbstractRes;
+
+/**
+ * @author denf01a
+ * @creation 22 juin 2009
+ * @version
+ */
+public class EqualsTesterResultatCalcul extends AbstractEqualsTester<ResultatCalcul> {
+
+ private final double epsPdt;
+ final EqualsTesterBean beanTester;
+
+ /**
+ * @param epsPdt
+ */
+ public EqualsTesterResultatCalcul(final double epsPdt, EqualsTesterBean beanTester) {
+ super();
+ this.epsPdt = epsPdt;
+ this.beanTester = beanTester;
+ }
+
+ @Override
+ protected boolean mustTestAlreadyDone() {
+ return false;
+ }
+
+ @Override
+ public boolean isSameSafe(final ResultatCalcul o1, final ResultatCalcul o2, final ResultatTest res,
+ final TesterContext context) {
+ boolean bool = true;
+ DoubleComparator cmp = new DoubleComparator(epsPdt);
+ TreeMap<Double, Integer> positionIn2 = new TreeMap<Double, Integer>(cmp);
+ ResultatCalculPasDeTemps pasDeTemps = o2.getPasDeTemps();
+ int nbPdt2 = pasDeTemps.getNbPdt();
+ for (int i = 0; i < nbPdt2; i++) {
+ positionIn2.put(pasDeTemps.getPdt(i), i);
+ }
+ int nbPdt1 = o1.getPasDeTemps().getNbPdt();
+ for (int i = 0; i < nbPdt1; i++) {
+ double pdt = o1.getPasDeTemps().getPdt(i);
+ Integer posFound = positionIn2.get(pdt);
+ if (posFound != null) {
+ res.incrementeObjectTested();
+ int pos1 = i;
+ int pos2 = posFound.intValue();
+ try {
+ AbstractRes read1 = o1.read(pos1);
+ AbstractRes read2 = o2.read(pos2);
+ ResultatTest resLocal = new ResultatTest("", "", "compare.resultat.diff", pdt);
+ if (!beanTester.isSame(read1, read2, resLocal, context)) {
+ res.addDiff(resLocal);
+ }
+
+ } catch (Exception e) {
+ context.addError(e.getMessage(), e);
+ }
+
+ }
+ }
+
+ return bool;
+ // return abs.isSameDouble(o1.getAbscisse(), o2.getAbscisse()) && ord.isSameDouble(o1.getOrdonnee(),
+ // o2.getOrdonnee());
+ }
+}
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -0,0 +1,113 @@
+package org.fudaa.dodico.crue.comparaison.tester;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import org.apache.commons.lang.StringUtils;
+import org.fudaa.dodico.crue.common.DoubleComparator;
+import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalculPasDeTemps;
+
+/**
+ * @author denf01a
+ * @creation 22 juin 2009
+ * @version
+ */
+public class EqualsTesterResultatPasDeTemps extends AbstractEqualsTester<ResultatCalculPasDeTemps> {
+
+ private final double epsPdt;
+ final EqualsTesterDouble ruinouTester;
+
+ /**
+ * @param epsPdt
+ */
+ public EqualsTesterResultatPasDeTemps(final double epsPdt, final EqualsTesterDouble ruinouTester) {
+ super();
+ this.epsPdt = epsPdt;
+ this.ruinouTester = ruinouTester;
+ }
+
+ @Override
+ protected boolean mustTestAlreadyDone() {
+ return false;
+ }
+
+ @Override
+ public boolean isSameSafe(final ResultatCalculPasDeTemps o1, final ResultatCalculPasDeTemps o2,
+ final ResultatTest res, final TesterContext context) {
+ boolean bool = true;
+ if (o1.getNbPdt() != o2.getNbPdt()) {
+ res.addDiff(new ResultatTest(o1.getNbPdt(), o2.getNbPdt(), "compare.nbPdt.diff"));
+ bool = false;
+ }
+ DoubleComparator cmp = new DoubleComparator(epsPdt);
+ TreeMap<Double, Integer> pdtIn1 = new TreeMap<Double, Integer>(cmp);
+ TreeSet<Double> pdtIn2 = new TreeSet<Double>(cmp);
+ int nbPdt1 = o1.getNbPdt();
+ int nbPdt2 = o2.getNbPdt();
+ for (int i = 0; i < nbPdt1; i++) {
+ pdtIn1.put(Double.valueOf(o1.getPdt(i)), Integer.valueOf(i));
+ }
+ for (int i = 0; i < nbPdt2; i++) {
+ pdtIn2.add(o2.getPdt(i));
+ }
+ List<String> pdtContainedBy2AndNotBy1 = new ArrayList<String>();
+ List<String> pdtContainedBy1AndNotBy2 = new ArrayList<String>();
+ for (Double pdt : pdtIn2) {
+ if (!pdtIn1.containsKey(pdt)) {
+ pdtContainedBy2AndNotBy1.add(Double.toString(pdt));
+ }
+ }
+ for (Double pdt : pdtIn1.keySet()) {
+ if (!pdtIn2.contains(pdt)) {
+ pdtContainedBy1AndNotBy2.add(Double.toString(pdt));
+ }
+ }
+
+ if (pdtContainedBy1AndNotBy2.size() > 0) {
+ bool = false;
+ res.addDiff(new ResultatTest(StringUtils.join(pdtContainedBy1AndNotBy2, ", "), StringUtils.EMPTY,
+ "compare.pdt.inA.diff"));
+
+ }
+ if (pdtContainedBy2AndNotBy1.size() > 0) {
+ bool = false;
+ res.addDiff(new ResultatTest(StringUtils.join(pdtContainedBy2AndNotBy1, ", "), StringUtils.EMPTY,
+ "compare.pdt.inB.diff"));
+ }
+ List<String> pdtWithDifferentRegul = new ArrayList<String>();
+ List<String> pdtWithDifferentRuinou = new ArrayList<String>();
+ for (int i = 0; i < nbPdt2; i++) {
+ double pdt = o2.getPdt(i);
+ Integer pos = pdtIn1.get(Double.valueOf(pdt));
+ if (pos != null) {
+ int pos1 = pos.intValue();
+ int pos2 = i;
+ boolean isRegu2 = o2.isRegulation(pos2);
+ boolean isRegu1 = o1.isRegulation(pos1);
+ if (isRegu1 != isRegu2) {
+ pdtWithDifferentRegul.add(Double.toString(pdt));
+ } else if (!isRegu1) {
+ double rui1 = o1.getRuinou(pos1);
+ double rui2 = o2.getRuinou(pos2);
+ if (!ruinouTester.isSameDouble(rui1, rui2)) {
+ pdtWithDifferentRuinou.add(Double.toString(pdt));
+ }
+ }
+ }
+ }
+ if (pdtWithDifferentRegul.size() > 0) {
+ res.addDiff(new ResultatTest(StringUtils.EMPTY, StringUtils.join(pdtWithDifferentRegul, ", "),
+ "compare.pdt.withDifferentRegu"));
+ }
+ if (pdtWithDifferentRuinou.size() > 0) {
+ res.addDiff(new ResultatTest(StringUtils.EMPTY, StringUtils.join(pdtWithDifferentRuinou, ", "),
+ "compare.pdt.withDifferentRuinou"));
+ }
+
+ return bool;
+ // return abs.isSameDouble(o1.getAbscisse(), o2.getAbscisse()) && ord.isSameDouble(o1.getOrdonnee(),
+ // o2.getOrdonnee());
+ }
+}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -4,6 +4,8 @@
import java.util.HashMap;
import java.util.Map;
+import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalcul;
+import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalculPasDeTemps;
import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilSectionFenteData;
import org.fudaa.dodico.crue.metier.emh.LoiDF;
import org.fudaa.dodico.crue.metier.emh.LoiFF;
@@ -25,6 +27,7 @@
private final Map<Class, EqualsTesterItemBuilder> knownTesterBuilder;
private final Map<Class, EqualsTester> knownTester;
+ private final Map<Class, EqualsTester> mainKnownTester;
protected static final EqualsTesterObject BASIC_OBJECT_TESTER = new EqualsTesterObject();
@@ -36,6 +39,8 @@
this.propEps = propEps;
knownTesterBuilder = new HashMap<Class, EqualsTesterItemBuilder>();
knownTester = createKnownEqualsTester(this);
+ mainKnownTester = createMainKnownEqualsTester(this);
+ knownTester.putAll(mainKnownTester);
EqualsTesterItemBuilder.addDefault(knownTesterBuilder);
}
@@ -53,9 +58,28 @@
final EqualsTesterFente fente = new EqualsTesterFente(new EqualsTesterDouble(factory.getEpsFor("largeurFente")),
new EqualsTesterDouble(factory.getEpsFor("profondeurFente")));
res.put(DonPrtGeoProfilSectionFenteData.class, fente);
+ res.put(ResultatCalculPasDeTemps.class, new EqualsTesterResultatPasDeTemps(factory.getEpsFor("pdt"),
+ new EqualsTesterDouble(factory.getEpsFor("qruis"))));
+ res.put(ResultatCalcul.class, new EqualsTesterResultatCalcul(factory.getEpsFor("pdt"),
+ new EqualsTesterBean(factory)));
return res;
}
+ private static Map<Class, EqualsTester> createMainKnownEqualsTester(final FactoryEqualsTester factory) {
+ final Map<Class, EqualsTester> res = new HashMap<Class, EqualsTester>();
+ res.put(ResultatCalculPasDeTemps.class, new EqualsTesterResultatPasDeTemps(factory.getEpsFor("pdt"),
+ new EqualsTesterDouble(factory.getEpsFor("qruis"))));
+ res.put(ResultatCalcul.class, new EqualsTesterResultatCalcul(factory.getEpsFor("pdt"),
+ new EqualsTesterBean(factory)));
+ return res;
+ }
+
+ public EqualsTester getMainKnownTester(Object o) {
+ if (o == null) { return null; }
+ return mainKnownTester.get(o.getClass());
+
+ }
+
/**
* @param id l'identifiant du parametre
* @return l'epsilon cherche
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -354,7 +354,7 @@
final CtuluAnalyze analyser) {
if (listePersistante == null || listePersistante.size() == 0) {
- analyser.addInfo("io.dptg.convert.noDataForProfil.error");
+ analyser.addInfo("io.dptg.convert.noDataForProfilCasier.error");
return;
}
for (final CrueDaoStructureDPTG.AbstractCasier casier : listePersistante) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterETU.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterETU.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterETU.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -221,7 +221,7 @@
// -- recherche du run courant si spécifié --//
if (scenarPersist.RunCourant != null && newScenar.existRunInScenario(scenarPersist.RunCourant.NomRef)) {
- final EMHRun runReference = newScenar.getRunFromScenar(scenarPersist.RunCourant.NomRef);
+ final EMHRun runReference = newScenar.getRunFromScenar(scenarPersist.RunCourant.NomRef.trim());
// -- gestion du run courant --//
newScenar.setRunCourant(runReference);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -78,7 +78,7 @@
eltMetier.setDdeVact(eltPersistCaste.DdeVact);
eltMetier.setDdeVtot(eltPersistCaste.DdeVtot);
eltMetier.setDdeVc(eltPersistCaste.DdeVc);
- eltMetier.setDdeF(eltPersistCaste.DdeF);
+ eltMetier.setDdeFr(eltPersistCaste.DdeFr);
eltMetier.setDdeLact(eltPersistCaste.DdeLact);
eltMetier.setDdeLtot(eltPersistCaste.DdeLtot);
eltMetier.setDdeSact(eltPersistCaste.DdeSact);
@@ -234,7 +234,7 @@
eltPersist.DdeVact = sectionProfil.getDdeVact();
eltPersist.DdeVtot = sectionProfil.getDdeVtot();
eltPersist.DdeVc = sectionProfil.getDdeVc();
- eltPersist.DdeF = sectionProfil.getDdeF();
+ eltPersist.DdeFr = sectionProfil.getDdeFr();
eltPersist.DdeLact = sectionProfil.getDdeLact();
eltPersist.DdeLtot = sectionProfil.getDdeLtot();
eltPersist.DdeSact = sectionProfil.getDdeSact();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureETU.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureETU.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureETU.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -431,22 +431,6 @@
public FichRuns FichRuns;
}
- // public static class RunConverter implements SingleValueConverter {
- // public String toString(final Object obj) {
- // return ((Run) obj).Nom;
- // }
- //
- // public Object fromString(final String name) {
- // final Run pf = new Run();
- // pf.Nom = name;
- // return pf;
- // }
- //
- // public boolean canConvert(final Class type) {
- // return type.isInstance(Run.class);
- // }
- // }
-
public static class FichRuns {
public List<ModeleRun> Modeles;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureORES.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureORES.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureORES.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -121,7 +121,7 @@
/** Représente la valeur de la balise portant le même nom dans le fichier XML */
public boolean DdeVc;
/** Représente la valeur de la balise portant le même nom dans le fichier XML */
- public boolean DdeF;
+ public boolean DdeFr;
/** Représente la valeur de la balise portant le même nom dans le fichier XML */
public boolean DdeLact;
/** Représente la valeur de la balise portant le même nom dans le fichier XML */
Deleted: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/Crue9ResPrtAdapter.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -1,116 +0,0 @@
-/**
- * Licence GPL
- * Copyright Genesis
- */
-package org.fudaa.dodico.crue.io.neuf;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.fudaa.dodico.crue.metier.emh.ResPrtGeoCasier;
-import org.fudaa.dodico.crue.metier.emh.ResPrtGeoCasierContainer;
-import org.fudaa.dodico.crue.metier.emh.ResPrtGeoSectionContainer;
-import org.fudaa.dodico.crue.metier.emh.ResPrtReseau;
-
-/**
- * @author deniger
- */
-public class Crue9ResPrtAdapter extends ResPrtReseau {
-
- protected class DefaultResOnCasier extends ResPrtGeoCasierContainer {
- public DefaultResOnCasier(final String nom, final ResPrtGeoCasier res) {
- super();
- this.nom = nom;
- this.res = res;
- }
-
- private final String nom;
- private final ResPrtGeoCasier res;
-
- @Override
- public String getId() {
- return nom;
- }
-
- @Override
- public ResPrtGeoCasier getResultat() {
- return res;
- }
-
- }
-
- private final Map<String, ResPrtGeoCasierContainer> resSto;
- private final List<String> listCasier;
-
- private STRSequentialReader reader;
-
- /**
- * @return the reader
- */
- public STRSequentialReader getReader() {
- return reader;
- }
-
- /**
- * @param reader the reader to set
- */
- protected void setReader(STRSequentialReader reader) {
- this.reader = reader;
- }
-
- /**
- * @param readSto les resultat issus de sto.
- */
- public Crue9ResPrtAdapter(final Map<String, ResPrtGeoCasier> readSto) {
- this.resSto = new HashMap<String, ResPrtGeoCasierContainer>(readSto.size());
- final List tmplistCasier = new ArrayList<String>();
- for (final Map.Entry<String, ResPrtGeoCasier> it : readSto.entrySet()) {
- tmplistCasier.add(it.getKey());
- resSto.put(it.getKey(), new DefaultResOnCasier(it.getKey(), it.getValue()));
- }
- listCasier = Collections.unmodifiableList(tmplistCasier);
-
- }
-
- @Override
- public void close() {
- if (reader != null) {
- reader.close();
- }
-
- }
-
- @Override
- public int getNbResOnCasier() {
- return resSto.size();
- }
-
- @Override
- public int getNbResOnProfil() {
- return reader.getNbProfil();
- }
-
- @Override
- public String getCasierNom(final int idx) {
- return listCasier.get(idx);
- }
-
- @Override
- public String getProfilNom(final int idx) {
- return reader.getProfilName(idx);
- }
-
- @Override
- public ResPrtGeoCasierContainer getResultatOnCasier(final String nomCasier) {
- return resSto.get(nomCasier);
- }
-
- @Override
- public ResPrtGeoSectionContainer getResultatOnProfil(final String nomProfil) {
- return reader.getResultatOnProfil(nomProfil);
- }
-
-}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java 2010-01-28 14:37:32 UTC (rev 5654)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java 2010-01-29 00:09:41 UTC (rev 5655)
@@ -166,6 +166,7 @@
carte...
[truncated message content] |
|
From: <de...@us...> - 2010-02-23 23:09:48
|
Revision: 5686
http://fudaa.svn.sourceforge.net/fudaa/?rev=5686&view=rev
Author: deniger
Date: 2010-02-23 23:09:40 +0000 (Tue, 23 Feb 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcTransCasierProfilQruis.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrtConteneur.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonLoiHYConteneur.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModele.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdPrtCIniModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdPrtGeoModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/LoiFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaver.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderProperties.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/PropertyValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateModeleScenarioWithSchema.java
trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dcsp-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/common/AbstractTestCase.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/AbstractIOTestCase.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestConfigLoiReader.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDCLMFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDFRTFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/property/TestCrueNatureAndPropertyLoader.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestEMHPropertiesValidator.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestValidateModeleScenario.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CommonGuiLib.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/CrueProjet.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioSaverUI.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Sortable.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryInfoEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/ObjetNommeComparator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/RelationEMHComparator.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -27,6 +27,8 @@
*/
public class CtuluAnalyze {
+ public static Level FATAL = Level.ALL;
+
/**
* Constructeur par défaut
*/
@@ -129,7 +131,7 @@
* @param _m le message
*/
public void addFatalError(final String _m) {
- addError(_m);
+ addRecord(FATAL, _m);
}
/**
@@ -139,7 +141,7 @@
* @param _index le num de ligne
*/
public void addFatalError(final String _m, final int _index) {
- addErrorFromFile(_m, _index);
+ addRecord(FATAL, _m, Integer.valueOf(_index));
}
/**
@@ -147,8 +149,7 @@
* @param arg
*/
public void addFatalError(final String _m, final Object... arg) {
- // TODO a continuer
- addError(_m, arg);
+ addRecord(FATAL, _m, arg);
}
/**
@@ -158,7 +159,7 @@
* @param _in pour recuperer le num de ligne
*/
public void addFatalError(final String _m, final LineNumberReader _in) {
- addErrorFromFile(_m, _in);
+ addFatalError(_m, _in == null ? -1 : _in.getLineNumber());
}
/**
@@ -272,6 +273,10 @@
logs.clear();
}
+ public boolean containsErrorOrFatalError() {
+ return containsErrors() || containsFatalError();
+ }
+
/**
* @return true si contient au moins une erreur
*/
@@ -283,7 +288,7 @@
* @return true si contient une erreur fatale
*/
public boolean containsFatalError() {
- return containsErrors();
+ return containsLevel(FATAL);
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -139,7 +139,7 @@
public boolean containsError() {
if (isContentEmpty()) { return false; }
for (CtuluAnalyze analyze : analyser) {
- if (analyze.containsFatalError() || analyze.containsErrors()) { return true; }
+ if (analyze.containsErrorOrFatalError()) { return true; }
}
if (groups != null) {
for (CrueErrorManager mng : groups) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -259,4 +259,6 @@
public CrueProperties getCruePropertyDefinitionContainer();
+ public void sort();
+
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -1,6 +1,5 @@
package org.fudaa.dodico.crue.io.common;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -70,8 +69,7 @@
* @param conteneur le conteneur
* @return le crueData qui va bien
*/
- public static CrueData buildFor(final CatEMHConteneur conteneur,
- final CrueProperties propertyDefContainer) {
+ public static CrueData buildFor(final CatEMHConteneur conteneur, final CrueProperties propertyDefContainer) {
if (conteneur.getCatType().equals(EnumTypeEMH.SCENARIO)) { return new CrueDataImpl((EMHScenario) conteneur, null,
((EMHScenario) conteneur).getConcatSousModele(), propertyDefContainer); }
if (conteneur.getCatType().equals(EnumTypeEMH.MODELE)) { return new CrueDataImpl(null, (EMHModeleBase) conteneur,
@@ -95,7 +93,7 @@
// private List<ResPrtGeo> rptg;
final EMHScenario scenarioData;
- private final EMHSousModele ssModele;
+ final EMHSousModele ssModele;
private final EMHNoeudFactory nodeFactory;
@@ -221,13 +219,14 @@
* @return
*/
public List<EMH> getAllSimpleEMH() {
- final List<EMH> listeTotale = new ArrayList<EMH>();
- listeTotale.addAll(getNoeuds());
- listeTotale.addAll(getBranches());
- listeTotale.addAll(getSections());
- listeTotale.addAll(getCasiers());
+ return EMHHelper.collectEMHInRelationEMHContient(ssModele);
+ }
- return listeTotale;
+ public void sort() {
+ scenarioData.sort();
+ modele.sort();
+ ssModele.sort();
+
}
public List<CatEMHBranche> getBranches() {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -388,7 +388,7 @@
loi = (LoiDF) getLoiFromReferenceDLHY(eltPersist.HydrogrammeQruis.NomRef, dataLinked, analyzer);
}
- eltMetier.setHydrogrammeQruis(loi);
+ eltMetier.setLoiTQruis(loi);
calculTransMetier.addCalcTransCasierProfilQruis(eltMetier);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCSP.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -51,6 +51,8 @@
import org.fudaa.dodico.crue.metier.emh.ElemSeuilAvecPdc;
import org.fudaa.dodico.crue.metier.emh.LoiFF;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.metier.helper.FactoryInfoEMH;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* Factory qui se charge de remplir les structures DAO du ficheir DCSP avec les donn�es m�tier et inversement.
@@ -90,8 +92,8 @@
if (casier == null) {
analyser.addInfo("io.global.cantFindCasier.error", daoCasier.NomRef);
}
- final DonCalcSansPrtCasierProfil dcsp = new DonCalcSansPrtCasierProfil(dataLinked
- .getCruePropertyDefinitionContainer());
+ CrueProperties cruePropertyDefinitionContainer = dataLinked.getCruePropertyDefinitionContainer();
+ DonCalcSansPrtCasierProfil dcsp = FactoryInfoEMH.getDCSPCasierProfil(casier, cruePropertyDefinitionContainer);
dcsp.setCoefRuis(daoCasier.CoefRuis);
casier.addInfosEMH(dcsp);
}
@@ -150,6 +152,9 @@
}
}
}
+ if (res.DonCalcSansPrtCasiers.isEmpty()) {
+ res.DonCalcSansPrtCasiers = null;
+ }
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -1,6 +1,7 @@
package org.fudaa.dodico.crue.io.dao;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -26,6 +27,7 @@
import org.fudaa.dodico.crue.metier.emh.PtEvolutionFF;
import org.fudaa.dodico.crue.metier.emh.PtProfil;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.metier.helper.ObjetNommeComparator;
/**
* Factory qui se charge de remplir les structures DAO du fichier DPTG avec les données métier et inversement.
@@ -114,6 +116,10 @@
saveDonPrtGeoProfilSection(analyser, res, listeProfilUniqueReference, donPrtGeoProfilSection);
}
+ Collections.sort(res.DonPrtGeoBranches, ObjetNommeComparator.INSTANCE);
+ Collections.sort(res.DonPrtGeoCasiers, ObjetNommeComparator.INSTANCE);
+ Collections.sort(res.DonPrtGeoProfilSections, ObjetNommeComparator.INSTANCE);
+ Collections.sort(res.DonPrtGeoSections, ObjetNommeComparator.INSTANCE);
return res;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -74,6 +74,7 @@
import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBranche;
import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBrancheSaintVenant;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.metier.helper.FactoryEMH;
import org.fudaa.dodico.crue.metier.helper.FactoryEMHRelation;
/**
@@ -443,7 +444,7 @@
// -- on recherche sa spécialisation --//
if (casierPersist instanceof CasierProfil) {
- casier = new EMHCasierProfil(nom);
+ casier = FactoryEMH.createCasierProfil(nom, data.getCruePropertyDefinitionContainer());
final CasierProfil casierProfilPersist = (CasierProfil) casierPersist;
if (CollectionUtils.isNotEmpty(casierProfilPersist.ProfilCasiers)) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -2,14 +2,15 @@
import java.util.List;
+import com.thoughtworks.xstream.XStream;
+
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.crue.io.common.CrueFileType;
import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
+import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
import org.fudaa.dodico.crue.metier.emh.PtProfil;
import org.fudaa.dodico.crue.property.CrueProperties;
-import com.thoughtworks.xstream.XStream;
-
/**
* Toutes les structures dao utilisées et les inits du parser xml pour le format DPTG. Toutes ces structures sont
* nécessaires pour bien formatter le contenu xml. Ici il n'y a pas besoin de définir de sttructures supplémentaires.
@@ -60,7 +61,19 @@
xstream.useAttributeFor(BrancheSaintVenant.class, "NomRef");
}
- protected static class ProfilSection {
+ protected static class ProfilSection implements ObjetNomme {
+ public String getId() {
+ return Nom;
+ }
+
+ public String getNom() {
+ return Nom;
+ }
+
+ public void setNom(String newNom) {
+ Nom = newNom;
+ }
+
protected String Nom;
/**
* optionnel.
@@ -92,7 +105,20 @@
}
- protected static class AbstractCasier {
+ protected static class AbstractCasier implements ObjetNomme {
+ public String getId() {
+ return Nom;
+ }
+
+ public String getNom() {
+ return Nom;
+ }
+
+ public void setNom(String newNom) {
+ Nom = newNom;
+
+ }
+
protected String Nom;
}
@@ -110,16 +136,41 @@
// -------------- SECTIONS -------------------//
- protected static class SectionIdem {
+ protected static class SectionIdem implements ObjetNomme {
protected String NomRef;
protected double Dz;
+
+ public String getId() {
+ return NomRef;
+ }
+
+ public String getNom() {
+ return NomRef;
+ }
+
+ public void setNom(String newNom) {
+ NomRef = newNom;
+ }
+
}
// -------------- BRANCHES -------------------//
- protected static class BrancheSaintVenant {
+ protected static class BrancheSaintVenant implements ObjetNomme {
protected String NomRef;
protected double CoefSinuo;
+ public String getId() {
+ return NomRef;
+ }
+
+ public String getNom() {
+ return NomRef;
+ }
+
+ public void setNom(String newNom) {
+ NomRef = newNom;
+ }
+
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -75,11 +75,17 @@
}
final String[] titles = StringUtils.splitPreserveAllTokens(commentaire, '|');
for (int i = 0; i < Math.min(NB_LINES_TITLE, titles.length); i++) {
+ String trim = titles[i].trim();
if (writeTitre) {
- fortranWriter.stringField(0, CrueIODico.TITRE);
- fortranWriter.stringField(1, titles[i]);
+
+ if (trim.length() > 0) {
+ fortranWriter.stringField(0, CrueIODico.TITRE + " ");
+ fortranWriter.stringField(1, trim);
+ } else {
+ fortranWriter.stringField(0, CrueIODico.TITRE);
+ }
} else {
- fortranWriter.stringField(0, titles[i]);
+ fortranWriter.stringField(0, trim);
}
fortranWriter.writeFields();
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -85,6 +85,7 @@
import org.fudaa.dodico.crue.metier.emh.ValParamEntier;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.metier.helper.FactoryEMH;
+import org.fudaa.dodico.crue.metier.helper.FactoryInfoEMH;
import org.fudaa.dodico.crue.property.CrueLoaderPropertiesDefault;
import org.fudaa.dodico.crue.property.CrueNumberUtils;
import org.fudaa.dodico.crue.validation.CruePrefix;
@@ -1355,8 +1356,8 @@
// -- on lit la suite --//
lireSuite();
- final EMHCasierProfil newCasier = new EMHCasierProfil(CruePrefix.changePrefix(idNoeud, CruePrefix.P_NOEUD,
- CruePrefix.P_CASIER));
+ final EMHCasierProfil newCasier = FactoryEMH.createCasierProfil(CruePrefix.changePrefix(idNoeud,
+ CruePrefix.P_NOEUD, CruePrefix.P_CASIER), metier.getCruePropertyDefinitionContainer());
newCasier.setUserActive(true);
CatEMHNoeud noeudRef = metier.findNoeudByReference(idNoeud);
@@ -1385,7 +1386,7 @@
// TODO utiliser TDoubleArrayList
final List<Double> abscissesLimiteX = new ArrayList<Double>();
// valeurs par defaut
- final DonCalcSansPrtCasierProfil dataDPTGQRuis = new DonCalcSansPrtCasierProfil(metier
+ DonCalcSansPrtCasierProfil dataDPTGQRuis = FactoryInfoEMH.getDCSPCasierProfil(newCasier, metier
.getCruePropertyDefinitionContainer());
newCasier.addInfosEMH(dataDPTGQRuis);
DonPrtGeoProfilCasier dataDPTG = null;
@@ -1544,7 +1545,7 @@
private LoiFF createLoiZavZam(final String idBranche) {
final LoiFF newLoi = new LoiFF();
- newLoi.setNom(CruePrefix.addPrefixIfNeeded(EnumTypeLoi.LoiZavZam, idBranche));
+ newLoi.setNom(CruePrefix.addPrefixIfNeeded(idBranche, EnumTypeLoi.LoiZavZam));
newLoi.setEvolutionFF(new EvolutionFF(new ArrayList<PtEvolutionFF>()));
newLoi.setType(EnumTypeLoi.LoiZavZam);
dataLinked.getLoiConteneur().addLois(newLoi);
@@ -2097,7 +2098,7 @@
if (comm.length() > 0) {
comm.append('|');
}
- comm.append(StringUtils.removeStart(in_.getLine(), CrueIODico.TITRE));
+ comm.append(StringUtils.removeStart(in_.getLine(), CrueIODico.TITRE).trim());
} else {
readSuite = false;
break;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -3,9 +3,12 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import com.thoughtworks.xstream.converters.SingleValueConverter;
+
import org.apache.commons.collections.CollectionUtils;
import org.fudaa.ctulu.CtuluActivity;
import org.fudaa.ctulu.CtuluLib;
@@ -68,8 +71,6 @@
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.metier.helper.LoiHelper;
-import com.thoughtworks.xstream.converters.SingleValueConverter;
-
/**
* Writer de la structure DC.
*
@@ -413,6 +414,7 @@
// écrit dans le DH
fortranWriter.doubleField(1, 1);
fortranWriter.writeFields();
+ break;
}
}
}
@@ -642,7 +644,9 @@
// LIT STOCKD 1
// LIT STOCKG 7
- for (final String key : mapNomsLits.keySet()) {
+ List<String> keySet = new ArrayList<String>(mapNomsLits.keySet());
+ Collections.sort(keySet);
+ for (final String key : keySet) {
cpt = 0;
fortranWriter.stringField(cpt++, CrueIODico.LIT);
fortranWriter.stringField(cpt++, key);
@@ -819,16 +823,17 @@
fortranWriter.stringField(indiceFortran++, carteToUse);
for (final PtEvolutionFF pt : liste) {
- // on inverse tout le temps dans dc
- fortranWriter.doubleField(indiceFortran++, pt.getY());
- fortranWriter.doubleField(indiceFortran++, pt.getX());
- cptCouples++;
if (cptCouples >= nbMaxCouples) {
indiceFortran = 0;
cptCouples = 0;
fortranWriter.writeFields(createFmtXZ());
fortranWriter.stringField(indiceFortran++, carteToUse);
}
+ // on inverse tout le temps dans dc
+ fortranWriter.doubleField(indiceFortran++, pt.getY());
+ fortranWriter.doubleField(indiceFortran++, pt.getX());
+ cptCouples++;
+
}
fortranWriter.writeFields(createFmtXZ());
}
@@ -951,8 +956,8 @@
if (branche.getDCSP() != null) {
for (final DonCalcSansPrt dcsp : branche.getDCSP()) {
if (dcsp instanceof DonCalcSansPrtBrancheSaintVenant) {
- final double ruis = ((DonCalcSansPrtBrancheSaintVenant) dcsp).getCoefRuis();
- final double alpha = ((DonCalcSansPrtBrancheSaintVenant) dcsp).getCoefBeta();
+ // final double ruis = ((DonCalcSansPrtBrancheSaintVenant) dcsp).getCoefRuis();
+ // final double alpha = ((DonCalcSansPrtBrancheSaintVenant) dcsp).getCoefBeta();
fortranWriter.stringField(0, CrueIODico.BRANCHE_RUIS);
// on met toujours 1 dans le dc, c'est le dh qui se chargera de spécifier les coef.
fortranWriter.doubleField(1, 1);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-02-19 17:49:39 UTC (rev 5685)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-02-23 23:09:40 UTC (rev 5686)
@@ -31,6 +31,7 @@
import org.fudaa.dodico.crue.metier.emh.CalcTrans;
import org.fudaa.dodico.crue.metier.emh.CalcTransBrancheOrificeManoeuvre;
import org.fudaa.dodico.crue.metier.emh.CalcTransBrancheSaintVenantQruis;
+import org.fudaa.dodico.crue.metier.emh.CalcTransCasierProfilQruis;
import org.fudaa.dodico.crue.metier.emh.CalcTransItem;
import org.fudaa.dodico.crue.metier.emh.CalcTransNoeudNiveauContinuLimnigramme;
import org.fudaa.dodico.crue.metier.emh.CalcTransNoeudNiveauContinuQapp;
@@ -88,6 +89,7 @@
import org.fudaa.dodico.crue.metier.emh.ValParamDouble;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.metier.helper.FactoryEMH;
+import org.fudaa.dodico.crue.metier.helper.FactoryInfoEMH;
import org.fudaa.dodico.crue.metier.helper.LoiFactory;
import org.fudaa.dodico.crue.metier.helper.LoiHelper;
import org.fudaa.dodico.crue.property.CrueProperties;
@@ -588,18 +590,9 @@
if (casier == null) {
analyze_.addWarn("io.dh.ref.emhnoeud.coefRuis.noCasier.error", noeudName);
} else {
-
- final List<DonCalcSansPrtCasierProfil> dptis = EMHHelper.collectClass(casier.getInfosEMH(),
- DonCalcSansPrtCasierProfil.class);
- if (CollectionUtils.isEmpty(dptis)) {
- // TODO trop bizarre ! pas un coef !
- final DonCalcSansPrtCasierProfil cini = new DonCalcSansPrtCasierProfil(res
- .getCruePropertyDefinitionContainer());
- noeud.addInfosEMH(cini);
- }
- for (final DonCalcSansPrtCasierProfil condInit : dptis) {
- condInit.setCoefRuis(condInit.getCoefRuis() * coefRuis);
- }
+ final DonCalcSansPrtCasierProfil condInit = FactoryInfoEMH.getDCSPCasierProfil(casier, res
+ .getCruePropertyDefinitionContainer());
+ condInit.setCoefRuis(condInit.getCoefRuis() * coefRuis);
}
}
@@ -612,7 +605,7 @@
return true;
}
- private void addDptiInBranche(final double debitInitial, final CatEMHBranche br, CrueData res) {
+ private void addDptiInBranche(final double debitInitial, final CatEMHBranche br, final CrueData res) {
List<DonPrtCIni> dptis = br.getDPTI();
if (CollectionUtils.isEmpty(dptis)) {
if (br instanceof EMHBrancheSaintVenant) {
@@ -700,7 +693,7 @@
*/
private void readDonneesPermanentes(final CompositeReader reader, final CrueData res, final double cru)
throws IOException {
- CrueProperties cruePropertyDefinitionContainer = dataLinked.getCruePropertyDefinitionContainer();
+ final CrueProperties cruePropertyDefinitionContainer = dataLinked.getCruePropertyDefinitionContainer();
// Ligne A : DTPJ, DTPH, DTPM, DTPS, TOLZ, TOLQ, ICALMX, IPRINT, NDECOU
reader.readLine();
final Duration dtperm = readDuration(reader);
@@ -924,7 +917,7 @@
calcPerm.setNom(CruePrefix.P_CALCUL + "P" + (nbEtatPermanent + 1));
calcPerm.setDescription("Calcul permanent " + (nbEtatPermanent + 1));
// pour le premier on prend en compte la reprise éventuelle
- boolean first = ocal.getOrdCalc().isEmpty();
+ final boolean first = ocal.getOrdCalc().isEmpty();
if (reprise != null && first) {
reprise.setCalcPseudoPerm(calcPerm);
ocal.addOrdCalc(reprise);
@@ -1310,15 +1303,6 @@
while (!FIN.equalsIgnoreCase(reader.stringField(0))) {
- // TODO CDE : n'y a t-il pas une erreur dans la spec ? Car ...
[truncated message content] |
|
From: <de...@us...> - 2010-02-27 15:38:56
|
Revision: 5697
http://fudaa.svn.sourceforge.net/fudaa/?rev=5697&view=rev
Author: deniger
Date: 2010-02-27 15:38:37 +0000 (Sat, 27 Feb 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Reader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/FichierCrueManager.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHContainerBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHModeleBase.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHSousModele.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHConteneurDeSousModele.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModele.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Pdt.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PdtCst.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/ObjetNommeComparator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaverCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaverCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/common/TestCrueDataImpl.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/CrueProjet.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioSaverUI.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CommentaireContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Commentaires.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/SimpleClassNameComparator.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -138,7 +138,6 @@
/**
* @param lois the lois to set
*/
- // void addLois(final List<Loi> lois);
ParamCalcScenario getParamCalc();
void setParamCalc(final ParamCalcScenario paramCalc);
@@ -244,7 +243,9 @@
List<EMHBrancheSaintVenant> getBranchesSaintVenant();
/**
- * boolean pour indiquer les fichiers crue 9 contiennent des cartes distmax. Dans ce cas, la lecture des fichiers de resultats ne doivent pas se faire.
+ * boolean pour indiquer les fichiers crue 9 contiennent des cartes distmax. Dans ce cas, la lecture des fichiers de
+ * resultats ne doivent pas se faire.
+ *
* @return true si contient distmax
*/
public boolean isCrue9ContientDistmax();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -39,8 +39,8 @@
import org.fudaa.dodico.crue.property.CrueProperties;
/**
- * CrueData est un conteneur de donn�es Crue, il contient des donnees EMH de chaque cat�gorie pour optimiser leur acc�s.
- * Il contient les donn�es d'entr�es DFRT de frottements.
+ * CrueData est un conteneur de donnees Crue, il contient des donnees EMH de chaque categorie pour optimiser leur acces.
+ * Il contient les donnees d'entrees DFRT de frottements.
*
* @author Adrien Hadoux
*/
@@ -136,6 +136,7 @@
public CrueDataImpl(final EMHNoeudFactory nodeFactory, final CrueProperties propertyDefContainer) {
scenarioData = new EMHScenario(propertyDefContainer);
+ scenarioData.getLoiConteneur();
this.propertyDefContainer = propertyDefContainer;
ssModele = new EMHSousModele();
modele = new EMHModeleBase();
@@ -147,6 +148,9 @@
super();
this.propertyDefContainer = propertyDefContainer;
this.scenarioData = scenarioData;
+ if (scenarioData != null) {
+ scenarioData.getLoiConteneur();
+ }
this.ssModele = ssModele;
this.modele = modele;
nodeFactory = new EMHNoeudFactory();
@@ -176,13 +180,6 @@
EMHHelper.addRelationContientEMH(ssModele, object);
}
- /**
- * @param lois the lois to set
- */
- public void addLois(final List<Loi> lois) {
- scenarioData.getLoiConteneur().addAllLois(lois);
- }
-
public CatEMHBranche findBrancheByReference(final String ref) {
return EMHHelper.selectEMHInRelationEMHContientByRef(ssModele, ref, EnumTypeEMH.BRANCHE);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -310,7 +310,9 @@
litNum.setLimFin(litPersist.LimFin);
litNum.setIsLitActif(litPersist.IsLitActif);
litNum.setIsLitMineur(litPersist.IsLitMineur);
- litNum.setNomLit(new LitNomme(litPersist.LitNomme));
+ if (litPersist.LitNomme != null) {
+ litNum.setNomLit(new LitNomme(litPersist.LitNomme));
+ }
// -- recherche de référence au bon DonFrt --//
if (litPersist.Frot != null) {
final String idFrottement = litPersist.Frot.NomRef;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1,6 +1,5 @@
package org.fudaa.dodico.crue.io.dao;
-import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
@@ -20,12 +19,6 @@
public class CrueHelper {
/**
- * @return le commentaire par defaut pour les fichier
- */
- public static String getDefaultCommentaire() {
- return "Genere par Fudaa le " + new Date(System.currentTimeMillis());} //$NON-NLS-1$
-
- /**
* symbole de connexion utilis� pour les balises de relation P�re/fils afin de pr�server les contraintes d'unicit� de
* structure.
*/
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -25,6 +25,7 @@
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer;
+import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.ctulu.CtuluLibFile;
import org.fudaa.dodico.crue.io.common.CrueData;
@@ -105,8 +106,7 @@
return xsdId;
}
- protected final void configureXStream(final XStream xstream, final CtuluAnalyze analyse,
- CrueProperties props) {
+ protected final void configureXStream(final XStream xstream, final CtuluAnalyze analyse, CrueProperties props) {
daoConfigurer.configureXStream(xstream, analyse, props);
}
@@ -336,8 +336,7 @@
this.isIndependant = isIndependant;
}
- protected boolean writeDAO(final File file, final D dao, final CtuluAnalyze analyser,
- CrueProperties props) {
+ protected boolean writeDAO(final File file, final D dao, final CtuluAnalyze analyser, CrueProperties props) {
FileOutputStream out = null;
boolean ok = true;
try {
@@ -359,14 +358,13 @@
* @param analyser le receveur d'information
* @return
*/
- protected boolean writeDAO(final OutputStream out, final D dao, final CtuluAnalyze analyser,
- CrueProperties props) {
+ protected boolean writeDAO(final OutputStream out, final D dao, final CtuluAnalyze analyser, CrueProperties props) {
boolean isOk = true;
try {
final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
writer.write(ValidatorXml.enteteXml + "\n");
if (dao.Commentaire == null) {
- dao.Commentaire = CrueHelper.getDefaultCommentaire();
+ dao.Commentaire = StringUtils.EMPTY;
}
final XStream parser = initXmlParser(analyser, props);
parser.toXML(dao, writer);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Reader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Reader.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Reader.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -117,7 +117,8 @@
do {
in.readFields();
res = in.getLine().trim();
- } while (!label.equals(in.stringField(0).toLowerCase().trim()));
+ }
+ while (!label.equals(in.stringField(0).toLowerCase().trim()));
return readAndAvoidLabel(in);
}
return res;
@@ -135,7 +136,7 @@
for (int i = 0; i < AbstractCrue9Reader.NB_LINES_TITLE; i++) {
if (i > 0) {
- comm.append('|');
+ comm.append('\n');
}
comm.append(readAndAvoidLabel(in_));
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -3,8 +3,6 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
-import java.text.DateFormat;
-import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluAnalyze;
@@ -69,11 +67,8 @@
*/
public void writeHeader(final CrueIOResu<CrueData> data, boolean writeTitre) throws IOException {
writeCom("");
- String commentaire = data.getCrueCommentaire();
- if (StringUtils.isBlank(commentaire)) {
- commentaire = "Generé par FUDAA le " + DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
- }
- final String[] titles = StringUtils.splitPreserveAllTokens(commentaire, '|');
+ String commentaire = StringUtils.defaultString(data.getCrueCommentaire());
+ final String[] titles = StringUtils.splitPreserveAllTokens(commentaire, '\n');
for (int i = 0; i < Math.min(NB_LINES_TITLE, titles.length); i++) {
String trim = titles[i].trim();
if (writeTitre) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1530,7 +1530,7 @@
newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQDz));
newLoi.setType(EnumTypeLoi.LoiQDz);
newLoi.setEvolutionFF(new EvolutionFF(new ArrayList<PtEvolutionFF>()));
- dataLinked.getLoiConteneur().addLois(newLoi);
+ // dataLinked.getLoiConteneur().addLois(newLoi);
return newLoi;
}
@@ -1539,7 +1539,7 @@
newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQpilZam));
newLoi.setType(EnumTypeLoi.LoiQpilZam);
newLoi.setEvolutionFF(new EvolutionFF(new ArrayList<PtEvolutionFF>()));
- dataLinked.getLoiConteneur().addLois(newLoi);
+ // dataLinked.getLoiConteneur().addLois(newLoi);
return newLoi;
}
@@ -1548,7 +1548,7 @@
newLoi.setNom(CruePrefix.addPrefixIfNeeded(idBranche, EnumTypeLoi.LoiZavZam));
newLoi.setEvolutionFF(new EvolutionFF(new ArrayList<PtEvolutionFF>()));
newLoi.setType(EnumTypeLoi.LoiZavZam);
- dataLinked.getLoiConteneur().addLois(newLoi);
+ // dataLinked.getLoiConteneur().addLois(newLoi);
return newLoi;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -558,7 +558,7 @@
}
// -- les noms des lits nommees --//
- if (lit.getNomLit() != null) {
+ if (lit.getNomLit() != null && lit.getNomLit().getNom() != null) {
String nom = lit.getNomLit().getNom();
// -- cas particulier pour les lits isMineur=true: ces lit doivent etre renomes en MINEUR--//
if (lit.getIsLitMineur()) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1686,7 +1686,7 @@
final StringBuilder comm = new StringBuilder(420);
for (int i = 0; i < NB_LINES_TITLE; i++) {
if (i > 0) {
- comm.append('|');
+ comm.append('\n');
}
comm.append(reader.readLine());
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/FichierCrueManager.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/FichierCrueManager.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/FichierCrueManager.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1,6 +1,5 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.metier;
@@ -23,7 +22,6 @@
private List<FichierCrue> publicFichiers;
private final List<FichierCrue> fichiers;
private final Map<CrueFileType, FichierCrue> idFichier;
- private final Map<CrueFileType, String> commentaires;
/**
* @param fichiers la liste des fichiers gérés par ce manager
@@ -32,30 +30,12 @@
super();
this.fichiers = new ArrayList<FichierCrue>(fichiers);
idFichier = new HashMap<CrueFileType, FichierCrue>(fichiers.size());
- commentaires = new HashMap<CrueFileType, String>(fichiers.size());
for (FichierCrue fichierCrue : fichiers) {
idFichier.put(fichierCrue.getType(), fichierCrue);
}
}
- public void setCommentaire(CrueFileType type, String com) {
- commentaires.put(type, com);
- }
-
- public void setCommentaire(FichierCrue type, String com) {
- commentaires.put(type.getType(), com);
- }
-
- public String getCommentaire(CrueFileType type) {
- return commentaires.get(type);
- }
-
- public String getCommentaire(FichierCrue type) {
- return commentaires.get(type.getType());
- }
-
public void clean() {
- commentaires.clear();
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHContainerBase.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHContainerBase.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHContainerBase.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1,6 +1,5 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.metier;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHModeleBase.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHModeleBase.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHModeleBase.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -13,10 +13,8 @@
setNom(id);
}
- public ManagerEMHModeleBase() {
+ public ManagerEMHModeleBase() {}
- }
-
@Override
public void clean() {
super.clean();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHScenario.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHScenario.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHScenario.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -20,37 +20,6 @@
*/
public class ManagerEMHScenario extends ManagerEMHContainer<ManagerEMHModeleBase> {
- private boolean compatibleCrue9 = true;
- private boolean compatibleCrue10 = true;
-
- /**
- * @return the compatibleCrue10
- */
- public boolean isCompatibleCrue10() {
- return compatibleCrue10;
- }
-
- /**
- * @param compatibleCrue10 the compatibleCrue10 to set
- */
- public void setCompatibleCrue10(final boolean compatibleCrue10) {
- this.compatibleCrue10 = compatibleCrue10;
- }
-
- /**
- * @return the compatibleCrue9
- */
- public boolean isCompatibleCrue9() {
- return compatibleCrue9;
- }
-
- /**
- * @param compatibleCrue9 the compatibleCrue9 to set
- */
- public void setCompatibleCrue9(final boolean compatibleCrue9) {
- this.compatibleCrue9 = compatibleCrue9;
- }
-
private EMHScenario emh;
/**
@@ -104,8 +73,6 @@
@Override
public void clean() {
super.clean();
- setCompatibleCrue10(true);
- setCompatibleCrue9(true);
if (emh != null) {
if (emh.getRptg() != null) {
emh.getRptg().close();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHSousModele.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHSousModele.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHSousModele.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1,6 +1,5 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.metier;
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CommentaireContainer.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CommentaireContainer.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CommentaireContainer.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -0,0 +1,10 @@
+package org.fudaa.dodico.crue.metier.emh;
+
+/**
+ * @author deniger
+ */
+public interface CommentaireContainer {
+
+ Commentaires getCommentaires();
+
+}
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Commentaires.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Commentaires.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Commentaires.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -0,0 +1,37 @@
+package org.fudaa.dodico.crue.metier.emh;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.fudaa.dodico.crue.io.common.CrueFileType;
+import org.fudaa.dodico.crue.metier.FichierCrue;
+
+/**
+ * @author deniger
+ */
+public class Commentaires {
+
+ private final Map<CrueFileType, String> commentaires = new HashMap<CrueFileType, String>();
+ private Map<CrueFileType, String> commentairesIm;
+
+ public Map<CrueFileType, String> getContent() {
+ if (commentairesIm == null) {
+ commentairesIm = Collections.unmodifiableMap(commentaires);
+ }
+ return commentairesIm;
+ }
+
+ public void setCommentaire(CrueFileType type, String com) {
+ commentaires.put(type, com);
+ }
+
+ public void setCommentaire(FichierCrue type, String com) {
+ commentaires.put(type.getType(), com);
+ }
+
+ public String getCommentaire(CrueFileType type) {
+ return commentaires.get(type);
+ }
+
+}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -8,6 +8,7 @@
import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalcul;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.metier.helper.RelationEMHComparator;
+import org.fudaa.dodico.crue.metier.helper.SimpleClassNameComparator;
/** @pdOid 04144c01-720d-499c-8dff-98d76efec46a */
public abstract class EMH implements ObjetNomme, Sortable {
@@ -58,6 +59,7 @@
}
}
+ Collections.sort(infosEMH, SimpleClassNameComparator.INSTANCE);
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHConteneurDeSousModele.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHConteneurDeSousModele.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHConteneurDeSousModele.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1,17 +1,24 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.metier.emh;
-
/**
* @author deniger
*/
-public abstract class EMHConteneurDeSousModele extends CatEMHConteneur {
+public abstract class EMHConteneurDeSousModele extends CatEMHConteneur implements CommentaireContainer {
private EMHSousModele concat;
+ Commentaires commentaires;
+
+ public Commentaires getCommentaires() {
+ if (commentaires == null) {
+ commentaires = new Commentaires();
+ }
+ return commentaires;
+ }
+
/**
* Efface le contenu
*/
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModele.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModele.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModele.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -9,13 +9,22 @@
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
/** @pdOid 509ab2d5-6ed9-4ab5-82c4-62e4ed7a00e6 */
-public class EMHSousModele extends CatEMHConteneur {
+public class EMHSousModele extends CatEMHConteneur implements CommentaireContainer {
/** @pdOid 8b4778b9-4149-45c0-9552-6fde001f4799 */
@Override
public EnumTypeEMH getCatType() {
return EnumTypeEMH.SOUS_MODELE;
}
+ Commentaires commentaires;
+
+ public Commentaires getCommentaires() {
+ if (commentaires == null) {
+ commentaires = new Commentaires();
+ }
+ return commentaires;
+ }
+
@Override
public EMHSousModele getConcatSousModele() {
return this;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Pdt.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Pdt.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Pdt.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -1,10 +1,10 @@
/***********************************************************************
- * Module: Pdt.java
- * Author: battista
- * Purpose: Defines the Class Pdt
+ * Module: Pdt.java Author: battista Purpose: Defines the Class Pdt
***********************************************************************/
package org.fudaa.dodico.crue.metier.emh;
/** @pdOid 3e2fe7bd-cf9d-449a-b885-76fcc0027cfe */
-public class Pdt {}
\ No newline at end of file
+public class Pdt {
+
+}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PdtCst.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PdtCst.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/PdtCst.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -18,7 +18,7 @@
@Override
public String toString() {
- return getClass().getSimpleName() + ": " + pdtCst;
+ return "Cst: " + (pdtCst == null ? "null" : (pdtCst.getStandardSeconds() + " s"));
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -614,6 +614,7 @@
res.addAllInfos(selectClass);
}
+ res.sort();
return res;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/ObjetNommeComparator.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/ObjetNommeComparator.java 2010-02-25 12:41:34 UTC (rev 5696)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/ObjetNommeComparator.java 2010-02-27 15:38:37 UTC (rev 5697)
@@ -28,7 +28,7 @@
return compareString == 0 ? o1.hashCode() - o2.hashCode() : compareString;
}
- public int compareString(String o1, String o2) {
+ public static int compareString(String o1, String o2) {
if (o1 == o2) { return 0; }
if (o1 == null) { return -1; }
if (o2 == null) { return 1; }
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/SimpleClassNameComparator.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/SimpleClassNameComparator.java (rev 0)
+++ trunk/soft/fudaa-crue/dodi...
[truncated message content] |
|
From: <de...@us...> - 2010-03-01 00:33:48
|
Revision: 5698
http://fudaa.svn.sourceforge.net/fudaa/?rev=5698&view=rev
Author: deniger
Date: 2010-03-01 00:33:40 +0000 (Mon, 01 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractSingleConverterPoint.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOCAL.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ErrorHandlerDefault.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoProfilSectionFenteData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/ObjetNommeComparator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaverCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CrueEditorImplementation.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/UserPreferencesSaver.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioLoaderUI.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/RegleTypeComparator.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHManagerBuilder.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumVariable.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -13,8 +13,8 @@
private final EqualsTesterDouble profondeurFente;
/**
- * @param abs le tester pour l'abscisse
- * @param ord le tester pour l'ordonnée.
+ * @param largeurFente le tester pour l'abscisse
+ * @param profondeurFente le tester pour l'ordonnée.
*/
public EqualsTesterFente(final EqualsTesterDouble largeurFente, final EqualsTesterDouble profondeurFente) {
super();
@@ -31,14 +31,14 @@
public boolean isSameSafe(final DonPrtGeoProfilSectionFenteData o1, final DonPrtGeoProfilSectionFenteData o2,
final ResultatTest res, final TesterContext context) {
boolean bool = true;
- if (largeurFente.isSameDouble(o1.getLargeurFente(), o2.getLargeurFente())) {
+ if (!largeurFente.isSameDouble(o1.getLargeurFente(), o2.getLargeurFente())) {
bool = false;
if (res != null) {
res.addDiff(new ResultatTest(o1.getLargeurFente(), o2.getLargeurFente(), "compare.property.diff",
"largeurFentre"));
}
}
- if (profondeurFente.isSameDouble(o1.getProfondeurFente(), o2.getProfondeurFente())) {
+ if (!profondeurFente.isSameDouble(o1.getProfondeurFente(), o2.getProfondeurFente())) {
bool = false;
if (res != null) {
res.addDiff(new ResultatTest(o1.getProfondeurFente(), o2.getProfondeurFente(), "compare.property.diff",
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractSingleConverterPoint.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractSingleConverterPoint.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractSingleConverterPoint.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -1,6 +1,5 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.io.dao;
@@ -9,7 +8,8 @@
import org.fudaa.dodico.crue.io.common.AbstractSingleConverter;
import org.fudaa.dodico.crue.metier.emh.Point2D;
-// TODO pour Fred : cette classe est similaire à SingleConverterPtProfil (seuls les objets métier utilisés sont différents). Ne pourrait-on pas mutualiser l'analyse et l'affichage du point FF ?
+// TODO pour Fred : cette classe est similaire à SingleConverterPtProfil (seuls les objets métier utilisés sont
+// différents). Ne pourrait-on pas mutualiser l'analyse et l'affichage du point FF ?
/**
* @author deniger
*/
@@ -36,7 +36,7 @@
final String[] xy = StringUtils.split(str);
if (xy == null || xy.length != 2) {
if (analyse != null) {
- analyse.addError("io.convert.PtEvolutionFF.error", str);
+ analyse.addFatalError("io.convert.PtEvolutionFF.error", str);
}
return null;
}
@@ -45,7 +45,7 @@
res = createFor(Double.parseDouble(xy[0]), Double.parseDouble(xy[1]));
} catch (final NumberFormatException e) {
if (analyse != null) {
- analyse.addError("io.convert.PtEvolutionFF.error", str);
+ analyse.addFatalError("io.convert.PtEvolutionFF.error", str);
}
return null;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -291,11 +291,19 @@
// -- on remplit son contenu --//
profilGeo.setNom(profilPersist.Nom);
- if (profilPersist.LargeurFente != null) {
+ if (profilPersist.LargeurFente != null || profilPersist.ProfondeurFente != null) {
final DonPrtGeoProfilSectionFenteData dataFente = new DonPrtGeoProfilSectionFenteData(crueData
.getCruePropertyDefinitionContainer());
- dataFente.setLargeurFente(profilPersist.LargeurFente);
- dataFente.setProfondeurFente(profilPersist.ProfondeurFente);
+ if (profilPersist.LargeurFente == null) {
+ analyser.addWarn("dptg.largeurFenteNotDefined");
+ } else {
+ dataFente.setLargeurFente(profilPersist.LargeurFente);
+ }
+ if (profilPersist.ProfondeurFente == null) {
+ analyser.addWarn("dptg.profondeurFenteNotDefined");
+ } else {
+ dataFente.setProfondeurFente(profilPersist.ProfondeurFente);
+ }
profilGeo.setFente(dataFente);
}
@@ -321,7 +329,7 @@
if (frottement != null) {
litNum.setFrot(frottement);
} else {
- analyser.addError("io.dptg.profil.ref.error", profil, idFrottement);
+ analyser.addFatalError("io.dptg.profil.ref.error", profil, idFrottement);
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOCAL.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOCAL.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOCAL.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -10,8 +10,24 @@
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.crue.common.DateDurationConverter;
import org.fudaa.dodico.crue.io.common.CrueData;
-import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.*;
-import org.fudaa.dodico.crue.metier.emh.*;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.IniCalculPrecedentPersist;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.IniCondIniPersist;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.IniReprisePersist;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.OrdCalculAbstractPersist;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.OrdCalculPseudoPermanentPersist;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.OrdCalculTransitoirePersist;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureOCAL.OrdCalculVraiPermanentPersist;
+import org.fudaa.dodico.crue.metier.emh.Calc;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPerm;
+import org.fudaa.dodico.crue.metier.emh.CalcTrans;
+import org.fudaa.dodico.crue.metier.emh.OrdCalc;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcPseudoPerm;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcPseudoPermIniCalcCI;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcPseudoPermIniCalcPrecedent;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcPseudoPermIniCalcReprise;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcScenario;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcTransIniCalcPrecedent;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcVraiPerm;
/**
* Classe qui se charge de remplir les structures DAO du fichier OCAL avec les donnees metier et inversement.
@@ -94,7 +110,7 @@
calcTransPersist.IniCalcPrecedent = iniCalculPrecedentPersist;
}
if (res == null) {
- analyser.addError("io.ocal.type.calc.indefini.error", clazz.toString());
+ analyser.addFatalError("io.ocal.type.calc.indefini.error", clazz.toString());
}
dao.listeOrdCalculs.add(res);
}
@@ -159,7 +175,7 @@
iniReprise.setDateReprise(DateDurationConverter.getDate(ordCalculPersist.IniCalcReprise.DateReprise));
}
if (metier == null) {
- analyser.addError("io.ocal.no.calcul.error");
+ analyser.addFatalError("io.ocal.no.calcul.error");
}
metier.setCalcPseudoPerm((CalcPseudoPerm) calc);
@@ -201,7 +217,7 @@
return;
}
if (ordCalculPersist.IniCalcPrecedent == null) {
- analyser.addError("io.ocal.trans.inconnu");
+ analyser.addFatalError("io.ocal.trans.inconnu");
} else {
final OrdCalcTransIniCalcPrecedent iniPrec = new OrdCalcTransIniCalcPrecedent();
iniPrec.setCalcTrans((CalcTrans) trouve);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -119,7 +119,7 @@
* @param nomRef
*/
public static void unknowReference(final String balise, final String nomRef, final CtuluAnalyze out) {
- out.addError("io.unknownReference.error", balise, nomRef, new Throwable()); //$NON-NLS-1$ //NOPMD
+ out.addFatalError("io.unknownReference.error", balise, nomRef, new Throwable()); //$NON-NLS-1$ //NOPMD
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -234,7 +234,7 @@
} catch (final FileNotFoundException e) {
LOGGER.debug("readDao", e);
final String path = fichier == null ? "null" : fichier.getAbsolutePath();
- analyser.addError("io.FileNotFoundException.error", path);
+ analyser.addFatalError("io.FileNotFoundException.error", path);
} finally {
CtuluLibFile.close(in);
}
@@ -257,7 +257,7 @@
newData = (D) parser.fromXML(contentRead);
} catch (final Exception e) {
LOGGER.debug("io.xml.error", e);
- analyser.addError("io.xml.error", e.getMessage());
+ analyser.addFatalError("io.xml.error", e.getMessage());
}
return newData;
@@ -279,7 +279,7 @@
*/
public D readDao(final URL url, final CtuluAnalyze analyser, final CrueData dataLinked) {
if (url == null) {
- analyser.addError("file.url.null.error");
+ analyser.addFatalError("file.url.null.error");
return null;
}
// if (!isValide(url, analyser)) { return null; }
@@ -291,7 +291,7 @@
newData = readDao(in, analyser, dataLinked);
} catch (final IOException e) {
LOGGER.debug(e.getMessage(), e);
- analyser.addError("io.xml.error", e.getMessage());
+ analyser.addFatalError("io.xml.error", e.getMessage());
} finally {
CtuluLibFile.close(in);
}
@@ -371,7 +371,7 @@
} catch (final IOException e) {
FuLogCrue.debug(e.getMessage());
- analyser.addError("file.write.error");
+ analyser.addFatalError("file.write.error");
isOk = false;
}
return isOk;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ErrorHandlerDefault.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ErrorHandlerDefault.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ErrorHandlerDefault.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -24,12 +24,12 @@
public void error(final SAXParseException exception) throws SAXException {
hasError = true;
- res.addErrorFromFile("io.xml.validator.error", exception.getLineNumber(), exception.getMessage());
+ res.addFatalError("io.xml.validator.error", exception.getLineNumber(), exception.getMessage());
}
public void fatalError(final SAXParseException exception) throws SAXException {
hasError = true;
- res.addErrorFromFile("io.xml.validator.error", exception.getLineNumber(), exception.getMessage());
+ res.addFatalError("io.xml.validator.error", exception.getLineNumber(), exception.getMessage());
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrue9Writer.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -74,7 +74,7 @@
if (writeTitre) {
if (trim.length() > 0) {
- fortranWriter.stringField(0, CrueIODico.TITRE + " ");
+ fortranWriter.stringField(0, CrueIODico.TITRE);
fortranWriter.stringField(1, trim);
} else {
fortranWriter.stringField(0, CrueIODico.TITRE);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -368,4 +368,10 @@
protected static final int BrancheNiveauAssocie = 12;
protected static final int BrancheBarrageGenerique = 14;
protected static final int BrancheBarrageFilEau = 15;
+ protected static final int Branche_0_ABANDONNE = 0;
+ protected static final int Branche_9_ABANDONNE = 9;
+ protected static final int Branche_3_ABANDONNE = 3;
+ protected static final int Branche_7_ABANDONNE = 7;
+ protected static final int Branche_8_ABANDONNE = 8;
+ protected static final int Branche_10_ABANDONNE = 10;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -153,7 +153,7 @@
for (final DonPrtGeoProfilCasier profil : profils) {
final int size = profil.getPtProfil().size();
if (size < 2) {
- analyze_.addError("io.dh.casier.tooSmall", catEMHCasier.getId(), profil.getId(), size);
+ analyze_.addFatalError("io.dh.casier.tooSmall", catEMHCasier.getId(), profil.getId(), size);
}
if (profil.getLitUtile() == null && size > 1) {
final LitUtile lit = new LitUtile();
@@ -1265,8 +1265,7 @@
return createBrancheBarrageFilEau(metier, idBranche);
default:
- analyze_.addErrorFromFile("io.global.cantCreateBranche.error", in_.getLineNumber(), idBranche);
- throw new CrueNotSupportedException(idBranche, in_.getLineNumber());
+ return null;
}
}
@@ -1362,7 +1361,6 @@
CatEMHNoeud noeudRef = metier.findNoeudByReference(idNoeud);
if (noeudRef == null) {
- // analyze_.addErrorFromFile(m.msg_unknow_reference, in_.getLineNumber());
noeudRef = metier.createNode(idNoeud);// new EMHNoeudNiveauContinu(idNoeud);
if (noeudRef == null) {
analyze_.addFatalError("crue.noeud.notExist.forCasier", idNoeud, newCasier.getNom());
@@ -1471,7 +1469,7 @@
}
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addFatalError(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
}
// -- on lit la suite --//
@@ -1646,21 +1644,19 @@
} else if (element.toUpperCase().equals(CrueIODico.DVERS)) {
if (!warnDoneForDvers) {
warnDoneForDvers = true;
- analyze_.addWarn("dc.dvers.ignored");
+ analyze_.addError("dc.dvers.ignored", in_.getLineNumber(), id);
}
} else if (element.toUpperCase().equals(CrueIODico.DIGUE)) {
if (!warnDoneForDigue) {
warnDoneForDigue = true;
- analyze_.addWarn("dc.digue.ignored");
+ analyze_.addError("dc.digue.ignored", in_.getLineNumber(), id);
}
} else if (element.toUpperCase().equals(CrueIODico.FENTE)) {
fente = new DonPrtGeoProfilSectionFenteData(metier.getCruePropertyDefinitionContainer());
- fente.setLargeurFente(in_.doubleField(0));
- fente.setProfondeurFente(in_.doubleField(1));
- // TODO pour FICHIER DEXP non présent dans V0
- throw new CrueNotSupportedException(element, in_.getLineNumber());
+ fente.setLargeurFente(in_.doubleField(1));
+ fente.setProfondeurFente(in_.doubleField(2));
} else if (element.toUpperCase().equals(CrueIODico.STRIC)) {
// -- liste des frottements associés au DPTG --//
// ex: STRIC K0 PROF3BMAJ PROF3BMIN PROF3BMAJ K0
@@ -1706,7 +1702,7 @@
}
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addFatalError(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
}
// -- on lit la suite --//
@@ -1771,7 +1767,7 @@
}
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addFatalError(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
}
// -- on lit la suite --//
@@ -1811,6 +1807,27 @@
return readFile();
}
+ private String addErrorForOldBranche(int typeBranche, String nomBranche) {
+ switch (typeBranche) {
+ case CrueIODico.Branche_0_ABANDONNE:
+ return "dc.branche0_9";
+ case CrueIODico.Branche_9_ABANDONNE:
+ return "dc.branche0_9";
+ case CrueIODico.Branche_3_ABANDONNE:
+ return "dc.branche3_7";
+ case CrueIODico.Branche_7_ABANDONNE:
+ return "dc.branche3_7";
+ case CrueIODico.Branche_8_ABANDONNE:
+ return "dc.branche8";
+ case CrueIODico.Branche_10_ABANDONNE:
+ return "dc.branche10";
+ default:
+ return "io.global.cantCreateBranche.error";
+
+ }
+
+ }
+
/**
* Lit la partie générale d'une branche. Ligne du type BRANCHE B2 N2 N3 20 passe ensuite le relais a la lecture
* spécifique de branche en fonction du type (dernier elt).
@@ -1840,9 +1857,9 @@
// -- creation de la branche en fonction de son type --//
CatEMHBranche branche = null;
- final int typebranche = in_.intField(4);
+ final int typeBranche = in_.intField(4);
try {
- branche = createBrancheSpecifique(metier, typebranche, nomBranche);
+ branche = createBrancheSpecifique(metier, typeBranche, nomBranche);
// -- ajout des relations des noeuds amont et avals --//
if (branche != null) {
branche.setNoeudAmont(noeudAmont);
@@ -1851,7 +1868,10 @@
metier.add(branche);
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addError(addErrorForOldBranche(typeBranche, nomBranche), in_.getLineNumber(), typeBranche,
+ nomBranche);
+ in_.readFields();
+
}
} catch (final EOFException eofe) {
if (branche != null) {
@@ -1868,7 +1888,7 @@
}
} else {
- analyze_.addErrorFromFile("io.dc.brancheMalFormtee.error", in_.getLineNumber());
+ analyze_.addFatalError("io.dc.brancheMalFormtee.error", in_.getLineNumber());
}
}
@@ -1914,7 +1934,7 @@
/* final CatEMHCasier casier = */createCasier(metier, nom);
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addFatalError(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
lireSuite();
}
@@ -2073,7 +2093,7 @@
metier.getFrottements().addFrt(frt);
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addFatalError(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
}
// -- on lit la suite --//
@@ -2095,8 +2115,8 @@
for (int i = 0; i < AbstractCrue9Reader.NB_LINES_TITLE; i++) {
final String readAndAvoidLabel = readAndAvoidLabel(in_).trim();
if (readAndAvoidLabel.startsWith(CrueIODico.TITRE)) {
- if (comm.length() > 0) {
- comm.append('|');
+ if (i > 0) {
+ comm.append('\n');
}
comm.append(StringUtils.removeStart(in_.getLine(), CrueIODico.TITRE).trim());
} else {
@@ -2136,7 +2156,7 @@
metier.add(noeud);
}
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addFatalError(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
}
// -- on lit la suite --//
lireSuite();
@@ -2239,7 +2259,7 @@
}
if (sectionCree == null) {
- analyze_.addErrorFromFile("io.global.cantCreateProfil.error", in_.getLineNumber());
+ analyze_.addFatalError("io.global.cantCreateProfil.error", in_.getLineNumber());
}
} // fin du while.
@@ -2329,7 +2349,7 @@
}
} else {
- analyze_.addErrorFromFile(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
+ analyze_.addFatalError(CrueNotSupportedException.MSG_CARTE_TYPE_UNKNOWN, in_.getLineNumber());
}
// -- si la regle est non nulle, on l'ajoute --//
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileWriter.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -70,6 +70,7 @@
import org.fudaa.dodico.crue.metier.emh.ValParamEntier;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.metier.helper.LoiHelper;
+import org.fudaa.dodico.crue.metier.helper.RegleTypeComparator;
/**
* Writer de la structure DC.
@@ -212,8 +213,9 @@
}
}
if (metier.getPretraitementsGeom() != null && metier.getPretraitementsGeom().getRegle() != null) {
-
- for (final Regle regle : metier.getPretraitementsGeom().getRegle()) {
+ List<Regle> rgs = new ArrayList<Regle>(metier.getPretraitementsGeom().getRegle());
+ Collections.sort(rgs, RegleTypeComparator.INSTANCE);
+ for (final Regle regle : rgs) {
writeCom(regle.getType().toString());
if (EnumRegle.PROF_PLAT.equals(regle.getType())) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-02-27 15:38:37 UTC (rev 5697)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-01 00:33:40 UTC (rev 5698)
@@ -214,7 +214,7 @@
} catch (final Exception e) {
final String msg = "io.dh.compositeFile.error";
- analyze_.addError(msg, e);
+ analyze_.addFatalError(msg, e);
logError(msg, this, e);
}
}
@@ -272,7 +272,7 @@
@Override
protected Object internalRead() {
if (super.in_ == null) {
- analyze_.addError("io.dh.isEmpty.error");//$NON-NLS-1$
+ analyze_.addFatalError("io.dh.isEmpty.error");//$NON-NLS-1$
logError("io.dh.isEmpty.error", -1, null);//$NON-NLS-1$
return null;
}
@@ -280,7 +280,7 @@
final CrueIOResu<CrueData> res = new CrueIOResu<CrueData>();
// on doit sortie: on a besoin des infos de dc:
if (dataLinked == null) {
- analyze_.addError("io.dh.crueDataNull.error");//$NON-NLS-1$
+ analyze_.addFatalError("io.dh.crueDataNull.error");//$NON-NLS-1$
logError("io.dh.crueDataNull.error", -1, null);//$NON-NLS-1$
return null;
}
@@ -292,7 +292,7 @@
LOGGER.debug(analyze_.getResource() + " end of file");
}
} catch (final Exception e) {
- analyze_.addError("io.dh.error", in_.getLineNumber());
+ analyze_.addFatalError("io.dh.error", in_.getLineNumber());
// e.printStackTrace();
logError(e.getMessage(), in_ == null ? -1 : in_.getLineNumber(), e);
}
@@ -459,7 +459,7 @@
brancheName = nomsBranches.get(i);
final CatEMHBranche br = res.findBrancheByReference(brancheName);
if (br == null) {
- analyze_.addError("io.dh.ref.emhbranche.Zini.error", brancheName);
+ analyze_.addFatalError("io.dh.ref.emhbranche.Zini.error", brancheName);
return false;
}
@@ -515,7 +515,7 @@
}
// reader.readLine();// lecture de la ligne FIN
if (FIN.equalsIgnoreCase(reader.stringField(0))) {
- analyze_.addErrorFromFile("io.dh.tagFINFound.error", reader.getCurrent() //$NON-NLS-1$
+ analyze_.addFatalError("io.dh.tagFINFound.error", reader.getCurrent() //$NON-NLS-1$
.getLineNumber());
}
@@ -758,7 +758,7 @@
// voir le fichier
// analyze_.addErrorFromFile("io.dh.conLimUnknown.error", CtuluAnalyze.createMap("{limtyp}", limtyp), reader
// .getCurrent().getLineNumber());
- analyze_.addErrorFromFile("io.dh.conLimUnknown.error", reader.getCurrent().getLineNumber(), Integer
+ analyze_.addFatalError("io.dh.conLimUnknown.error", reader.getCurrent().getLineNumber(), Integer
.valueOf(limtyp));
} else {
if (isFine()) {
@@ -772,7 +772,7 @@
final CatEMHNoeud noeud = res.findNoeudByReference(nomEmh);
if (noeud == null) {
- analyze_.addError("io.dh.ref.emhnoeud.zimpose.error", nomEmh);
+ analyze_.addFatalError("io.dh.ref.emhnoeud.zimpose.error", nomEmh);
return;
}
final CalcPseudoPermNoeudNiveauContinuZimpose metier = new CalcPseudoPermNoeudNiveauContinuZimpose(r...
[truncated message content] |
|
From: <de...@us...> - 2010-03-01 22:27:47
|
Revision: 5699
http://fudaa.svn.sourceforge.net/fudaa/?rev=5699&view=rev
Author: deniger
Date: 2010-03-01 22:27:37 +0000 (Mon, 01 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcPerm.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcTrans.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/common/TestCrueDataImpl.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHManagerBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueData.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -262,4 +262,14 @@
public void sort();
+ /**
+ * @param casierProfil un casier définit dans le fichiert dptg en tant que bibliothèque
+ */
+ public void registerDefinedCasierProfil(DonPrtGeoProfilCasier casierProfil);
+
+ /**
+ * @param sectionProfil
+ */
+ public void registerDefinedSectionProfil(DonPrtGeoProfilSection sectionProfil);
+
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/common/CrueDataImpl.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -357,6 +357,20 @@
}
+ /**
+ * @param casierProfil un casier définit dans le fichiert dptg en tant que bibliothèque
+ */
+ public void registerDefinedCasierProfil(DonPrtGeoProfilCasier casierProfil) {
+ idProfilCasierUse.put(casierProfil.getId(), casierProfil);
+ }
+
+ /**
+ * @param sectionProfil
+ */
+ public void registerDefinedSectionProfil(DonPrtGeoProfilSection sectionProfil) {
+ idProfilSectionUse.put(sectionProfil.getId(), sectionProfil);
+ }
+
public void registerUseCasierProfil(final EMH emh, final String profilId) {
DonPrtGeoProfilCasier casier = getUsedProfilCasier(profilId);
if (casier == null) {
@@ -364,7 +378,9 @@
casier.setNom(profilId);
idProfilCasierUse.put(profilId, casier);
}
- emh.addInfosEMH(casier);
+ if (emh != null) {
+ emh.addInfosEMH(casier);
+ }
}
@@ -375,7 +391,9 @@
section.setNom(profilId);
idProfilSectionUse.put(profilId, section);
}
- emh.addInfosEMH(section);
+ if (emh != null) {
+ emh.addInfosEMH(section);
+ }
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -1,5 +1,8 @@
package org.fudaa.dodico.crue.io.dao;
+import com.thoughtworks.xstream.XStream;
+
+import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.io.common.AbstractSingleConverter;
import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
@@ -9,8 +12,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.thoughtworks.xstream.XStream;
-
/**
* Classe abstraite qui permet de factoriser les attributs communs de toutes les lois
*/
@@ -97,7 +98,7 @@
*/
protected static void metierToDaoLoi(final AbstractDaoLoi outLoi, final Loi inLoi) {
outLoi.Nom = inLoi.getNom();
- outLoi.Description = inLoi.getDescription();
+ outLoi.Description = StringUtils.defaultString(inLoi.getDescription());
outLoi.Type = inLoi.getType();
outLoi.EvolutionFF = inLoi.getEvolutionFF();
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -69,7 +69,8 @@
final CrueDaoDPTG res = new CrueDaoDPTG();
// -- liste qui assure d'ajouter une seule référence de profil: car un meme profil peut etre referencé plusieurs
// fois
- final Set<DonPrtGeoProfilSection> listeProfilUniqueReference = new HashSet<DonPrtGeoProfilSection>();
+ final Set<String> doneCasierId = new HashSet<String>();
+ final Set<String> doneSectionId = new HashSet<String>();
res.DonPrtGeoProfilSections = new ArrayList<CrueDaoStructureDPTG.ProfilSection>();
res.DonPrtGeoCasiers = new ArrayList<CrueDaoStructureDPTG.AbstractCasier>();
@@ -87,11 +88,11 @@
// -- c'est un profil
if (donnee instanceof DonPrtGeoProfilSection) {
final DonPrtGeoProfilSection donPrtGeoProfilSection = (DonPrtGeoProfilSection) donnee;
- saveDonPrtGeoProfilSection(analyser, res, listeProfilUniqueReference, donPrtGeoProfilSection);
+ convertMetierToDaoSectionsProfils(donPrtGeoProfilSection, res, analyser, doneSectionId);
} else if (donnee instanceof DonPrtGeoProfilCasier) {
+ convertMetierToDaoCasiersProfils((DonPrtGeoProfilCasier) donnee, res.DonPrtGeoCasiers, analyser,
+ doneCasierId);
- convertMetierToDaoCasiersProfils(res.DonPrtGeoCasiers, (DonPrtGeoProfilCasier) donnee, analyser);
-
} else if (donnee instanceof DonPrtGeoBatiCasier) {
final DonPrtGeoBatiCasier bati = (DonPrtGeoBatiCasier) donnee;
final CrueDaoStructureDPTG.BatiCasier batiCasier = new CrueDaoStructureDPTG.BatiCasier();
@@ -113,9 +114,14 @@
List<InfosEMH> infosEMH = metier.getSousModele().getInfosEMH();
final List<DonPrtGeoProfilSection> selectClass = EMHHelper.collectClass(infosEMH, DonPrtGeoProfilSection.class);
for (final DonPrtGeoProfilSection donPrtGeoProfilSection : selectClass) {
- saveDonPrtGeoProfilSection(analyser, res, listeProfilUniqueReference, donPrtGeoProfilSection);
+ convertMetierToDaoSectionsProfils(donPrtGeoProfilSection, res, analyser, doneSectionId);
}
+ final List<DonPrtGeoProfilCasier> selectCasier = EMHHelper.collectClass(infosEMH, DonPrtGeoProfilCasier.class);
+ for (final DonPrtGeoProfilCasier profilCasier : selectCasier) {
+ convertMetierToDaoCasiersProfils(profilCasier, res.DonPrtGeoCasiers, analyser, doneCasierId);
+
+ }
Collections.sort(res.DonPrtGeoBranches, ObjetNommeComparator.INSTANCE);
Collections.sort(res.DonPrtGeoCasiers, ObjetNommeComparator.INSTANCE);
Collections.sort(res.DonPrtGeoProfilSections, ObjetNommeComparator.INSTANCE);
@@ -124,17 +130,17 @@
}
/**
+ * @param in l'objet metier a transformer en dao.
+ * @param out l'endroit ou sont stockés les DAO
* @param analyser le receveur de log
- * @param res l'endroit ou sont stockés les DAO
* @param uniqueRef la liste permettant d'eviter de restocker 2 fois le meme objets
- * @param toSave l'objet metier a transformer en dao.
*/
- private void saveDonPrtGeoProfilSection(final CtuluAnalyze analyser, final CrueDaoDPTG res,
- final Set<DonPrtGeoProfilSection> uniqueRef, final DonPrtGeoProfilSection toSave) {
- if (!uniqueRef.contains(toSave)) {
- convertMetierToDaoSectionsProfils(res.DonPrtGeoProfilSections, toSave, analyser);
+ private void convertMetierToDaoSectionsProfils(final DonPrtGeoProfilSection in, final CrueDaoDPTG out,
+ final CtuluAnalyze analyser, final Set<String> uniqueRef) {
+ if (!uniqueRef.contains(in.getId())) {
+ convertMetierToDaoSectionsProfils(in, out.DonPrtGeoProfilSections, analyser);
// -- on enregistre la reference --//
- uniqueRef.add(toSave);
+ uniqueRef.add(in.getId());
}
}
@@ -142,26 +148,25 @@
/**
* Remplit la premiere partie du fichier DPTG avec le type d'objet: sections profils.
*
- * @param listePersistante
- * @param prtgeo
+ * @param in
+ * @param out
* @param analyser
*/
- private static void convertMetierToDaoSectionsProfils(
- final List<CrueDaoStructureDPTG.ProfilSection> listePersistante, final DonPrtGeoProfilSection prtgeo,
- final CtuluAnalyze analyser) {
+ private static void convertMetierToDaoSectionsProfils(final DonPrtGeoProfilSection in,
+ final List<CrueDaoStructureDPTG.ProfilSection> out, final CtuluAnalyze analyser) {
final CrueDaoStructureDPTG.ProfilSection profilPersistant = new CrueDaoStructureDPTG.ProfilSection();
- profilPersistant.Nom = prtgeo.getNom();
- if (prtgeo.getFente() != null) {
- profilPersistant.LargeurFente = prtgeo.getFente().getLargeurFente();
- profilPersistant.ProfondeurFente = prtgeo.getFente().getProfondeurFente();
+ profilPersistant.Nom = in.getNom();
+ if (in.getFente() != null) {
+ profilPersistant.LargeurFente = in.getFente().getLargeurFente();
+ profilPersistant.ProfondeurFente = in.getFente().getProfondeurFente();
}
// -- Ecriture des lits numerotes --//
- if (prtgeo.getLitNumerote() != null && prtgeo.getLitNumerote().size() > 0) {
+ if (in.getLitNumerote() != null && in.getLitNumerote().size() > 0) {
profilPersistant.LitNumerotes = new ArrayList<CrueDaoStructureDPTG.Lit>();
- for (final LitNumerote litMetier : prtgeo.getLitNumerote()) {
+ for (final LitNumerote litMetier : in.getLitNumerote()) {
final CrueDaoStructureDPTG.Lit litPersist = new CrueDaoStructureDPTG.Lit();
litPersist.IsLitActif = litMetier.getIsLitActif();
litPersist.IsLitMineur = litMetier.getIsLitMineur();
@@ -177,7 +182,7 @@
// -- on ajoute le nom avec un suffixe --//
litPersist.Frot.NomRef = litMetier.getFrot().getNom();
} else {
- analyser.addInfo("io.dptg.frotForLitNotFound.error", prtgeo.getNom());
+ analyser.addInfo("io.dptg.frotForLitNotFound.error", in.getNom());
}
// -- ajout du lit persistant --//
@@ -185,68 +190,75 @@
}
} else {
- analyser.addInfo("io.dptg.convert.noLit.error", prtgeo.getNom());
+ analyser.addInfo("io.dptg.convert.noLit.error", in.getNom());
}
// -- ecriture des series pt --//
- if (CollectionUtils.isNotEmpty(prtgeo.getPtProfil())) {
+ if (CollectionUtils.isNotEmpty(in.getPtProfil())) {
profilPersistant.EvolutionFF = new EvolutionFF();
- final List<PtEvolutionFF> pts = new ArrayList<PtEvolutionFF>(prtgeo.getPtProfil().size());
+ final List<PtEvolutionFF> pts = new ArrayList<PtEvolutionFF>(in.getPtProfil().size());
profilPersistant.EvolutionFF.setPtEvolutionFF(pts);
- for (final PtProfil serie : prtgeo.getPtProfil()) {
+ for (final PtProfil serie : in.getPtProfil()) {
pts.add(new PtEvolutionFF(serie.getYp(), serie.getZ()));
}
} else {
- analyser.addInfo("io.dptg.convert.noProfil.error", prtgeo.getNom());
+ analyser.addInfo("io.dptg.convert.noProfil.error", in.getNom());
}
// -- ajout du profil persistant --//
- listePersistante.add(profilPersistant);
+ out.add(profilPersistant);
}
+ private static void convertMetierToDaoCasiersProfils(final DonPrtGeoProfilCasier in,
+ final List<CrueDaoStructureDPTG.AbstractCasier> out, final CtuluAnalyze analyser, Set<String> idDone) {
+ if (!idDone.contains(in.getId())) {
+ idDone.add(in.getId());
+ convertMetierToDaoCasiersProfils(in, out, analyser);
+ }
+ }
+
/**
* Remplit la deuxieme partie du fichier DPTG avec le type d'objet: casiers profils
*
- * @param listePersistante
- * @param prtgeo
+ * @param in
+ * @param out
* @param analyser
*/
- private static void convertMetierToDaoCasiersProfils(
- final List<CrueDaoStructureDPTG.AbstractCasier> listePersistante, final DonPrtGeoProfilCasier prtgeo,
- final CtuluAnalyze analyser) {
+ private static void convertMetierToDaoCasiersProfils(final DonPrtGeoProfilCasier in,
+ final List<CrueDaoStructureDPTG.AbstractCasier> out, final CtuluAnalyze analyser) {
final CrueDaoStructureDPTG.ProfilCasier profilPersistant = new CrueDaoStructureDPTG.ProfilCasier();
// -- donneee specifique pour le profil casier --//
- profilPersistant.Longueur = prtgeo.getLongueur();
+ profilPersistant.Longueur = in.getLongueur();
- profilPersistant.Nom = prtgeo.getNom();
+ profilPersistant.Nom = in.getNom();
// -- Ecriture du lit utile dans le profil casier --//
- if (prtgeo.getLitUtile() != null) {
+ if (in.getLitUtile() != null) {
profilPersistant.LitUtile = new CrueDaoStructureDPTG.LitUtile();
- final org.fudaa.dodico.crue.metier.emh.LitUtile litMetier = prtgeo.getLitUtile();
+ final org.fudaa.dodico.crue.metier.emh.LitUtile litMetier = in.getLitUtile();
profilPersistant.LitUtile.LimDeb = litMetier.getLimDeb();
profilPersistant.LitUtile.LimFin = litMetier.getLimFin();
} else {
- analyser.addInfo("io.dptg.convert.noLit.error", prtgeo.getNom());
+ analyser.addInfo("io.dptg.convert.noLit.error", in.getNom());
}
// -- ecriture des series pt --//
- if (CollectionUtils.isNotEmpty(prtgeo.getPtProfil())) {
+ if (CollectionUtils.isNotEmpty(in.getPtProfil())) {
profilPersistant.EvolutionFF = new EvolutionFF();
- final List<PtEvolutionFF> pts = new ArrayList<PtEvolutionFF>(prtgeo.getPtProfil().size());
+ final List<PtEvolutionFF> pts = new ArrayList<PtEvolutionFF>(in.getPtProfil().size());
profilPersistant.EvolutionFF.setPtEvolutionFF(pts);
- for (final PtProfil serie : prtgeo.getPtProfil()) {
+ for (final PtProfil serie : in.getPtProfil()) {
pts.add(new PtEvolutionFF(serie.getYp(), serie.getZ()));
}
} else {
- analyser.addInfo("io.dptg.convert.noProfil.error", prtgeo.getNom());
+ analyser.addInfo("io.dptg.convert.noProfil.error", in.getNom());
}
// -- ajout du profil persistant --//
- listePersistante.add(profilPersistant);
+ out.add(profilPersistant);
}
private static void convertMetierToDaoSectionsIdem(final List<CrueDaoStructureDPTG.SectionIdem> listePersistante,
@@ -285,6 +297,7 @@
if (profilGeo == null) {
profilGeo = new DonPrtGeoProfilSection();
+ crueData.registerDefinedSectionProfil(profilGeo);
crueData.getSousModele().addInfosEMH(profilGeo);
}
// else {
@@ -379,52 +392,54 @@
// -- on recupere la branche qu'il faut --//
final String nomProfil = profilPersist.Nom;
// -- on tente de trouver tous les objets referencé par ce profil --//
- final DonPrtGeoProfilCasier profilGeo = crueData.getUsedProfilCasier(nomProfil);
- if (profilGeo == null) {
- analyser.addInfo("io.convert.dptg.profilNotFound.error", nomProfil);
- } else {
+ DonPrtGeoProfilCasier profilCasier = crueData.getUsedProfilCasier(nomProfil);
+ if (profilCasier == null) {
+ profilCasier = new DonPrtGeoProfilCasier(crueData.getCruePropertyDefinitionContainer());
+ profilCasier.setNom(nomProfil);
+ crueData.registerDefinedCasierProfil(profilCasier);
+ crueData.getSousModele().addInfosEMH(profilCasier);
+ }
- // -- on récupére le casier ou le profil et on le stocke dans le emh --//
- // final DonPrtGeoProfilCasier profilGeo = new DonPrtGeoProfilCasier();
- // -- donnee particulieres a ProfilCasier --//
- profilGeo.setLongueur(profilPersist.Longueur);
+ // -- on récupére le casier ou le profil et on le stocke dans le emh --//
+ // final DonPrtGeoProfilCasier profilGeo = new DonPrtGeoProfilCasier();
+ // -- donnee particulieres a ProfilCasier --//
+ profilCasier.setLongueur(profilPersist.Longueur);
- // -- on remplit son contenu --//
- profilGeo.setNom(profilPersist.Nom);
+ // -- on remplit son contenu --//
+ profilCasier.setNom(profilPersist.Nom);
- // -- on remplit les litsNommes --//
- if (profilPersist.LitUtile != null) {
- // final List<LitNumerote> listeLits = new ArrayList<LitNumerote>();
- final CrueDaoStructureDPTG.LitUtile litPersist = profilPersist.LitUtile;
+ // -- on remplit les litsNommes --//
+ if (profilPersist.LitUtile != null) {
+ // final List<LitNumerote> listeLits = new ArrayList<LitNumerote>();
+ final CrueDaoStructureDPTG.LitUtile litPersist = profilPersist.LitUtile;
- final org.fudaa.dodico.crue.metier.emh.LitUtile litUtileMetier = new org.fudaa.dodico.crue.metier.emh.LitUtile();
- litUtileMetier.setLimDeb(litPersist.LimDeb);
- litUtileMetier.setLimFin(litPersist.LimFin);
+ final org.fudaa.dodico.crue.metier.emh.LitUtile litUtileMetier = new org.fudaa.dodico.crue.metier.emh.LitUtile();
+ litUtileMetier.setLimDeb(litPersist.LimDeb);
+ litUtileMetier.setLimFin(litPersist.LimFin);
- // -- ajout de la liste de litNum dans donprtgeo --//
- // listeLits.add(litNum);
- profilGeo.setLitUtile(litUtileMetier);
+ // -- ajout de la liste de litNum dans donprtgeo --//
+ // listeLits.add(litNum);
+ profilCasier.setLitUtile(litUtileMetier);
- } else {
- analyser.addInfo("io.dptg.profil.no.lit.num.error", profilPersist.Nom);
- }
+ } else {
+ analyser.addInfo("io.dptg.profil.no.lit.num.error", profilPersist.Nom);
+ }
- // -- on remplit les séries --//
- if (profilPersist.EvolutionFF != null && profilPersist.EvolutionFF.getPtEvolutionFF() != null) {
- final List<PtProfil> listeProfils = new ArrayList<PtProfil>();
+ // -- on remplit les séries --//
+ if (profilPersist.EvolutionFF != null && profilPersist.EvolutionFF.getPtEvolutionFF() != null) {
+ final List<PtProfil> listeProfils = new ArrayList<PtProfil>();
- for (final PtEvolutionFF buff : profilPersist.EvolutionFF.getPtEvolutionFF()) {
- listeProfils.add(new PtProfil(buff.getX(), buff.getY()));
- }
+ for (final PtEvolutionFF buff : profilPersist.EvolutionFF.getPtEvolutionFF()) {
+ listeProfils.add(new PtProfil(buff.getX(), buff.getY()));
+ }
- // -- ajout de la liste de profils dans le donprtgeo --//
- profilGeo.setPtProfil(listeProfils);
+ // -- ajout de la liste de profils dans le donprtgeo --//
+ profilCasier.setPtProfil(listeProfils);
- } else {
- analyser.addInfo("io.dptg.convert.noProfil.error", nomProfil);
- }
+ } else {
+ analyser.addInfo("io.dptg.convert.noProfil.error", nomProfil);
+ }
- }
} else if (casier instanceof CrueDaoStructureDPTG.BatiCasier) {
final CrueDaoStructureDPTG.BatiCasier bati = (CrueDaoStructureDPTG.BatiCasier) casier;
// -- on recupere la branche qu'il faut --//
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOPTG.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterOPTG.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -4,6 +4,8 @@
package org.fudaa.dodico.crue.io.dao;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import java.util.Map;
import org.apache.commons.collections.BidiMap;
@@ -22,6 +24,7 @@
import org.fudaa.dodico.crue.metier.emh.Regle;
import org.fudaa.dodico.crue.metier.emh.ValParamDouble;
import org.fudaa.dodico.crue.metier.emh.ValParamEntier;
+import org.fudaa.dodico.crue.metier.helper.RegleTypeComparator;
import org.fudaa.dodico.crue.validation.CruePrefix;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -96,7 +99,9 @@
dao.Regles = new ArrayList<RegleDAO>();
final BidiMap classToEnum = getCorrespondance();
- for (final Regle regleMetier : metier.getRegle()) {
+ List<Regle> rgs = new ArrayList<Regle>(metier.getRegle());
+ Collections.sort(rgs, RegleTypeComparator.INSTANCE);
+ for (final Regle regleMetier : rgs) {
final Class daoClass = (Class) classToEnum.getKey(regleMetier.getType());
RegleDAO reglePersist = null;
try {
@@ -123,5 +128,4 @@
return dao;
}
-
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -887,10 +887,10 @@
int nbEtatPermanent = 0;
final int nbColExpected = nbConlim + (dhContainsRuis ? 1 : 0);
- DonCLimMScenario scenario = res.getConditionsLim();
- if (scenario == null) {
- scenario = new DonCLimMScenario();
- res.setConditionsLim(scenario);
+ DonCLimMScenario dclmScenario = res.getConditionsLim();
+ if (dclmScenario == null) {
+ dclmScenario = new DonCLimMScenario();
+ res.setConditionsLim(dclmScenario);
}
final List<CalcPseudoPerm> calculsPermanents = new ArrayList<CalcPseudoPerm>();
@@ -1072,7 +1072,7 @@
// reader.readLine();
if (CollectionUtils.isNotEmpty(calculsPermanents)) {
- scenario.setCalcPseudoPerm(calculsPermanents);
+ dclmScenario.setCalcPseudoPerm(calculsPermanents);
}
if (isFine()) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -37,7 +37,6 @@
import org.fudaa.dodico.crue.metier.emh.CatEMHCasier;
import org.fudaa.dodico.crue.metier.emh.CatEMHNoeud;
import org.fudaa.dodico.crue.metier.emh.DefaultValues;
-import org.fudaa.dodico.crue.metier.emh.DonCLimMScenario;
import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSaintVenant;
import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtCasierProfil;
import org.fudaa.dodico.crue.metier.emh.DonPrtCIni;
@@ -57,6 +56,7 @@
import org.fudaa.dodico.crue.metier.emh.Loi;
import org.fudaa.dodico.crue.metier.emh.LoiDF;
import org.fudaa.dodico.crue.metier.emh.LoiFF;
+import org.fudaa.dodico.crue.metier.emh.OrdCalc;
import org.fudaa.dodico.crue.metier.emh.OrdCalcPseudoPermIniCalcReprise;
import org.fudaa.dodico.crue.metier.emh.OrdCalcScenario;
import org.fudaa.dodico.crue.metier.emh.OrdPrtCIniModeleBase;
@@ -187,20 +187,19 @@
final List<CatEMHBranche> branches = EMHHelper.collectEMHActivable(data.getBranches());
final boolean aDonneesGen = containsDPTI(branches);
- // On a des données permanentes si au moins un calcul permanent existe dans DCLM
- // On a des données transitoires si au moins un calcul transitoire existe dans DCLM
- final DonCLimMScenario dclm = data.getConditionsLim();
+ // On a des données permanentes si au moins un calcul permanent existe dans OCAL
+ // On a des données transitoires si au moins un calcul transitoire existe dans OCAL
+ final OrdCalcScenario ocal = data.getOrdCalc();
boolean modru = false;
- if (dclm != null) {
- final List<CalcPseudoPerm> calcPseudoPerm = dclm.getCalcPseudoPerm();
- aDonneesPerm = CollectionUtils.isNotEmpty(calcPseudoPerm);
- final List<CalcTrans> calcTrans = dclm.getCalcTrans();
- aDonneesTrans = CollectionUtils.isNotEmpty(calcTrans);
+ if (ocal != null) {
+ final List<OrdCalc> ordCalc = ocal.getOrdCalc();
+ aDonneesPerm = EMHHelper.containsPermanent(ordCalc);
+ aDonneesTrans = EMHHelper.containsTransitoire(ordCalc);
boolean modeLateral = isModeLateral(data);
// cru
if (modeLateral
- && !computeQruisIdentique(coeffsRuisParCalcPerm, calcPseudoPerm, data.getCruePropertyDefinitionContainer())) { return; }
+ && !computeQruisIdentique(coeffsRuisParCalcPerm, ordCalc, data.getCruePropertyDefinitionContainer())) { return; }
// S'il existe au moins un débit de ruissellement pour un calcul permanent on met cru à 1/idem pour cofqrq
if (modeLateral && MapUtils.isNotEmpty(coeffsRuisParCalcPerm)) {
@@ -244,7 +243,6 @@
}
// trepr
- final OrdCalcScenario ocal = data.getOrdCalc();
if (ocal != null) {
final OrdCalcPseudoPermIniCalcReprise reprise = EMHHelper.selectFirstOfClass(ocal.getOrdCalc(),
OrdCalcPseudoPermIniCalcReprise.class);
@@ -579,8 +577,9 @@
return res;
}
- private boolean computeQruisIdentique(final Map<String, Double> coeffsRuisParCalcPerm,
- final List<CalcPseudoPerm> calcPseudoPerm, CrueProperties props) {
+ private boolean computeQruisIdentique(final Map<String, Double> coeffsRuisParCalcPerm, final List<OrdCalc> ordCalcs,
+ CrueProperties props) {
+ List<CalcPseudoPerm> calcPseudoPerm = EMHHelper.collectCalcPseudoPerm(ordCalcs);
// Pour déterminer s'il existe un coefficient de ruissellement commun pour un calcul permanent, il faut que le
// coefficient de chaque branche Saint Venant de ce calcul soit le même.
for (int i = 0, imax = calcPseudoPerm.size(); i < imax; i++) {
@@ -697,9 +696,9 @@
writeCom("");
writeCom(" Definition des types des conditions aux limites ");
- final DonCLimMScenario dclm = data.getConditionsLim();
- if (dclm != null) {
- final List<CalcPseudoPerm> calcsPerms = dclm.getCalcPseudoPerm();
+ final OrdCalcScenario ocal = data.getOrdCalc();
+ if (ocal != null) {
+ final List<CalcPseudoPerm> calcsPerms = EMHHelper.collectCalcPseudoPerm(ocal.getOrdCalc());
if (CollectionUtils.isNotEmpty(calcsPerms)) {
// Hashtable typesCL = new Hashtable();
@@ -944,8 +943,8 @@
writeCom("");
writeCom(" Definition des types des conditions aux limites ");
- final DonCLimMScenario dclm = data.getConditionsLim();
- final List<CalcTrans> calcsTrans = dclm.getCalcTrans();
+ // final DonCLimMScenario dclm = data.getConditionsLim();
+ final List<CalcTrans> calcsTrans = EMHHelper.collectCalcTrans(data.getOrdCalc().getOrdCalc());
if (CollectionUtils.isEmpty(calcsTrans)) { return; }
if (calcsTrans.size() > 1) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -7,6 +7,15 @@
/** @pdOid 2d1a78e8-7a6f-4820-a7d7-042905bb9e2e */
public abstract class OrdCalc {
+ /**
+ * @return true si transitoire
+ */
+ public abstract boolean isTransitoire();
+
+ public final boolean isPermanent() {
+ return !isTransitoire();
+ }
+
public abstract Calc getCalc();
public final String getType() {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcPerm.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcPerm.java 2010-03-01 00:33:40 UTC (rev 5698)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcPerm.java 2010-03-01 22:27:37 UTC (rev 5699)
@@ -1,10 +1,17 @@
/***********************************************************************
- * Module: OrdCalcPerm.java
- * Author: deniger
- * Purpose: Defines the Class OrdCalcPerm
+ * Module: OrdCalcPerm.java Author: deniger Purpose: Defines the Class OrdCalcPerm
***********************************************************************/
package org.fudaa.dodico.crue.metier.emh;
/** @pdOid c4f5488c-2bd2-42d0-80f8-bf4c880d7839 */
-public abstract class OrdCalcPerm extends OrdCalc {}
\ No newline at end of file
+public abstract class OrdCalcPerm extends OrdCalc {
+...
[truncated message content] |
|
From: <de...@us...> - 2010-03-04 23:48:36
|
Revision: 5703
http://fudaa.svn.sourceforge.net/fudaa/?rev=5703&view=rev
Author: deniger
Date: 2010-03-04 23:48:28 +0000 (Thu, 04 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemPdt.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dcsp-1.0.0.xsd
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHManagerBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/common/CommonGuiLib.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ContentEMHValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/Crue9Validator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/IdValidatorForCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/IdValidatorForCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValueValidator.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -915,7 +915,7 @@
final CalcPseudoPerm calcPerm = new CalcPseudoPerm();
calcPerm.setNom(CruePrefix.P_CALCUL + "P" + (nbEtatPermanent + 1));
- calcPerm.setDescription("Calcul permanent " + (nbEtatPermanent + 1));
+ calcPerm.setDescription("Calcul pseudo-permanent " + (nbEtatPermanent + 1));
// pour le premier on prend en compte la reprise éventuelle
final boolean first = ocal.getOrdCalc().isEmpty();
if (reprise != null && first) {
@@ -1076,7 +1076,7 @@
}
if (isFine()) {
- LOGGER.debug("Nombre d'états permanents " + nbEtatPermanent);
+ LOGGER.debug("Nombre d'états pseudo-permanents " + nbEtatPermanent);
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -649,7 +649,7 @@
private void writeDonneesPermanentes(final CrueData data, final Map coeffsRuisParCalcPerm) throws IOException {
writeCom("");
- writeCom(" Donnees permanentes");
+ writeCom(" Donnees pseudo-permanentes");
// Ecriture Ligne A
writeCom("");
@@ -726,7 +726,7 @@
// Ecriture Lignes E
writeCom("");
- writeCom(" Valeurs des conditions aux limites (regimes permanents) ");
+ writeCom(" Valeurs des conditions aux limites (regimes pseudo-permanents) ");
for (int i = 0, imax = nomsCalcsPerms.size(); i < imax; i++) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -400,7 +400,8 @@
cptNbHaut++;
// System.out.print("surfPlan = " + sings[j] + " | ");
} else if (j >= (10 + nbHaut + 1) && j <= (10 + 2 * nbHaut)) {
- if (j >= (10 + nbHaut + 1)) {
+ // on reset pour ce j
+ if (j == (10 + nbHaut + 1)) {
cptNbHaut = 0;
}
surfMouill[cptNbHaut] = sings[j];
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemPdt.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemPdt.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemPdt.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -23,6 +23,11 @@
return nbrPdt;
}
+ @Override
+ public String toString() {
+ return " ElemPdt: " + nbrPdt + " * " + dureePdt.getStandardSeconds() + " s";
+ }
+
/**
* @param newNbrPdt
* @pdOid 25e7ccdf-0648-4487-93bc-fb08155d8cca
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalc.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -12,7 +12,7 @@
*/
public abstract boolean isTransitoire();
- public final boolean isPermanent() {
+ public final boolean isPseudoPermanent() {
return !isTransitoire();
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -91,13 +91,13 @@
public static final class OrdCalcIsPermanent implements Predicate {
public boolean evaluate(final Object object) {
- return ((OrdCalc) object).isPermanent();
+ return ((OrdCalc) object).isPseudoPermanent();
}
}
public static final class OrdCalcIsPseudoPermanent implements Predicate {
public boolean evaluate(final Object object) {
- return ((OrdCalc) object).isPermanent() && ((OrdCalc) object).getCalc() instanceof CalcPseudoPerm;
+ return ((OrdCalc) object).isPseudoPermanent() && ((OrdCalc) object).getCalc() instanceof CalcPseudoPerm;
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -170,6 +170,36 @@
}
}
+ /**
+ * A utiliser avec RelationEMHContient afin de récupérer les EMH avec un type donne.
+ *
+ * @author deniger
+ */
+ public static class PredicateRelationEMHContientEMHOfClass implements Predicate {
+
+ private final Class type;
+
+ /**
+ * @param type le type recherche.Si null renvoie true pour toutes les relation RelationEMHContient
+ */
+ public PredicateRelationEMHContientEMHOfClass(final Class type) {
+ super();
+ this.type = type;
+ }
+
+ public boolean evaluate(final Object object) {
+ if (object == null) { return false; }
+ if (object.getClass().equals(RelationEMHContient.class)) {
+ if (type == null) { return true; }
+ final RelationEMHContient rel = (RelationEMHContient) object;
+
+ if (rel.getEmh() != null && type.equals(rel.getEmh().getClass())) { return true; }
+
+ }
+ return false;
+ }
+ }
+
private EMHHelperPredicate() {
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-03-01 22:40:16 UTC (rev 5702)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -37,6 +37,8 @@
import org.fudaa.dodico.crue.metier.emh.CatEMHNoeud;
import org.fudaa.dodico.crue.metier.emh.CatEMHSection;
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
+import org.fudaa.dodico.crue.metier.emh.OrdPrtGeoModeleBase;
+import org.fudaa.dodico.crue.metier.emh.PlanimetrageNbrPdzCst;
import org.fudaa.dodico.crue.metier.emh.ResPrtReseau;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.property.CrueProperties;
@@ -147,7 +149,7 @@
boolean error = false;
for (final EnteteBranche br : res.getContainerBranches().getListData()) {
final String id = br.getNom().toUpperCase();
- CatEMHBranche foundBranche = data.findBrancheByReference(id);
+ final CatEMHBranche foundBranche = data.findBrancheByReference(id);
if (foundBranche == null) {
analyze.addError("res.branche.notFound", id);
error = true;
@@ -157,7 +159,7 @@
}
for (final EnteteNoeud nd : res.getContainerNoeuds().getListData()) {
final String id = nd.getNom().toUpperCase();
- CatEMHNoeud foundNoeud = data.findNoeudByReference(id);
+ final CatEMHNoeud foundNoeud = data.findNoeudByReference(id);
if (foundNoeud == null) {
analyze.addError("res.noeud.notFound", id);
error = true;
@@ -176,7 +178,7 @@
}
}
- ResultatCalculPasDeTemps pdt = res.getPdt();
+ final ResultatCalculPasDeTemps pdt = res.getPdt();
if (pdt != null && pdt.getNbPdt() > 0) {
emh.addInfosEMH(pdt);
}
@@ -301,6 +303,15 @@
if (stoRes != null && stoRes.getMetier() != null) {
data.setSto(stoRes.getMetier());
prt = STOReader.alimenteObjetsMetier(stoRes.getMetier());
+ final int nbhaut = stoRes.getMetier().getParametresGeneraux().getNbhaut();
+ OrdPrtGeoModeleBase ordPrtGeoModeleBase = data.getModele().getOrdPrtGeoModeleBase();
+ if (ordPrtGeoModeleBase == null) {
+ ordPrtGeoModeleBase = new OrdPrtGeoModeleBase(data.getCruePropertyDefinitionContainer());
+ data.getModele().addInfosEMH(ordPrtGeoModeleBase);
+ }
+ final PlanimetrageNbrPdzCst pdz = new PlanimetrageNbrPdzCst(data.getCruePropertyDefinitionContainer());
+ pdz.setNbrPdz(nbhaut);
+ ordPrtGeoModeleBase.setPlanimetrage(pdz);
}
if (!analyze.containsFatalError() && CtuluLibFile.exists(str)) {
@@ -338,7 +349,7 @@
analyze.setDefaultResourceBundle(IOMessages.RESOURCE_BUNDLE);
loadResFile.addAnalyzer(analyze);
final CrueIOResu<FCBSequentialReader> read = Crue9FileFormatFactory.getFCBFileFormat().read(fcb, analyze, data);
- if (read != null) {
+ if (read != null && read.getMetier() != null) {
validFcb(read.getMetier(), data, emh, loadResFile);
}
}
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ContentEMHValidator.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ContentEMHValidator.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ContentEMHValidator.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -0,0 +1,258 @@
+/**
+ *
+ */
+package org.fudaa.dodico.crue.validation;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.fudaa.ctulu.CtuluAnalyze;
+import org.fudaa.dodico.crue.metier.emh.CalcTransItem;
+import org.fudaa.dodico.crue.metier.emh.CatEMHBranche;
+import org.fudaa.dodico.crue.metier.emh.CatEMHSection;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheBarrageFilEau;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheBarrageGenerique;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheNiveauxAssocies;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheOrifice;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBranchePdc;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSeuilLateral;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSeuilTransversal;
+import org.fudaa.dodico.crue.metier.emh.DonFrtConteneur;
+import org.fudaa.dodico.crue.metier.emh.DonPrtCIniBrancheOrifice;
+import org.fudaa.dodico.crue.metier.emh.DonPrtCIniBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.DonPrtCIniNoeudNiveauContinu;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilCasier;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoProfilSection;
+import org.fudaa.dodico.crue.metier.emh.DonPrtGeoSectionIdem;
+import org.fudaa.dodico.crue.metier.emh.EMH;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageFilEau;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageGenerique;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheNiveauxAssocies;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheOrifice;
+import org.fudaa.dodico.crue.metier.emh.EMHBranchePdc;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilLateral;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilTransversal;
+import org.fudaa.dodico.crue.metier.emh.EMHBrancheStrickler;
+import org.fudaa.dodico.crue.metier.emh.EMHCasierProfil;
+import org.fudaa.dodico.crue.metier.emh.EMHModeleBase;
+import org.fudaa.dodico.crue.metier.emh.EMHNoeudNiveauContinu;
+import org.fudaa.dodico.crue.metier.emh.EMHScenario;
+import org.fudaa.dodico.crue.metier.emh.EMHSectionIdem;
+import org.fudaa.dodico.crue.metier.emh.EMHSectionInterpolee;
+import org.fudaa.dodico.crue.metier.emh.EMHSectionProfil;
+import org.fudaa.dodico.crue.metier.emh.EMHSectionSansGeometrie;
+import org.fudaa.dodico.crue.metier.emh.EMHSousModele;
+import org.fudaa.dodico.crue.metier.emh.EnumMethodeInterpolation;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeEMH;
+import org.fudaa.dodico.crue.metier.emh.InfosEMH;
+import org.fudaa.dodico.crue.metier.emh.OrdResScenario;
+import org.fudaa.dodico.crue.metier.emh.ParamCalcScenario;
+import org.fudaa.dodico.crue.metier.emh.ParamNumModeleBase;
+import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBranche;
+import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.metier.helper.EMHHelperPredicate;
+
+class ContentEMHValidator {
+
+ private static class ContentParam {
+ public Class requiredType;
+ public int minOccurence = 1;
+ public int maxOccurence = -1;
+
+ /**
+ * @param requiredType
+ * @param minOccurence
+ * @param maxOccurence
+ */
+ public ContentParam(final Class requiredType, final int minOccurence, final int maxOccurence) {
+ super();
+ this.requiredType = requiredType;
+ this.minOccurence = minOccurence;
+ this.maxOccurence = maxOccurence;
+ }
+
+ public boolean isMaxRespected(final int nbToTest) {
+ return maxOccurence < 0 || nbToTest <= maxOccurence;
+ }
+
+ public boolean isMinRespected(final int nbToTest) {
+ return minOccurence < 0 || nbToTest >= minOccurence;
+ }
+
+ public void addErrorForSectionDansBranche(final int nbToTest, final CtuluAnalyze log, final EMH emh) {
+ if ((isMaxRespected(nbToTest) && isMinRespected(nbToTest))) { return; }
+ if (minOccurence == maxOccurence) {
+ log
+ .addError("validation.branche.nbSectionNotEqualsTo", emh.getId(), maxOccurence, requiredType
+ .getSimpleName());
+ } else {
+ log.addError("validation.branche.nbSectionNotIn", emh.getId(), minOccurence, maxOccurence, requiredType
+ .getSimpleName());
+ }
+ }
+ }
+
+ public static ContentParam canContain(final Class c) {
+ return new ContentParam(c, -1, -1);
+ }
+
+ private static Map<Class, List<ContentParam>> createSectionDansBrancheContents() {
+ final Map<Class, List<ContentParam>> res = new HashMap<Class, List<ContentParam>>();
+ res.put(EMHBranchePdc.class, create(new ContentParam(EMHSectionSansGeometrie.class, 2, 2)));
+ res.put(EMHBrancheSeuilTransversal.class, create(new ContentParam(EMHSectionProfil.class, 0, 2), new ContentParam(
+ EMHSectionIdem.class, 0, 2)));
+ res.put(EMHBrancheSeuilLateral.class, create(new ContentParam(EMHSectionSansGeometrie.class, 2, 2)));
+ res.put(EMHBrancheNiveauxAssocies.class, create(new ContentParam(EMHSectionSansGeometrie.class, 2, 2)));
+ res.put(EMHBrancheOrifice.class, create(new ContentParam(EMHSectionSansGeometrie.class, 2, 2)));
+ res.put(EMHBrancheStrickler.class, create(new ContentParam(EMHSectionProfil.class, 0, 2), new ContentParam(
+ EMHSectionIdem.class, 0, 2)));
+ res.put(EMHBrancheBarrageGenerique.class, create(new ContentParam(EMHSectionSansGeometrie.class, 2, 2)));
+ res.put(EMHBrancheBarrageFilEau.class, create(new ContentParam(EMHSectionProfil.class, 0, 2), new ContentParam(
+ EMHSectionIdem.class, 0, 2)));
+ res.put(EMHBrancheSaintVenant.class, create(canContain(EMHSectionProfil.class), canContain(EMHSectionIdem.class),
+ canContain(EMHSectionInterpolee.class)));
+ return res;
+ }
+
+ Map<Class, List<ContentParam>> relationSectionDansBranche;
+
+ private void validateRelationSectionDansBranche(final CtuluAnalyze emhLog, final EMH emh) {
+ if (emh == null || emh.getCatType() != EnumTypeEMH.BRANCHE) { return; }
+ List<RelationEMHSectionDansBranche> sections = ((CatEMHBranche) emh).getListeSections();
+ if (sections == null) {
+ sections = Collections.emptyList();
+ }
+ final Set<Class> usedClass = new HashSet<Class>(sections.size());
+ for (final RelationEMHSectionDansBranche rel : sections) {
+ usedClass.add(rel.getEmh().getClass());
+
+ }
+ if (relationSectionDansBranche == null) {
+ relationSectionDansBranche = createSectionDansBrancheContents();
+ }
+ List<ContentParam> auth = relationSectionDansBranche.get(emh.getClass());
+ if (auth == null) {
+ auth = Collections.emptyList();
+ }
+ final List<Class> authClass = new ArrayList<Class>(auth.size());
+ for (final ContentParam cp : auth) {
+ authClass.add(cp.requiredType);
+ }
+ usedClass.removeAll(authClass);
+ if (usedClass.size() > 0) {
+ StringBuffer classes = new StringBuffer();
+ boolean first = true;
+ for (Class class1 : usedClass) {
+ if (first) {
+ first = false;
+ } else {
+ classes.append(", ");
+ }
+ classes.append(class1.getSimpleName());
+
+ }
+ emhLog.addFatalError("validation.branche.cantContainsThisSection", emh.getId(), classes);
+ }
+ for (final ContentParam cp : auth) {
+ final int nbDansRelation = CollectionUtils.countMatches(sections,
+ new EMHHelperPredicate.PredicateRelationEMHContientEMHOfClass(cp.requiredType));
+ cp.addErrorForSectionDansBranche(nbDansRelation, emhLog, emh);
+
+ }
+ if (emh.getClass().equals(EMHBrancheBarrageFilEau.class) || emh.getClass().equals(EMHBrancheBarrageGenerique.class)) {
+ CatEMHSection sectionPilote = EMHHelper.getSectionPilote(emh);
+ if (sectionPilote == null) {
+ emhLog.addFatalError("validation.branche.mustContainSectionPilote", emh.getId());
+ }
+ }
+ }
+
+ private static List<ContentParam> create(final ContentParam... params) {
+ return Arrays.asList(params);
+ }
+
+ private final Map<Class<? extends EMH>, Set<Class<? extends InfosEMH>>> neededInfoEMHByEMH = new HashMap<Class<? extends EMH>, Set<Class<? extends InfosEMH>>>();
+
+ public ContentEMHValidator(final EMHModeleBase modele) {
+ // on enregistre pour chaque classe d'EMH, les types d'info nécessaires.
+ add(EMHScenario.class, ParamCalcScenario.class, OrdResScenario.class);
+ add(EMHModeleBase.class, ParamNumModeleBase.class);
+ add(EMHSousModele.class, DonFrtConteneur.class);
+ final EnumMethodeInterpolation methodeInterpol = modele == null ? null : modele.getOrdPrtCIniModeleBase()
+ .getMethodeInterpol();
+ if (methodeInterpol != null) {
+ if (EnumMethodeInterpolation.INTERPOL_ZIMP_AUX_SECTIONS.equals(methodeInterpol)) {
+
+ } else {
+ add(EMHNoeudNiveauContinu.class, DonPrtCIniNoeudNiveauContinu.class);
+ }
+ }
+ add(EMHCasierProfil.class, DonPrtGeoProfilCasier.class);
+ add(EMHBranchePdc.class, DonCalcSansPrtBranchePdc.class);
+ add(EMHBrancheSeuilTransversal.class, DonCalcSansPrtBrancheSeuilTransversal.class);
+ add(EMHBrancheSeuilLateral.class, DonCalcSansPrtBrancheSeuilLateral.class);
+ add(EMHBrancheOrifice.class, DonCalcSansPrtBrancheOrifice.class, DonPrtCIniBrancheOrifice.class);
+ add(EMHBrancheStrickler.class);
+ add(EMHBrancheBarrageGenerique.class, DonCalcSansPrtBrancheBarrageGenerique.class);
+ add(EMHBrancheBarrageFilEau.class, DonCalcSansPrtBrancheBarrageFilEau.class);
+ add(EMHBrancheSaintVenant.class, DonPrtGeoBrancheSaintVenant.class, DonCalcSansPrtBrancheSaintVenant.class,
+ DonPrtCIniBrancheSaintVenant.class);
+ add(EMHBrancheNiveauxAssocies.class, DonCalcSansPrtBrancheNiveauxAssocies.class);
+ add(EMHSectionProfil.class, DonPrtGeoProfilSection.class);
+ add(EMHSectionIdem.class, DonPrtGeoSectionIdem.class);
+
+ }
+
+ private void add(final Class<? extends EMH> emhClass, final Class<? extends InfosEMH>... required) {
+ neededInfoEMHByEMH.put(emhClass, new HashSet<Class<? extends InfosEMH>>(Arrays.asList(required)));
+ }
+
+ public void validate(final CtuluAnalyze emhLog, final EMH emhContenante) {
+
+ final Class emhClass = emhContenante.getClass();
+ final Set<Class<? extends InfosEMH>> expectedInfo = neededInfoEMHByEMH.get(emhClass);
+ if (CollectionUtils.isEmpty(expectedInfo)) { return; }
+ for (final Class infoClass : expectedInfo) {
+ if (!EMHHelper.containsInstanceOf(emhContenante.getInfosEMH(), infoClass)) {
+ emhLog.addError("validation.emh.contains.InfoEMH", emhContenante.getId(), emhContenante.getType(), infoClass
+ .getSimpleName());
+
+ }
+
+ }
+ // TODO a reactiver
+ // validateRelationSectionDansBranche(emhLog, emhContenante);
+ if (emhContenante.getClass().equals(EMHSectionIdem.class)) {
+ EMHSectionIdem id = (EMHSectionIdem) emhContenante;
+ CatEMHSection sectionRef = id.getSectionRef();
+ if (sectionRef == null || !getAuthorizedSectionRef().contains(sectionRef.getClass())) {
+ emhLog.addFatalError("validation.sectionRefWrong", emhContenante.getId());
+ }
+
+ }
+ final List<CalcTransItem> trans = EMHHelper.collectInstanceOf(emhContenante.getDCLM(), CalcTransItem.class);
+ if (trans != null) {
+ for (final CalcTransItem calcTransItem : trans) {
+ if (calcTransItem.getLoi() == null) {
+ emhLog.addFatalError("validation.emh.loi.notFound", emhContenante.getNom(), calcTransItem
+ .getNomCalculParent());
+ }
+ }
+ }
+
+ }
+
+ private List<Class<? extends CatEMHSection>> getAuthorizedSectionRef() {
+ return Arrays.asList(EMHSectionProfil.class, EMHSectionIdem.class, EMHSectionInterpolee.class);
+ }
+}
\ No newline at end of file
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/Crue9Validator.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/Crue9Validator.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/Crue9Validator.java 2010-03-04 23:48:28 UTC (rev 5703)
@@ -0,0 +1,124 @@
+/**
+ *
+ */
+package org.fudaa.dodico.crue.validation;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.fudaa.ctulu.CtuluAnalyze;
+import org.fudaa.ctulu.CtuluLib;
+import org.fudaa.dodico.crue.common.CommonMessages;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPerm;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPermBrancheSaintVenantQruis;
+import org.fudaa.dodico.crue.metier.emh.CalcPseudoPermCasierProfilQruis;
+import org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.EMH;
+import org.fudaa.dodico.crue.metier.emh.EMHModeleBase;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcScenario;
+import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.property.CrueProperties;
+import org.fudaa.dodico.crue.validation.ValidateEMHProperties.Validator;
+
+public class Crue9Validator implements Validator {
+
+ private final CtuluAnalyze res = new CtuluAnalyze();
+ private final List<CtuluAnalyze> lst = Arrays.asList(res);
+
+ boolean isBetaFound;
+ boolean isQdmDifferent;
+
+ final double defaultBeta;
+ final double defaultQruis;
+ final double defaultQdm;
+ final double epsBeta;
+ final double epsQdm;
+ final CrueProperties props;
+
+ final boolean export;
+ boolean coefRuisQdmInit = false;
+
+ double coefRuisQdm;
+
+ public Crue9Validator(final CrueProperties props, final boolean export) {
+ super();
+ this.export = export;
+ this.props = props;
+ res.setDefaultResourceBundle(CommonMessages.RESOURCE_BUNDLE);
+ res.setDesc(CommonMessages.getString("validation.crue9"));
+ defaultBeta = props.getDefaultDoubleValue("coefBeta");
+ defaultQruis = props.getDefaultDoubleValue("qRuis");
+ defaultQdm = props.getDefaultDoubleValue("coefRuisQdm");
+ epsQdm = props.getEpsilon("coefRuisQdm");
+ epsBeta = props.getEpsilon("coefBeta");
+ }
+
+ private void addMessage(final String m, final Object... params) {
+ if (export) {
+ res.addError(m, params);
+ } else {
+ res.addWarn(m, params);
+ }
+ }
+
+ private void computeQruis(final Object o) {
+ if (!(o instanceof OrdCalcScenario)) { return; }
+ final OrdCalcScenario ocal = (OrdCalcScenario) o;
+ final List<CalcPseudoPerm> calcPseudoPerm = EMHHelper.collectCalcPseudoPerm(ocal.getOrdCalc());
+ for (final CalcPseudoPerm calcPerm : calcPseudoPerm) {
+ // Il faut au moins une branche saint venant pour considérer qu'il y a un débit de ruissellement (identique)
+ final List<CalcPseudoPermBrancheSaintVenantQruis> calcQruis = calcPerm
+ .getCalcPseudoPermBrancheSaintVenantQruis();
+ final List<CalcPseudoPermCasierProfilQruis> calcCasierQruis = calcPerm.getCalcPseudoPermCasierProfilQruis();
+ if (CollectionUtils.isNotEmpty(calcQruis) || CollectionUtils.isNotEmpty(calcCasierQruis)) {
+ final Double qruis = EMHHelper.isQruisConstant(calcPerm, props);
+ if (qruis == null) {
+ addMessage("crue9.compatible.Qruis.NotConstant", Double.toString(defaultQruis), calcPerm.getNom());
+ }
+ }
+ }
+
+ }
+
+ private void computeQruisQDM(final Object o) {
+ if (isQdmDifferent) { return; }
+ if (o instanceof DonCalcSansPrtBrancheSaintVenant) {
+ final DonCalcSansPrtBrancheSaintVenant donCalcSansPrtBrancheSaintVenant = (DonCalcSansPrtBrancheSaintVenant) o;
+ if (!donCalcSansPrtBrancheSaintVenant.getActivated()) { return; }
+ final double value = donCalcSansPrtBrancheSaintVenant.getCoefRuisQdm();
+ if (!coefRuisQdmInit) {
+ coefRuisQdm = value;
+ coefRuisQdmInit = true;
+ } else if (!CtuluLib.isEquals(value, coefRuisQdm, epsQdm)) {
+ isQdmDifferent = true;
+ addMessage("crue9.compatible.coefRuisQdm.notConstant", Double.toString(defaultQdm));
+ }
+ }
+ }
+
+ public void findBeta(final Object o) {
+ if (isBetaFound) { return; }
+ if (o instanceof DonCalcSansPrtBrancheSaintVenant) {
+ final DonCalcSansPrtBrancheSaintVenant dcsp = (DonCalcSansPrtBrancheSaintVenant) o;
+ if (!CtuluLib.isEquals(defaultBeta, dcsp.getCoefBeta(), epsBeta)) {
+ isBetaFound = true;
+ addMessage("crue9.compatible.coefBeta");
+
+ }
+ }
+ }
+
+ public List<CtuluAnalyze> getLogs() {
+ return lst;
+ }
+
+ public void validate(final Set<Object> o, final EMH emh, final EMHModeleBase modeleParent) {
+ for (final Object object : o) {
+ findBeta(object);
+ computeQruisQDM(object);
+ computeQruis(object);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/IdValidatorForCrue10.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/IdValidatorForCrue10.java (rev 0)
+++ trunk/soft/fudaa-crue/dodico/src/main/j...
[truncated message content] |
|
From: <de...@us...> - 2010-03-06 01:31:06
|
Revision: 5705
http://fudaa.svn.sourceforge.net/fudaa/?rev=5705&view=rev
Author: deniger
Date: 2010-03-06 01:30:55 +0000 (Sat, 06 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Commentaires.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoProfilCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonPrtGeoProfilSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Loi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/LoiFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaverCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ContentEMHValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/Crue9Validator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-common-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dclm-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dptg-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDCLMFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDLHYFile.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3-1.dcsp.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dclm.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dlhy.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele4.dcsp.xml
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/Crue.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHManagerBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/resources/org/fudaa/fudaa/crue/common/ihmMessages.properties
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorsBuilder.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/AbstractDaoLoi.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -22,7 +22,7 @@
protected String Nom;
/** Représente la balise portant le même nom dans le fichier XML */
- protected String Description;
+ protected String Commentaire;
/**
* La date de début pour une loi Date. Doit être ignoree par les autres lois.
*/
@@ -85,7 +85,7 @@
*/
protected static void daoToMetierLoi(final Loi outLoi, final AbstractDaoLoi inLoi) {
outLoi.setNom(inLoi.Nom);
- outLoi.setDescription(inLoi.Description);
+ outLoi.setCommentaire(inLoi.Commentaire);
outLoi.setType(inLoi.Type);
outLoi.setEvolutionFF(inLoi.EvolutionFF);
}
@@ -98,7 +98,7 @@
*/
protected static void metierToDaoLoi(final AbstractDaoLoi outLoi, final Loi inLoi) {
outLoi.Nom = inLoi.getNom();
- outLoi.Description = StringUtils.defaultString(inLoi.getDescription());
+ outLoi.Commentaire = StringUtils.defaultString(inLoi.getCommentaire());
outLoi.Type = inLoi.getType();
outLoi.EvolutionFF = inLoi.getEvolutionFF();
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDCLM.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -135,7 +135,7 @@
final CalcPseudoPerm calculPermMetier = new CalcPseudoPerm();
calculPermMetier.setNom(calculPermPersist.Nom);
- calculPermMetier.setDescription(calculPermPersist.Description);
+ calculPermMetier.setCommentaire(calculPermPersist.Commentaire);
// calculPermMetier.setMethodeCalcul(calculPermPersist.MethodeCalcul);
// *** Gestion des elements d'un calcul permanent
@@ -245,7 +245,7 @@
final CalcTrans calculTransMetier = new CalcTrans();
calculTransMetier.setNom(calculTransPersist.Nom);
- calculTransMetier.setDescription(calculTransPersist.Description);
+ calculTransMetier.setCommentaire(calculTransPersist.Commentaire);
// *** Gestion des elements d'un calcul transitoire
if (calculTransPersist.listeElementsCalculTransitoire == null
@@ -503,7 +503,7 @@
final CalculPermanentPersist calculPersist = new CalculPermanentPersist();
calculPersist.Nom = calculMetier.getNom();
- calculPersist.Description = calculMetier.getDescription();
+ calculPersist.Commentaire = calculMetier.getCommentaire();
// calculPersist.MethodeCalcul = calculMetier.getMethodeCalcul();
calculPersist.listeElementsCalculPermanent = new ArrayList<RefDCLMAbstractPersist>();
@@ -733,7 +733,7 @@
final CalculTransitoirePersist calculPersist = new CalculTransitoirePersist();
calculPersist.Nom = calculMetier.getNom();
- calculPersist.Description = calculMetier.getDescription();
+ calculPersist.Commentaire = calculMetier.getCommentaire();
calculPersist.listeElementsCalculTransitoire = new ArrayList<RefDCLMAbstractPersist>();
// final List<NoeudNiveauContinuHydrogrammePersist> listePersistNNCH = new
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDPTG.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -9,6 +9,7 @@
import org.apache.commons.collections.CollectionUtils;
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.crue.io.common.CrueData;
+import org.fudaa.dodico.crue.io.dao.CrueDaoStructureDPTG.Fente;
import org.fudaa.dodico.crue.metier.emh.CatEMHBranche;
import org.fudaa.dodico.crue.metier.emh.CatEMHSection;
import org.fudaa.dodico.crue.metier.emh.DonFrt;
@@ -158,9 +159,11 @@
final CrueDaoStructureDPTG.ProfilSection profilPersistant = new CrueDaoStructureDPTG.ProfilSection();
profilPersistant.Nom = in.getNom();
+ profilPersistant.Commentaire = in.getCommentaire();
if (in.getFente() != null) {
- profilPersistant.LargeurFente = in.getFente().getLargeurFente();
- profilPersistant.ProfondeurFente = in.getFente().getProfondeurFente();
+ profilPersistant.Fente = new Fente();
+ profilPersistant.Fente.LargeurFente = in.getFente().getLargeurFente();
+ profilPersistant.Fente.ProfondeurFente = in.getFente().getProfondeurFente();
}
// -- Ecriture des lits numerotes --//
@@ -231,6 +234,7 @@
profilPersistant.Longueur = in.getLongueur();
profilPersistant.Nom = in.getNom();
+ profilPersistant.Commentaire = in.getCommentaire();
// -- Ecriture du lit utile dans le profil casier --//
if (in.getLitUtile() != null) {
@@ -304,18 +308,19 @@
// -- on remplit son contenu --//
profilGeo.setNom(profilPersist.Nom);
- if (profilPersist.LargeurFente != null || profilPersist.ProfondeurFente != null) {
+ profilGeo.setCommentaire(profilPersist.Commentaire);
+ if (profilPersist.Fente != null) {
final DonPrtGeoProfilSectionFenteData dataFente = new DonPrtGeoProfilSectionFenteData(crueData
.getCruePropertyDefinitionContainer());
- if (profilPersist.LargeurFente == null) {
+ if (profilPersist.Fente.LargeurFente == null) {
analyser.addWarn("dptg.largeurFenteNotDefined");
} else {
- dataFente.setLargeurFente(profilPersist.LargeurFente);
+ dataFente.setLargeurFente(profilPersist.Fente.LargeurFente);
}
- if (profilPersist.ProfondeurFente == null) {
+ if (profilPersist.Fente.ProfondeurFente == null) {
analyser.addWarn("dptg.profondeurFenteNotDefined");
} else {
- dataFente.setProfondeurFente(profilPersist.ProfondeurFente);
+ dataFente.setProfondeurFente(profilPersist.Fente.ProfondeurFente);
}
profilGeo.setFente(dataFente);
}
@@ -396,6 +401,7 @@
if (profilCasier == null) {
profilCasier = new DonPrtGeoProfilCasier(crueData.getCruePropertyDefinitionContainer());
profilCasier.setNom(nomProfil);
+ profilCasier.setCommentaire(profilPersist.Commentaire);
crueData.registerDefinedCasierProfil(profilCasier);
crueData.getSousModele().addInfosEMH(profilCasier);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterDRSO.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -444,7 +444,7 @@
// -- on recherche sa spécialisation --//
if (casierPersist instanceof CasierProfil) {
- casier = FactoryEMH.createCasierProfil(nom, data.getCruePropertyDefinitionContainer());
+ casier = FactoryEMH.createCasierProfil(nom, data.getCruePropertyDefinitionContainer(), false);
final CasierProfil casierProfilPersist = (CasierProfil) casierPersist;
if (CollectionUtils.isNotEmpty(casierProfilPersist.ProfilCasiers)) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDCLM.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -77,8 +77,8 @@
protected static abstract class CalculAbstractPersist {
/** Nom du calcul */
protected String Nom;
- /** Description du calcul */
- protected String Description;
+ /** Commentaire du calcul */
+ protected String Commentaire;
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureDPTG.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -61,6 +61,11 @@
xstream.useAttributeFor(BrancheSaintVenant.class, "NomRef");
}
+ protected static class Fente {
+ protected Double LargeurFente;
+ protected Double ProfondeurFente;
+ }
+
protected static class ProfilSection implements ObjetNomme {
public String getId() {
return Nom;
@@ -79,8 +84,7 @@
* optionnel.
*/
protected String Commentaire;
- protected Double LargeurFente;
- protected Double ProfondeurFente;
+ protected Fente Fente;
protected EvolutionFF EvolutionFF;
protected List<Lit> LitNumerotes;
@@ -123,6 +127,7 @@
}
protected static class ProfilCasier extends AbstractCasier {
+ protected String Commentaire;
protected double Longueur;
protected EvolutionFF EvolutionFF;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -1356,7 +1356,7 @@
lireSuite();
final EMHCasierProfil newCasier = FactoryEMH.createCasierProfil(CruePrefix.changePrefix(idNoeud,
- CruePrefix.P_NOEUD, CruePrefix.P_CASIER), metier.getCruePropertyDefinitionContainer());
+ CruePrefix.P_NOEUD, CruePrefix.P_CASIER), metier.getCruePropertyDefinitionContainer(), true);
newCasier.setUserActive(true);
CatEMHNoeud noeudRef = metier.findNoeudByReference(idNoeud);
@@ -1988,6 +1988,8 @@
readCasiers(metier);
} else {
+ analyze_.addFatalError("io.dc.carteNotRecognized", in_.getLineNumber(), element);
+ // return null;
lireSuite();
}
}
@@ -2002,6 +2004,7 @@
analyze_.manageException(e);
return null;
}
+
// finalement on remet les sectionIdem en place en recherchant les références.
if (sectionIdemWithNoRef != null) {
for (final Entry<EMHSectionIdem, String> it : sectionIdemWithNoRef.entrySet()) {
@@ -2030,6 +2033,7 @@
if (resu.getMetier().getPretraitementsGeom() == null) {
createDefaultOPTG(resu.getMetier());
}
+ if (analyze_.containsFatalError()) { return null; }
return resu;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -915,7 +915,7 @@
final CalcPseudoPerm calcPerm = new CalcPseudoPerm();
calcPerm.setNom(CruePrefix.P_CALCUL + "P" + (nbEtatPermanent + 1));
- calcPerm.setDescription("Calcul pseudo-permanent " + (nbEtatPermanent + 1));
+ calcPerm.setCommentaire("Calcul pseudo-permanent " + (nbEtatPermanent + 1));
// pour le premier on prend en compte la reprise éventuelle
final boolean first = ocal.getOrdCalc().isEmpty();
if (reprise != null && first) {
@@ -1177,7 +1177,7 @@
// Un seul calcul transitoire possible en version crue 9
final CalcTrans calcTrans = new CalcTrans();
calcTrans.setNom(CruePrefix.P_CALCUL + "T1");
- calcTrans.setDescription("Calcul transitoire 1");
+ calcTrans.setCommentaire("Calcul transitoire 1");
dclm.addCalcTrans(calcTrans);
final OrdCalcTransIniCalcPrecedent prec = new OrdCalcTransIniCalcPrecedent();
prec.setCalcTrans(calcTrans);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -16,8 +16,6 @@
import org.fudaa.ctulu.CtuluLib;
import org.fudaa.ctulu.fileformat.FortranInterface;
import org.fudaa.dodico.crue.common.DateDurationConverter;
-import org.fudaa.dodico.crue.comparaison.tester.EqualsTesterLoi;
-import org.fudaa.dodico.crue.comparaison.tester.FactoryEqualsTester;
import org.fudaa.dodico.crue.io.common.CrueData;
import org.fudaa.dodico.crue.io.common.CrueIOResu;
import org.fudaa.dodico.crue.metier.emh.CalcPseudoPerm;
@@ -129,21 +127,21 @@
private boolean aDonneesPerm = false;
private boolean aDonneesTrans = false;
- private boolean isModeLateral(CrueData data) {
- double epsForCoefRus = data.getCruePropertyDefinitionContainer().getEpsilon("CoefRuis");
- List<EMH> allSimpleEMH = data.getAllSimpleEMH();
- for (EMH emh : allSimpleEMH) {
- List<DonCalcSansPrtBrancheSaintVenant> dcsp = EMHHelper.collectClass(emh.getInfosEMH(),
+ private boolean isModeLateral(final CrueData data) {
+ final double epsForCoefRus = data.getCruePropertyDefinitionContainer().getEpsilon("CoefRuis");
+ final List<EMH> allSimpleEMH = data.getAllSimpleEMH();
+ for (final EMH emh : allSimpleEMH) {
+ final List<DonCalcSansPrtBrancheSaintVenant> dcsp = EMHHelper.collectClass(emh.getInfosEMH(),
DonCalcSansPrtBrancheSaintVenant.class);
if (dcsp != null) {
- for (DonCalcSansPrtBrancheSaintVenant dcspItem : dcsp) {
+ for (final DonCalcSansPrtBrancheSaintVenant dcspItem : dcsp) {
if (!CtuluLib.isZero(dcspItem.getCoefRuis(), epsForCoefRus)) { return true; }
}
}
- List<DonCalcSansPrtCasierProfil> dcspCasierProfil = EMHHelper.collectClass(emh.getInfosEMH(),
+ final List<DonCalcSansPrtCasierProfil> dcspCasierProfil = EMHHelper.collectClass(emh.getInfosEMH(),
DonCalcSansPrtCasierProfil.class);
if (dcsp != null) {
- for (DonCalcSansPrtCasierProfil dcspItem : dcspCasierProfil) {
+ for (final DonCalcSansPrtCasierProfil dcspItem : dcspCasierProfil) {
if (!CtuluLib.isZero(dcspItem.getCoefRuis(), epsForCoefRus)) { return true; }
}
}
@@ -196,7 +194,7 @@
aDonneesPerm = EMHHelper.containsPermanent(ordCalc);
aDonneesTrans = EMHHelper.containsTransitoire(ordCalc);
- boolean modeLateral = isModeLateral(data);
+ final boolean modeLateral = isModeLateral(data);
// cru
if (modeLateral
&& !computeQruisIdentique(coeffsRuisParCalcPerm, ordCalc, data.getCruePropertyDefinitionContainer())) { return; }
@@ -538,7 +536,7 @@
return calcILE;
}
- private double getTolNdz(final OrdPrtCIniModeleBase methodesInterpolation, CrueData data) {
+ private double getTolNdz(final OrdPrtCIniModeleBase methodesInterpolation, final CrueData data) {
final Collection<ValParam> listValParam = methodesInterpolation.getValParam();
if (listValParam != null) {
final String key = CruePrefix.PM_TOL_ND_Z.toUpperCase();
@@ -549,37 +547,25 @@
return getTolNdZDefaultValue(data);
}
- private double getTolNdZDefaultValue(CrueData data) {
+ private double getTolNdZDefaultValue(final CrueData data) {
return data.getCruePropertyDefinitionContainer().getDefaultDoubleValue(DefaultValues.PM_TOL_ND_Z);
}
private double computeQruisQDM(final CrueData data) {
final List<EMHBrancheSaintVenant> branchesSaintVenant = data.getBranchesSaintVenant();
- boolean valueSet = false;
- double defaultValue = data.getCruePropertyDefinitionContainer().getDefaultDoubleValue("coefRuisQdm");
- double res = defaultValue;
- final double eps = data.getCruePropertyDefinitionContainer().getEpsilon("coefRuisQdm");
for (final EMHBrancheSaintVenant brancheSaintVenant : branchesSaintVenant) {
if (brancheSaintVenant.getUserActive()) {
final List<DonCalcSansPrtBrancheSaintVenant> dcsps = EMHHelper.collectClass(brancheSaintVenant.getInfosEMH(),
DonCalcSansPrtBrancheSaintVenant.class);
- for (final DonCalcSansPrtBrancheSaintVenant dcsp : dcsps) {
- final double coefRuisQdm = dcsp.getCoefRuisQdm();
- if (valueSet) {
- if (!CtuluLib.isEquals(res, coefRuisQdm, eps)) { return defaultValue; }
- } else {
- valueSet = true;
- res = coefRuisQdm;
- }
- }
+ if (CollectionUtils.isNotEmpty(dcsps)) { return dcsps.get(0).getCoefRuisQdm(); }
}
}
- return res;
+ return data.getCruePropertyDefinitionContainer().getDefaultDoubleValue("coefRuisQdm");
}
private boolean computeQruisIdentique(final Map<String, Double> coeffsRuisParCalcPerm, final List<OrdCalc> ordCalcs,
- CrueProperties props) {
- List<CalcPseudoPerm> calcPseudoPerm = EMHHelper.collectCalcPseudoPerm(ordCalcs);
+ final CrueProperties props) {
+ final List<CalcPseudoPerm> calcPseudoPerm = EMHHelper.collectCalcPseudoPerm(ordCalcs);
// Pour déterminer s'il existe un coefficient de ruissellement commun pour un calcul permanent, il faut que le
// coefficient de chaque branche Saint Venant de ce calcul soit le même.
for (int i = 0, imax = calcPseudoPerm.size(); i < imax; i++) {
@@ -589,7 +575,12 @@
final List<CalcPseudoPermBrancheSaintVenantQruis> calcQruis = calcPerm.getCalcPseudoPermBrancheSaintVenantQruis();
final List<CalcPseudoPermCasierProfilQruis> calcCasierQruis = calcPerm.getCalcPseudoPermCasierProfilQruis();
if (CollectionUtils.isNotEmpty(calcQruis) || CollectionUtils.isNotEmpty(calcCasierQruis)) {
- Double d = EMHHelper.isQruisConstant(calcPerm, props);
+ Double d = null;
+ if (CollectionUtils.isNotEmpty(calcQruis)) {
+ d = calcQruis.get(0).getQruis();
+ } else if (CollectionUtils.isNotEmpty(calcCasierQruis)) {
+ d = calcCasierQruis.get(0).getQruis();
+ }
coeffsRuisParCalcPerm.put(calcPerm.getNom(), d == null ? Double.valueOf(props.getDefaultDoubleValue("qRuis"))
: d);
}
@@ -738,15 +729,6 @@
fortranWriter.doubleField(j, valeursCP.get(j));
}
- // // S'il y a du ruissellement, une valeur supplémentaire est attendue
- // if (coeffsRuisParCalcPerm.size() > 0) {
- // if (coeffsRuisParCalcPerm.containsKey(nomCalcPerm)) {
- // fortranWriter_.doubleField(size, (Double) coeffsRuisParCalcPerm.get(nomCalcPerm));
- // } else {
- // fortranWriter_.doubleField(size, 0);
- // }
- // }
-
fortranWriter.writeFields();
}
}
@@ -839,47 +821,17 @@
.getCalcPseudoPermBrancheSaintVenantQruis();
// Ajout la valeur de ruissellement s'il y en a
if (CollectionUtils.isNotEmpty(listeBranchesSV)) {
- final double valeur = getCommonQruis(nomCalcPerm, listeBranchesSV);
- if (analyze_.containsFatalError()) { return; }
+ final double valeur = listeBranchesSV.get(0).getQruis();
valeursCP.add(valeur);
}
lignesE.put(nomCalcPerm, valeursCP);
}
- private double getCommonQruis(final String nomCalcPerm,
- final List<CalcPseudoPermBrancheSaintVenantQruis> listeBranchesSVe) {
- boolean qruisIdentique = true;
- double qruis = 0.0;
- boolean qruisSet = false;
- for (final CalcPseudoPermBrancheSaintVenantQruis brancheSV : listeBranchesSVe) {
- if (brancheSV.getNomCalculParent() != null && brancheSV.getNomCalculParent().equals(nomCalcPerm)) {
- if (!qruisSet) {
- qruis = brancheSV.getQruis();
- qruisSet = true;
- } else if (!CtuluLib.isEquals(brancheSV.getQruis(), qruis, 1e-8)) {
- qruisIdentique = false;
- break;
- }
- }
- }
- // Enregistrement du débit de ruissellement si à la dernière branche SaintVenant, le debit est constaté comme
- // étant identique sur toutes les branches SaintVenant de ce calcul permanent
- double valeur = 0.0;
- if (qruisIdentique) {
- valeur = qruis;
- } else {
- valeur = 0.0;
- analyze_.addFatalError("io.dh.qruis.indefini.error", nomCalcPerm);
- }
- return valeur;
- }
-
/**
* @param data
* @throws IOException
*/
private void writeDonneesTransitoires(final CrueData data) throws IOException {
- FactoryEqualsTester equalsTesterFac = new FactoryEqualsTester(data.getCruePropertyDefinitionContainer());
writeCom("");
writeCom(" Donnees transitoires ");
@@ -920,7 +872,7 @@
dt = DateDurationConverter.durationToCrueFormat(duree);
final ParamCalcScenario pcal = data.getParamCalc();
- LocalDateTime dateDebSce = pcal.getDateDebSce();
+ final LocalDateTime dateDebSce = pcal.getDateDebSce();
// le tmax s'est la date de deb + duree
tMax = DateDurationConverter.dateToCrueFormat(dateDebSce.plus(pcal.getDureeSce()));
hDeb = DateDurationConverter.dateToCrueFormat(dateDebSce);
@@ -947,9 +899,9 @@
final List<CalcTrans> calcsTrans = EMHHelper.collectCalcTrans(data.getOrdCalc().getOrdCalc());
if (CollectionUtils.isEmpty(calcsTrans)) { return; }
- if (calcsTrans.size() > 1) {
- analyze_.addWarn("io.dh.nb.calctrans.diff.un.warn");
- }
+ // if (calcsTrans.size() > 1) {
+ // analyze_.addWarn("io.dh.nb.calctrans.diff.un.warn");
+ // }
final CalcTrans calcTrans = calcsTrans.get(0);
@@ -986,30 +938,7 @@
if (CollectionUtils.isEmpty(listeBranchesSV)) { return; }
// final CalcTransBrancheSaintVenantQruis brancheSV = listeBranchesSV.iterator().next();
- LoiDF loiCommun = null;
- EqualsTesterLoi tester = null;
- for (final CalcTransBrancheSaintVenantQruis venantQruis : listeBranchesSV) {
- if (loiCommun == null) {
- loiCommun = venantQruis.getLoiTQruis();
- }
- // on ne lance pas la comparaison si les lois sont les meme
- else if (!venantQruis.getLoiTQruis().getId().equals(loiCommun.getId())) {
- if (tester == null) {
- tester = new EqualsTesterLoi(equalsTesterFac);
- }
- try {
- if (!tester.isSameSafe(loiCommun, venantQruis.getLoiTQruis(), null, tester.getContextFactory().create())) {
- analyze_.addFatalError("dh.loiTQruis.notCommon", venantQruis.getEmh().getNom(), venantQruis
- .getNomCalculParent());
- }
- } catch (final Exception e) {
- analyze_.manageException(e);
- }
-
- }
-
- }
-
+ final LoiDF loiCommun = listeBranchesSV.iterator().next().getLoiTQruis();
if (loiCommun != null) {
writeCom("");
writeCom(" ruis ");
@@ -1029,7 +958,7 @@
* @param pdtVar
* @throws IOException
*/
- private void ecritLignesDTransitoire(final PdtVar pdtVar, LocalDateTime dateDebut) throws IOException {
+ private void ecritLignesDTransitoire(final PdtVar pdtVar, final LocalDateTime dateDebut) throws IOException {
// Ligne D1
fortranWriter.stringField(0, "VARDT");
@@ -1198,7 +1127,7 @@
* @param loi
* @throws IOException
*/
- private void ecritLoi(CrueData data, final Loi loi) throws IOException {
+ private void ecritLoi(final CrueData data, final Loi loi) throws IOException {
if (loi instanceof LoiDF) {
@@ -1216,7 +1145,7 @@
final EvolutionFF evolFF = loi.getEvolutionFF();
if (evolFF != null && CollectionUtils.isNotEmpty(evolFF.getPtEvolutionFF())) {
- List<PtEvolutionFF> ptEvolutionFF = evolFF.getPtEvolutionFF();
+ final List<PtEvolutionFF> ptEvolutionFF = evolFF.getPtEvolutionFF();
// Ligne E3-1
writeCom("");
writeCom(" Zbas Dz ");
@@ -1243,10 +1172,10 @@
int countEltsParLigne = 0;
// Lignes E3-2
- double eps = data.getCruePropertyDefinitionContainer().getEpsilon("dz");
+ final double eps = data.getCruePropertyDefinitionContainer().getEpsilon("dz");
for (int j = 0, jmax = ptEvolutionFF.size(); j < jmax; j++) {
if (j > 0) {
- double newDz = ptEvolutionFF.get(j).getY() - ptEvolutionFF.get(j - 1).getY();
+ final double newDz = ptEvolutionFF.get(j).getY() - ptEvolutionFF.get(j - 1).getY();
if (!CtuluLib.isEquals(dz, newDz, eps)) {
analyze_.addError("io.dh.dzNotConstant", loi.getNom());
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java 2010-03-05 17:03:46 UTC (rev 5704)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java 2010-03-06 01:30:55 UTC (rev 5705)
@@ -1,13 +1,13 @@
/***********************************************************************
- * Module: Calc.java
- *...
[truncated message content] |
|
From: <de...@us...> - 2010-03-08 00:27:39
|
Revision: 5706
http://fudaa.svn.sourceforge.net/fudaa/?rev=5706&view=rev
Author: deniger
Date: 2010-03-08 00:27:31 +0000 (Mon, 08 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoORES.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueDaoStructureORES.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/CrueIODico.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/ManagerEMHContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneur.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CommentaireContainer.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHConteneurDeSousModele.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSousModele.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumRegle.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ObjetNomme.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheBarrageFilEau.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheBarrageGenerique.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBranchePdc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilLateral.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilTransversal.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheStrickler.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResNoeudNiveauContinu.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionSansGeometrie.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/RelationEMHBrancheContientSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalcul.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelperPredicate.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/LoiFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/SimpleClassNameComparator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaverCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioSaverCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/PropertyValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateModeleScenarioWithSchema.java
trunk/soft/fudaa-crue/dodico/src/main/resources/default.ores.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/io/default-comparaison.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-ores-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueORESFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestEMHPropertiesValidator.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.ores.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3bis.ores.xml
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHManagerBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/CrueProjet.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFicheScenario.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleScenarioManager.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/AbstractResCalSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CommentaireItem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CommentairesManager.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumRegime.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ObjetWithID.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdRes.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheBarrageFilEau.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheBarrageGenerique.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBranchePdc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheSeuilLateral.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheSeuilTransversal.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheStrickler.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalBrancheWithRegime.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalNoeudNiveauContinu.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalSectionIdem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalSectionInterpolee.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalSectionProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalSectionSansGeometrie.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/AbstractCrueValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CrueValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/DelegateValidatorEMHContentRelations.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ScenarioWriterForXSDValidation.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHTreeWalker.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidatorForCrue9Export.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidatorForIDCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidatorForIDCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidatorForValuesAndContents.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidatorHelper.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/VariableBuilder.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.ores.xml.in
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.ores.xml.out
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Commentaires.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ContentEMHValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/Crue9Validator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/IdValidatorForCrue10.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/IdValidatorForCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/PropertyValidatorBuilder.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ScenarioWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateEMHProperties.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValueValidator.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/VariableBuilder.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/validation/validation.txt
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java 2010-03-06 01:30:55 UTC (rev 5705)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/common/CrueErrorManager.java 2010-03-08 00:27:31 UTC (rev 5706)
@@ -80,12 +80,33 @@
return analyser;
}
+ public void addAll(List<CtuluAnalyze> in) {
+ if (in == null) { return; }
+ for (CtuluAnalyze ctuluAnalyze : in) {
+ addAnalyzer(ctuluAnalyze);
+ }
+ }
+
+ public void addNotEmptyLogs(List<CtuluAnalyze> in) {
+ if (in == null) { return; }
+ for (CtuluAnalyze ctuluAnalyze : in) {
+ if (ctuluAnalyze != null && !ctuluAnalyze.isEmpty()) {
+ addAnalyzer(ctuluAnalyze);
+ }
+ }
+ }
+
public String getMainDesc() {
return mainAnalyze.getDesc();
}
+ /**
+ * @param analyze ajoute si non null;
+ */
public void addAnalyzer(CtuluAnalyze analyze) {
- analyser.add(analyze);
+ if (analyze != null) {
+ analyser.add(analyze);
+ }
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2010-03-06 01:30:55 UTC (rev 5705)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteComparaison.java 2010-03-08 00:27:31 UTC (rev 5706)
@@ -42,7 +42,7 @@
convertCompare.setFactory(factory);
}
- public static class ExecuteComparaisonResult {
+ public static class ExecuteComparaisonResult implements Comparable<ExecuteComparaisonResult> {
private CtuluAnalyze analyze;
/**
@@ -68,6 +68,11 @@
return nbObjectTested;
}
+ public int compareTo(ExecuteComparaisonResult o) {
+ if (o == null) { return 1; }
+ return id.compareTo(o.id);
+ }
+
private ResultatTest res;
private String id;
private String msg;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2010-03-06 01:30:55 UTC (rev 5705)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2010-03-08 00:27:31 UTC (rev 5706)
@@ -16,7 +16,7 @@
import org.fudaa.dodico.crue.common.CustomPropertyUtilsBeanInstaller;
import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
import org.fudaa.dodico.crue.metier.emh.InfosEMH;
-import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
+import org.fudaa.dodico.crue.metier.emh.ObjetWithID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -181,7 +181,10 @@
private void addDiff(final Object o1, final ResultatTest res, final String propName, final Object a, final Object b) {
if (res != null) {
- String pref = (o1 instanceof ObjetNomme) ? ((ObjetNomme) o1).getId() + ": " : StringUtils.EMPTY;
+ String pref = StringUtils.EMPTY;
+ if (o1 instanceof ObjetWithID) {
+ pref = ((ObjetWithID) o1).getId() + ": ";
+ }
final ResultatTest item = new ResultatTest(a, b, pref
+ ComparaisonMessages.getString("compare.property.diff", propName));
item.updatePrint();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java 2010-03-06 01:30:55 UTC (rev 5705)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatCalcul.java 2010-03-08 00:27:31 UTC (rev 5706)
@@ -5,7 +5,7 @@
import org.fudaa.dodico.crue.common.DoubleComparator;
import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalcul;
import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalculPasDeTemps;
-import org.fudaa.dodico.crue.io.neuf.FCBValueObject.AbstractRes;
+import org.fudaa.dodico.crue.metier.emh.ResCalcul;
/**
* @author denf01a
@@ -51,8 +51,8 @@
int pos1 = i;
int pos2 = posFound.intValue();
try {
- AbstractRes read1 = o1.read(pos1);
- AbstractRes read2 = o2.read(pos2);
+ ResCalcul read1 = o1.read(pos1);
+ ResCalcul read2 = o2.read(pos2);
ResultatTest resLocal = new ResultatTest("", "", "compare.resultat.diff", pdt);
if (!beanTester.isSame(read1, read2, resLocal, context)) {
res.addDiff(resLocal);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java 2010-03-06 01:30:55 UTC (rev 5705)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java 2010-03-08 00:27:31 UTC (rev 5706)
@@ -5,6 +5,7 @@
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
+import org.fudaa.dodico.crue.metier.emh.ObjetWithID;
import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
/**
@@ -81,14 +82,14 @@
public void updatePrint() {
if (getPrintA() == null) {
- if (objetA instanceof ObjetNomme) {
+ if (objetA instanceof ObjetWithID) {
setPrintA(((ObjetNomme) objetA).getNom());
} else if (objetA != null) {
setPrintA(objetA.getClass().getSimpleName() + ": " + objetA);
}
}
if (getPrintB() == null) {
- if (objetB instanceof ObjetNomme) {
+ if (objetB instanceof ObjetWithID) {
setPrintB(((ObjetNomme) objetB).getNom());
} else if (objetB != null) {
setPrintB(objetB.getClass().getSimpleName() + ": " + objetB);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java 2010-03-06 01:30:55 UTC (rev 5705)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueConverterORES.java 2010-03-08 00:27:31 UTC (rev 5706)
@@ -5,10 +5,26 @@
import java.util.ArrayList;
+import com.memoire.fu.FuLogCrue;
+
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.crue.io.common.CrueData;
-import org.fudaa.dodico.crue.io.dao.CrueDaoStructureORES.*;
-import org.fudaa.dodico.crue.metier.emh.*;
+import org.fudaa.dodico.crue.metier.emh.OrdRes;
+import org.fudaa.dodico.crue.metier.emh.OrdResBrancheBarrageFilEau;
+import org.fudaa.dodico.crue.metier.emh.OrdResBrancheBarrageGenerique;
+import org.fudaa.dodico.crue.metier.emh.OrdResBrancheOrifice;
+import org.fudaa.dodico.crue.metier.emh.OrdResBranchePdc;
+import org.fudaa.dodico.crue.metier.emh.OrdResBrancheSaintVenant;
+import org.fudaa.dodico.crue.metier.emh.OrdResBrancheSeuilLateral;
+import org.fudaa.dodico.crue.metier.emh.OrdResBrancheSeuilTransversal;
+import org.fudaa.dodico.crue.metier.emh.OrdResBrancheStrickler;
+import org.fudaa.dodico.crue.metier.emh.OrdResCasierProfil;
+import org.fudaa.dodico.crue.metier.emh.OrdResNoeudNiveauContinu;
+import org.fudaa.dodico.crue.metier.emh.OrdResScenario;
+import org.fudaa.dodico.crue.metier.emh.OrdResSectionIdem;
+import org.fudaa.dodico.crue.metier.emh.OrdResSectionInterpolee;
+import org.fudaa.dodico.crue.metier.emh.OrdResSectionProfil;
+import org.fudaa.dodico.crue.metier.emh.OrdResSectionSansGeometrie;
/**
* Classe qui se charge de remplir les structures DAO du fichier ORES avec les donnees metier et inversement.
@@ -28,161 +44,166 @@
final OrdResScenario metier = new OrdResScenario();
- // Noeuds
- if (dao.OrdResNoeuds == null || dao.OrdResNoeuds.size() == 0) {
- CrueHelper.emhEmpty("Noeuds", analyser);
- } else {
- final NoeudNiveauContinuPersist eltPersist = dao.OrdResNoeuds.get(0);
- final OrdResNoeudNiveauContinu eltMetier = new OrdResNoeudNiveauContinu();
- eltMetier.setDdeZ(eltPersist.DdeZ);
- eltMetier.setDdeHmin(eltPersist.DdeHmin);
- eltMetier.setDdeHmax(eltPersist.DdeHmax);
- metier.setOrdResNoeudNiveauContinu(eltMetier);
- }
+ try {
+ // Noeuds
+ if (dao.OrdResNoeuds == null || dao.OrdResNoeuds.size() == 0) {
+ CrueHelper.emhEmpty("Noeuds", analyser);
+ } else {
+ // final NoeudNiveauContinuPersist eltPersist = dao.OrdResNoeuds.get(0);
+ // final OrdResNoeudNiveauContinu eltMetier = new OrdResNoeudNiveauContinu();
+ // eltMetier.setDdeZ(eltPersist.DdeZ);
+ // eltMetier.setDdeHmin(eltPersist.DdeHmin);
+ // eltMetier.setDdeHmax(eltPersist.DdeHmax);
+ metier.setOrdResNoeudNiveauContinu((OrdResNoeudNiveauContinu) dao.OrdResNoeuds.get(0).clone());
+ }
- // Casiers
- if (dao.OrdResCasiers == null || dao.OrdResCasiers.size() == 0) {
- CrueHelper.emhEmpty("Casiers", analyser);
- } else {
- for (final CasierAbstractPersist eltPersist : dao.OrdResCasiers) {
- if (eltPersist instanceof CasierProfilPersist) {
+ // Casiers
+ if (dao.OrdResCasiers == null || dao.OrdResCasiers.size() == 0) {
+ CrueHelper.emhEmpty("Casiers", analyser);
+ } else {
+ for (final OrdRes eltPersist : dao.OrdResCasiers) {
+ if (eltPersist instanceof OrdResCasierProfil) {
- final CasierProfilPersist eltPersistCaste = (CasierProfilPersist) eltPersist;
- final OrdResCasierProfil eltMetier = new OrdResCasierProfil();
- eltMetier.setDdeSplan(eltPersistCaste.DdeSplan);
- eltMetier.setDdeVol(eltPersistCaste.DdeVol);
- metier.setOrdResCasierProfil(eltMetier);
+ // final CasierProfilPersist eltPersistCaste = (CasierProfilPersist) eltPersist;
+ // final OrdResCasierProfil eltMetier = new OrdResCasierProfil();
+ // eltMetier.setDdeSplan(eltPersistCaste.DdeSplan);
+ // eltMetier.setDdeVol(eltPersistCaste.DdeVol);
+ metier.setOrdResCasierProfil((OrdResCasierProfil) eltPersist.clone());
- // } else if (eltPersist instanceof CasierMNTPersist) {
+ // } else if (eltPersist instanceof CasierMNTPersist) {
+ }
}
}
- }
- // Sections
- if (dao.OrdResSections == null || dao.OrdResSections.size() == 0) {
- CrueHelper.emhEmpty("Sections", analyser);
- } else {
- for (final SectionAbstractPersist eltPersist : dao.OrdResSections) {
- if (eltPersist instanceof SectionProfilPersist) {
+ // Sections
+ if (dao.OrdResSections == null || dao.OrdResSections.size() == 0) {
+ CrueHelper.emhEmpty("Sections", analyser);
+ } else {
+ for (final OrdRes eltPersist : dao.OrdResSections) {
+ if (eltPersist instanceof OrdResSectionProfil) {
+ //
+ // final SectionProfilPersist eltPersistCaste = (SectionProfilPersist) eltPersist;
+ // final OrdResSectionProfil eltMetier = new OrdResSectionProfil();
+ // eltMetier.setDdeQ(eltPersistCaste.DdeQ);
+ // eltMetier.setDdeZ(eltPersistCaste.DdeZ);
+ // eltMetier.setDdeH(eltPersistCaste.DdeH);
+ // eltMetier.setDdeZf(eltPersistCaste.DdeZf);
+ // eltMetier.setDdeZc(eltPersistCaste.DdeZc);
+ // eltMetier.setDdeZn(eltPersistCaste.DdeZn);
+ // eltMetier.setDdeYc(eltPersistCaste.DdeYc);
+ // eltMetier.setDdeYn(eltPersistCaste.DdeYn);
+ // eltMetier.setDdeVact(eltPersistCaste.DdeVact);
+ // eltMetier.setDdeVtot(eltPersistCaste.DdeVtot);
+ // eltMetier.setDdeVc(eltPersistCaste.DdeVc);
+ // eltMetier.setDdeFr(eltPersistCaste.DdeFr);
+ // eltMetier.setDdeLact(eltPersistCaste.DdeLact);
+ // eltMetier.setDdeLtot(eltPersistCaste.DdeLtot);
+ // eltMetier.setDdeSact(eltPersistCaste.DdeSact);
+ // eltMetier.setDdeStot(eltPersistCaste.DdeStot);
+ // eltMetier.setDdeDact(eltPersistCaste.DdeDact);
+ // eltMetier.setDdeDtot(eltPersistCaste.DdeDtot);
+ metier.setOrdResSectionProfil((OrdResSectionProfil) eltPersist.clone());
- final SectionProfilPersist eltPersistCaste = (SectionProfilPersist) eltPersist;
- final OrdResSectionProfil eltMetier = new OrdResSectionProfil();
- eltMetier.setDdeQ(eltPersistCaste.DdeQ);
- eltMetier.setDdeZ(eltPersistCaste.DdeZ);
- eltMetier.setDdeH(eltPersistCaste.DdeH);
- eltMetier.setDdeZf(eltPersistCaste.DdeZf);
- eltMetier.setDdeZc(eltPersistCaste.DdeZc);
- eltMetier.setDdeZn(eltPersistCaste.DdeZn);
- eltMetier.setDdeYc(eltPersistCaste.DdeYc);
- eltMetier.setDdeYn(eltPersistCaste.DdeYn);
- eltMetier.setDdeVact(eltPersistCaste.DdeVact);
- eltMetier.setDdeVtot(eltPersistCaste.DdeVtot);
- eltMetier.setDdeVc(eltPersistCaste.DdeVc);
- eltMetier.setDdeFr(eltPersistCaste.DdeFr);
- eltMetier.setDdeLact(eltPersistCaste.DdeLact);
- eltMetier.setDdeLtot(eltPersistCaste.DdeLtot);
- eltMetier.setDdeSact(eltPersistCaste.DdeSact);
- eltMetier.setDdeStot(eltPersistCaste.DdeStot);
- eltMetier.setDdeDact(eltPersistCaste.DdeDact);
- eltMetier.setDdeDtot(eltPersistCaste.DdeDtot);
- metier.setOrdResSectionProfil(eltMetier);
+ } else if (eltPersist instanceof OrdResSectionIdem) {
- } else if (eltPersist instanceof SectionIdemPersist) {
+ // final SectionIdemPersist eltPersistCaste = (SectionIdemPersist) eltPersist;
+ // final OrdResSectionIdem eltMetier = new OrdResSectionIdem();
+ // eltMetier.setDdeQ(eltPersistCaste.DdeQ);
+ // eltMetier.setDdeZ(eltPersistCaste.DdeZ);
+ metier.setOrdResSectionIdem((OrdResSectionIdem) eltPersist.clone());
- final SectionIdemPersist eltPersistCaste = (SectionIdemPersist) eltPersist;
- final OrdResSectionIdem eltMetier = new OrdResSectionIdem();
- eltMetier.setDdeQ(eltPersistCaste.DdeQ);
- eltMetier.setDdeZ(eltPersistCaste.DdeZ);
- metier.setOrdResSectionIdem(eltMetier);
+ } else if (eltPersist instanceof OrdResSectionInterpolee) {
+ //
+ // final SectionInterpoleePersist eltPersistCaste = (SectionInterpoleePersist) eltPersist;
+ // final OrdResSectionInterpolee eltMetier = new OrdResSectionInterpolee();
+ // eltMetier.setDdeQ(eltPersistCaste.DdeQ);
+ // eltMetier.setDdeZ(eltPersistCaste.DdeZ);
+ metier.setOrdResSectionInterpolee((OrdResSectionInterpolee) eltPersist.clone());
- } else if (eltPersist instanceof SectionInterpoleePersist) {
+ } else if (eltPersist instanceof OrdResSectionSansGeometrie) {
- final SectionInterpoleePersist eltPersistCaste = (SectionInterpoleePersist) eltPersist;
- final OrdResSectionInterpolee eltMetier = new OrdResSectionInterpolee();
- eltMetier.setDdeQ(eltPersistCaste.DdeQ);
- eltMetier.setDdeZ(eltPersistCaste.DdeZ);
- metier.setOrdResSectionInterpolee(eltMetier);
-
- } else if (eltPersist instanceof SectionSansGeometriePersist) {
-
- final SectionSansGeometriePersist eltPersistCaste = (SectionSansGeometriePersist) eltPersist;
- final OrdResSectionSansGeometrie eltMetier = new OrdResSectionSansGeometrie();
- eltMetier.setDdeQ(eltPersistCaste.DdeQ);
- eltMetier.setDdeZ(eltPersistCaste.DdeZ);
- metier.setOrdResSectionSansGeometrie(eltMetier);
+ // final SectionSansGeometriePersist eltPersistCaste = (SectionSansGeometriePersist) eltPersist;
+ // final OrdResSectionSansGeometrie eltMetier = new OrdResSectionSansGeometrie();
+ // eltMetier.setDdeQ(eltPersistCaste.DdeQ);
+ // eltMetier.setDdeZ(eltPersistCaste.DdeZ);
+ metier.setOrdResSectionSansGeometrie((OrdResSectionSansGeometrie) eltPersist.clone());
+ }
}
}
- }
- // Branches
- if (dao.OrdResBranches == null || dao.OrdResBranches.size() == 0) {
- CrueHelper.emhEmpty("Branches", analyser);
- } else {
- for (final BrancheAbstractPersist eltPersist : dao.OrdResBranches) {
- if (eltPersist instanceof BranchePdcPersist) {
+ // Branches
+ if (dao.OrdResBranches == null || dao.OrdResBranches.size() == 0) {
+ CrueHelper.emhEmpty("Branches", analyser);
+ } else {
+ for (final OrdRes eltPersist : dao.OrdResBranches) {
+ if (eltPersist instanceof OrdResBranchePdc) {
- final BranchePdcPersist eltPersistCaste = (BranchePdcPersist) eltPersist;
- final OrdResBranchePdc eltMetier = new OrdResBranchePdc();
- eltMetier.setDdeDz(eltPersistCaste.DdeDz);
- metier.setOrdResBranchePdc(eltMetier);
+ // final BranchePdcPersist eltPersistCaste = (BranchePdcPersist) eltPersist;
+ // final OrdResBranchePdc eltMetier = new OrdResBranchePdc();
+ // eltMetier.setDdeDz(eltPersistCaste.DdeDz);
+ metier.setOrdResBranchePdc((OrdResBranchePdc) eltPersist.clone());
- } else if (eltPersist instanceof BrancheSeuilTransversalPersist) {
+ } else if (eltPersist instanceof OrdResBrancheSeuilTransversal) {
- final BrancheSeuilTransversalPersist eltPersistCaste = (BrancheSeuilTransversalPersist) eltPersist;
- final OrdResBrancheSeuilTransversal eltMetier = new OrdResBrancheSeuilTransversal();
- eltMetier.setDdeRegime(eltPersistCaste.DdeRegime);
- metier.setOrdResBrancheSeuilTransversal(eltMetier);
+ // final BrancheSeuilTransversalPersist eltPersistCaste = (BrancheSeuilTransversalPersist) eltPersist;
+ // final OrdResBrancheSeuilTransversal eltMetier = new OrdResBrancheSeuilTransversal();
+ // eltMetier.setDdeRegime(eltPersistCaste.DdeRegime);
+ metier.setOrdResBrancheSeuilTransversal((OrdResBrancheSeuilTransversal) eltPersist);
- } else if (eltPersist instanceof BrancheSeuilLateralPersist) {
+ } else if (eltPersist instanceof OrdRes...
[truncated message content] |
|
From: <de...@us...> - 2010-03-14 20:54:47
|
Revision: 5716
http://fudaa.svn.sourceforge.net/fudaa/?rev=5716&view=rev
Author: deniger
Date: 2010-03-14 20:54:39 +0000 (Sun, 14 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumRegime.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBranchePdc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSaintVenant.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilLateral.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilTransversal.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheStrickler.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResNoeudNiveauContinu.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionSansGeometrie.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalNoeudNiveauContinu.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/ConfigLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderConfigLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/EnumExtrapolation.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateModeleScenarioWithSchema.java
trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/default.ores.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/configLoi-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-dclm-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-ores-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueORESFile.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.ores.xml
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ValidatorXml.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.ores.xml.in
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.ores.xml.out
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3bis.ores.xml
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/test/AppCrueTest.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/test/MainTest.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/test/java/
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueHelper.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -166,4 +166,9 @@
return true;
}
+ /**
+ * entete xml a mettre devant chaque fichier.
+ */
+ public static final String ENTETE_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/CrueXmlReaderWriterImpl.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -362,7 +362,7 @@
boolean isOk = true;
try {
final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
- writer.write(ValidatorXml.enteteXml + "\n");
+ writer.write(CrueHelper.ENTETE_XML + "\n");
if (dao.Commentaire == null) {
dao.Commentaire = StringUtils.EMPTY;
}
Deleted: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ValidatorXml.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ValidatorXml.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/dao/ValidatorXml.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -1,121 +0,0 @@
-package org.fudaa.dodico.crue.io.dao;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import com.memoire.fu.FuLogCrue;
-
-import org.fudaa.ctulu.CtuluAnalyze;
-import org.fudaa.ctulu.CtuluLibFile;
-
-/**
- * Classe validator xml qui utilise les xsd pour v�rifier que le fichier est valide.
- *
- * @author Adrien Hadoux
- */
-public class ValidatorXml {
-
- static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
- static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
- static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
-
- /**
- * entete xml a mettre devant chaque fichier.
- */
- public static final String enteteXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
-
- /**
- * Initialise le validator avec els infos et le bon fichier xsd
- *
- * @param factory
- * @param xsdFile
- */
- public static void initXmlValidator(final DocumentBuilderFactory factory, final String xsdFile) {
- factory.setIgnoringComments(true);
- factory.setNamespaceAware(true);
- factory.setValidating(true);
- factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
- final File fichier = ValidatorXml.getFile(xsdFile);
-
- factory.setAttribute(JAXP_SCHEMA_SOURCE, fichier);
- }
-
- /**
- * recupere la bonne xsd
- *
- * @param fileName
- * @return
- */
- public static File getFile(final String fileName) {
- File file = null;
- final URL url = ValidatorXml.class.getResource("/xsd/" + fileName);
- try {
- file = new File(url.toURI());
- } catch (final URISyntaxException e) {}
- return file;
- }
-
- public static boolean validXMLWithDOMFromResource(final String xmlAbsoluteResource, final String xsdFile,
- final CtuluAnalyze analyzer) {
- InputStream in = null;
- boolean res = false;
- try {
- in = ValidatorXml.class.getResourceAsStream(xmlAbsoluteResource);
- res = validXMLWithDOM(in, xsdFile, analyzer);
- } finally {
- CtuluLibFile.close(in);
- }
- return res;
-
- }
-
- public static boolean validXMLWithDOMFromFile(final File xmlFile, final String xsdFile, final CtuluAnalyze analyzer) {
- InputStream in = null;
- boolean res = false;
- try {
- in = new FileInputStream(xmlFile);
- res = validXMLWithDOM(in, xsdFile, analyzer);
- } catch (final FileNotFoundException e) {
- FuLogCrue.error(e);
- } finally {
- CtuluLibFile.close(in);
- }
- return res;
-
- }
-
- /**
- * Realise la validation avec le bon fichier xsd
- *
- * @param xmlFile
- * @param xsdFile
- * @return true si valide
- */
- public static boolean validXMLWithDOM(final InputStream xmlFile, final String xsdFile, final CtuluAnalyze analyzer) {
-
- final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- // -- on init la factory DOM --//
- ValidatorXml.initXmlValidator(dbf, xsdFile);
- final ErrorHandlerDefault eh = new ErrorHandlerDefault(analyzer);
- try {
- // Parsage du fichier XML avec DOM
- final DocumentBuilder db = dbf.newDocumentBuilder();
-
- db.setErrorHandler(eh);
- db.parse(xmlFile);
- } catch (final Exception pcee) {
- FuLogCrue.debug(pcee.getMessage());
- analyzer.addWarn(pcee.getMessage());
- return false;
- }
- return !eh.isHasError();
- }
-
-}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -222,6 +222,7 @@
protected ResCalcul createRes(EMH emhDest) {
ResCalCasierProfil res = new ResCalCasierProfil();
res.setSplan(scas);
+ res.setQech(qcas);
res.setVol(vcas);
return res;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumRegime.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumRegime.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumRegime.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -10,5 +10,5 @@
* @pdOid c389a53c-7af0-4821-95eb-4f6ea52c0736
*/
public enum EnumRegime {
- NSU_NOY, NSU_DEN, SUB_NOY, SUB_DEN
+ NSU_NOY, NSU_DEN
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,7 +6,7 @@
/** @pdOid 6b5fbcd0-2b44-4569-bbae-d6ded0706da9 */
public class OrdResBrancheOrifice extends OrdRes {
-
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 59923a77-ac99-4c9f-9e65-2f3e49513ef6 */
private boolean ddeCoefCtr;
// private boolean ddeOuv;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBranchePdc.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBranchePdc.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBranchePdc.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,7 +6,7 @@
/** @pdOid 130a2724-0a23-4da3-859b-3622c6586929 */
public class OrdResBranchePdc extends OrdRes {
-
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 39014fa8-4827-41ec-b807-c2abacf2f274 */
private boolean ddeDz;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSaintVenant.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSaintVenant.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSaintVenant.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,6 +6,7 @@
/** @pdOid 649a08a7-473d-4b64-9b59-1a967d281e98 */
public class OrdResBrancheSaintVenant extends OrdRes {
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 903ad363-0eb3-4a89-8ce4-382b31b2eab2 */
private boolean ddeQlat;
/** @pdOid 32fec507-0ab0-46d6-9a32-f90eb5eb7a41 */
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilLateral.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilLateral.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilLateral.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,6 +6,7 @@
/** @pdOid 7c8355bb-15ba-4908-a191-c16de71a9da8 */
public class OrdResBrancheSeuilLateral extends OrdRes {
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 3cd641fc-8426-4d45-8059-0dd9f35bdf35 */
private boolean ddeRegime;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilTransversal.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilTransversal.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheSeuilTransversal.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,6 +6,7 @@
/** @pdOid b2d49ad7-9e21-4caa-8801-9de2238c5164 */
public class OrdResBrancheSeuilTransversal extends OrdRes {
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 0b61d9d8-27d2-45e4-944c-239c1e09e92e */
private boolean ddeRegime;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheStrickler.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheStrickler.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheStrickler.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,6 +6,7 @@
/** @pdOid df067a22-9c98-463e-823f-860b251124f9 */
public class OrdResBrancheStrickler extends OrdRes {
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid e8323bb6-a01b-4ad8-b6a0-5639b287519f */
private boolean ddeSplan;
/** @pdOid 89033f60-e9fc-423b-8624-4251f3087217 */
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -4,10 +4,12 @@
package org.fudaa.dodico.crue.metier.emh;
+// WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 01ffbfed-95f5-4a76-b0f5-9c52ca9c745e */
public class OrdResCasierProfil extends OrdRes {
/** @pdOid 82809ac1-081a-48a5-86bb-5e66e55226d4 */
private boolean ddeSplan;
+ private boolean ddeQech;
/** @pdOid 7c1dbf13-c9b2-4ce1-baaf-11be633338af */
private boolean ddeVol;
@@ -16,6 +18,13 @@
return ddeSplan;
}
+ /**
+ * @return the ddeQech
+ */
+ public boolean getDdeQech() {
+ return ddeQech;
+ }
+
/** @pdOid c404fa49-9d73-402f-b82f-bbdf643ef977 */
public final boolean getDdeVol() {
return ddeVol;
@@ -30,6 +39,13 @@
}
/**
+ * @param ddeQech the ddeQech to set
+ */
+ public void setDdeQech(boolean ddeQech) {
+ this.ddeQech = ddeQech;
+ }
+
+ /**
* @param newDdeVol
* @pdOid c664f6fa-3ff4-466a-a0e3-ffad3acb0e50
*/
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResNoeudNiveauContinu.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResNoeudNiveauContinu.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResNoeudNiveauContinu.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,45 +6,16 @@
/** @pdOid 9200fcb9-6e44-4dbc-a030-fc7bcbcc1f3d */
public class OrdResNoeudNiveauContinu extends OrdRes {
- /** @pdOid 6f1a02a4-060f-4946-b0db-cd1e520fb7fd */
- private boolean ddeHmax;
- /** @pdOid eb840c4e-284c-44bd-af16-bb80a7014406 */
- private boolean ddeHmin;
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 4d69ff39-8444-46c0-8d72-ce4f5f961b12 */
private boolean ddeZ;
- /** @pdOid 2ede9039-513d-4163-bc9f-01ce7fdd7d3f */
- public final boolean getDdeHmax() {
- return ddeHmax;
- }
-
- /** @pdOid 27772448-252b-485c-81bd-b48a56b03a5a */
- public final boolean getDdeHmin() {
- return ddeHmin;
- }
-
/** @pdOid ed8fd122-db33-4d6e-95fc-429c877afd50 */
public final boolean getDdeZ() {
return ddeZ;
}
/**
- * @param newDdeHmax
- * @pdOid 5dcd0129-b067-4397-9091-87e829e9e918
- */
- public final void setDdeHmax(boolean newDdeHmax) {
- ddeHmax = newDdeHmax;
- }
-
- /**
- * @param newDdeHmin
- * @pdOid 5f0d3936-f258-4da8-a76b-78d77a99657f
- */
- public final void setDdeHmin(boolean newDdeHmin) {
- ddeHmin = newDdeHmin;
- }
-
- /**
* @param newDdeZ
* @pdOid aa41ef6d-e3b0-42fe-978d-0df287ebda16
*/
@@ -54,7 +25,7 @@
@Override
public String toString() {
- return "OrdResNoeudNiveauContinu [ddeHmax=" + ddeHmax + ", ddeHmin=" + ddeHmin + ", ddeZ=" + ddeZ + "]";
+ return "OrdResNoeudNiveauContinu [ddeZ=" + ddeZ + "]";
}
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,6 +6,7 @@
/** @pdOid d108c2a4-499a-4655-a4e7-d92059493fb0 */
public class OrdResSectionIdem extends OrdRes {
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
private boolean ddeDact;
private boolean ddeDtot;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,6 +6,7 @@
/** @pdOid ff4bcde2-1f8e-464d-bfc6-94c0a84eb3d8 */
public class OrdResSectionInterpolee extends OrdRes {
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
private boolean ddeDact;
private boolean ddeDtot;
private boolean ddeFr;
@@ -266,12 +267,14 @@
public void setDdeY(boolean ddeY) {
this.ddeY = ddeY;
}
+
/**
* @param ddeYc the ddeYc to set
*/
public void setDdeYc(boolean ddeYc) {
this.ddeYc = ddeYc;
}
+
/**
* @param ddeYn the ddeYn to set
*/
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -6,6 +6,7 @@
/** @pdOid 2c4a1ee2-abf2-4ebb-bb62-dbe3241a1493 */
public class OrdResSectionProfil extends OrdRes {
+ // WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 26bb6536-e256-4dc3-96c5-4b959d514849 */
private boolean ddeDact;
/** @pdOid 2d5f5120-cd27-41bd-ab32-bb9d7519a296 */
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionSansGeometrie.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionSansGeometrie.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionSansGeometrie.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -5,6 +5,7 @@
package org.fudaa.dodico.crue.metier.emh;
/** @pdOid f0aa719d-d63c-42d0-aebb-1238a5a0af94 */
+// WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
public class OrdResSectionSansGeometrie extends OrdRes {
private boolean ddeDact;
private boolean ddeDtot;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalCasierProfil.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalCasierProfil.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalCasierProfil.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -5,21 +5,37 @@
*/
public class ResCalCasierProfil extends ResCalcul {
+ private double qech;
private double splan;
+
private double vol;
+ /**
+ * @return the qech
+ */
+ public double getQech() {
+ return qech;
+ }
+
public double getSplan() {
return splan;
}
+ public double getVol() {
+ return vol;
+ }
+
+ /**
+ * @param qech the qech to set
+ */
+ public void setQech(double qech) {
+ this.qech = qech;
+ }
+
public void setSplan(double sPlan) {
this.splan = sPlan;
}
- public double getVol() {
- return vol;
- }
-
public void setVol(double vol) {
this.vol = vol;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalNoeudNiveauContinu.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalNoeudNiveauContinu.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalNoeudNiveauContinu.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -1,31 +1,22 @@
package org.fudaa.dodico.crue.metier.emh;
+/**
+ * @author deniger
+ */
public class ResCalNoeudNiveauContinu extends ResCalcul {
- private double hmax;
- private double hmin;
private double z;
- public double getHmax() {
- return hmax;
- }
-
- public double getHmin() {
- return hmin;
- }
-
+ /**
+ * @return
+ */
public double getZ() {
return z;
}
- public void setHmax(double hmax) {
- this.hmax = hmax;
- }
-
- public void setHmin(double hmin) {
- this.hmin = hmin;
- }
-
+ /**
+ * @param z
+ */
public void setZ(double z) {
this.z = z;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/ConfigLoi.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/ConfigLoi.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/ConfigLoi.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -1,10 +1,15 @@
package org.fudaa.dodico.crue.property;
+import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
+/**
+ * @author deniger
+ */
public class ConfigLoi {
final EnumTypeLoi typeLoi;
+ final String commentaire;
final EnumExtrapolation extrapolInf;
final EnumExtrapolation extrapolSup;
@@ -19,9 +24,10 @@
* @param varOrdonnee
*/
public ConfigLoi(EnumTypeLoi typeLoi, EnumExtrapolation extrapolInf, EnumExtrapolation extrapolSub,
- PropertyDefinition varAbscisse, PropertyDefinition varOrdonnee) {
+ PropertyDefinition varAbscisse, PropertyDefinition varOrdonnee, String commentaire) {
super();
this.typeLoi = typeLoi;
+ this.commentaire = StringUtils.defaultString(commentaire);
this.extrapolInf = extrapolInf == null ? EnumExtrapolation.ValCst : extrapolInf;
this.extrapolSup = extrapolSub == null ? EnumExtrapolation.ValCst : extrapolSub;
this.varAbscisse = varAbscisse;
@@ -29,7 +35,7 @@
}
public ConfigLoi(EnumTypeLoi typeLoi, PropertyDefinition varAbscisse, PropertyDefinition varOrdonnee) {
- this(typeLoi, null, null, varAbscisse, varOrdonnee);
+ this(typeLoi, null, null, varAbscisse, varOrdonnee, null);
}
public EnumExtrapolation getExtrapolInf() {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderConfigLoi.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderConfigLoi.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueLoaderConfigLoi.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -51,6 +51,7 @@
protected static class DaoConfigLoi {
String Type;
+ String Commentaire;
String ExtrapolInf;
String ExtrapolSup;
String VarAbscisse;
@@ -173,7 +174,7 @@
error = true;
}
if (!error) {
- data.add(new ConfigLoi(typeLoi, extrapolInf, extrapolSup, varAbs, varOrd));
+ data.add(new ConfigLoi(typeLoi, extrapolInf, extrapolSup, varAbs, varOrd, confLoi.Commentaire));
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/EnumExtrapolation.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/EnumExtrapolation.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/EnumExtrapolation.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -1,5 +1,8 @@
package org.fudaa.dodico.crue.property;
+/**
+ * @author deniger
+ */
public enum EnumExtrapolation {
- ValCst, None
+ ValCst, ValInterpol, Aucune
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateModeleScenarioWithSchema.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateModeleScenarioWithSchema.java 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidateModeleScenarioWithSchema.java 2010-03-14 20:54:39 UTC (rev 5716)
@@ -142,9 +142,8 @@
map.put(e.getSystemId(), analyze);
}
- e.printStackTrace();
- analyze.addErrorFromFile(CommonMessages.RESOURCE_BUNDLE.getString("valid.line") + " " + e.getLineNumber()
- + ": " + msg, e.getLineNumber());
+ analyze.addFatalError(CommonMessages.RESOURCE_BUNDLE.getString("valid.line") + " " + e.getLineNumber() + ": "
+ + msg, e.getLineNumber());
// e.printStackTrace();
}
@@ -154,14 +153,8 @@
}
@Override
- public void warning(final SAXParseException e) throws SAXException {
- // e.printStackTrace();
- }
+ public void warning(final SAXParseException e) throws SAXException {}
};
- // final Validator validator = schema.newValidator();
- // // validator.s
- // // SAXSource source = new SAXSource(new InputSource(xml.toString()));
- // // validator.validate(source);
final SAXParserFactory parser = SAXParserFactory.newInstance();
// parser.setSchema(schema);
parser.setNamespaceAware(true);
Modified: trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml 2010-03-14 19:43:24 UTC (rev 5715)
+++ trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml 2010-03-14 20:54:39 UTC (rev 5716)
@@ -1,145 +1,214 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ConfigLois xmlns="http://www.fudaa.fr/xsd/crue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.fudaa.fr/xsd/crue http://www.fudaa.fr/xsd/crue/configLoi-1.0.0.xsd">
+<ConfigLois xmlns="http://www.fudaa.fr/xsd/crue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.fudaa.fr/xsd/crue http://www.fudaa.fr/xsd/crue/configLoi-1.0.0.xsd">
<ConfigLoi>
<Type>Fk</Type>
+ <Commentaire>Frottement donné en Strickler</Commentaire>
<ExtrapolInf>ValCst</ExtrapolInf>
<ExtrapolSup>ValCst</ExtrapolSup>
<VarAbscisse>Z</VarAbscisse>
<VarOrdonnee>K</VarOrdonnee>
</ConfigLoi>
- <!-- frottement Fn -->
<ConfigLoi>
<Type>Fn</Type>
+ <Commentaire>Frottement donné en Manning</Commentaire>
+ <ExtrapolInf>ValCst</ExtrapolInf>
+ <ExtrapolSup>ValCst</ExtrapolSup>
<VarAbscisse>Z<...
[truncated message content] |
|
From: <de...@us...> - 2010-03-14 23:46:26
|
Revision: 5717
http://fudaa.svn.sourceforge.net/fudaa/?rev=5717&view=rev
Author: deniger
Date: 2010-03-14 23:46:20 +0000 (Sun, 14 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrueBinaryFileFormat.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrueBinaryReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPerm.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcTrans.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/LitNumerote.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcScenario.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalcul.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/DelegateValidatorEMHContentRelations.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/ValidatorForCrue9Export.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/io/ioMessages.properties
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
Added Paths:
-----------
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/metier/emh/TestResCal.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -417,12 +417,13 @@
}
/**
- * Ajoute tous les canaux de l'analyse passee en parametres. Les pointeurs sont copi�es.
+ * Ajoute tous les canaux de l'analyse passee en parametres. Les pointeurs sont copiees.
*
* @param _analyze l'analyse a ajouter a celle-ci
*/
public void merge(final CtuluAnalyze _analyze) {
setDesc(_analyze.getDesc());
+ setDefaultResourceBundle(_analyze.getDefaultResourceBundle());
setResource(_analyze.getResource());
logs.addAll(_analyze.logs);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -1,6 +1,5 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.io;
@@ -124,7 +123,7 @@
}
public boolean writeMetier(final CrueIOResu<CrueData> metier, final File f, final CtuluAnalyze analyzer) {
- analyzer.setDesc(f.getName());
+ analyzer.setDesc(IOMessages.getString("write.file", f.getName()));
final AbstractCrue9Writer writer = createWriter();
writer.setFile(f);
final CtuluIOOperationSynthese operation = writer.write(metier);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrueBinaryFileFormat.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrueBinaryFileFormat.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrueBinaryFileFormat.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -1,6 +1,5 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.io;
@@ -53,6 +52,7 @@
public CrueIOResu<M> read(final File f, final CtuluAnalyze analyzer, final CrueData dataLinked) {
final AbstractCrueBinaryReader reader = createReader();
+ reader.setResourceBundle(analyzer.getDefaultResourceBundle());
reader.setDataLinked(dataLinked);
final CtuluIOOperationSynthese operation = reader.read(f, null);
CrueHelper.copyAnalyzer(analyzer, operation.getAnalyze());
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrueBinaryReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrueBinaryReader.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/AbstractCrueBinaryReader.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -40,7 +40,9 @@
@Override
public final void setFile(final File _f) {
file = _f;
- analyze_ = new CtuluAnalyze();
+ if (analyze_ == null) {
+ analyze_ = new CtuluAnalyze();
+ }
analyze_.setDesc(super.getOperationDescription(_f));
try {
in = new FileInputStream(file);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -67,6 +67,7 @@
import org.fudaa.dodico.crue.metier.emh.EnumPositionSection;
import org.fudaa.dodico.crue.metier.emh.EnumRegle;
import org.fudaa.dodico.crue.metier.emh.EnumSensOrifice;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeEMH;
import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
import org.fudaa.dodico.crue.metier.emh.LitNomme;
@@ -1525,7 +1526,8 @@
private LoiFF createLoiQDz(final String idBranche) {
LoiFF newLoi = new LoiFF();
- newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQDz));
+ // newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQDz));
+ newLoi.setNom(CruePrefix.addPrefixs(idBranche, EnumTypeLoi.LoiQDz, EnumTypeEMH.BRANCHE));
newLoi.setType(EnumTypeLoi.LoiQDz);
newLoi.setEvolutionFF(new EvolutionFF(new ArrayList<PtEvolutionFF>()));
// dataLinked.getLoiConteneur().addLois(newLoi);
@@ -1534,7 +1536,8 @@
private LoiFF createLoiQpilZam(final String idBranche) {
LoiFF newLoi = new LoiFF();
- newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQpilZam));
+ // newLoi.setNom(CruePrefix.changePrefix(idBranche, CruePrefix.P_BRANCHE, EnumTypeLoi.LoiQpilZam));
+ newLoi.setNom(CruePrefix.addPrefixs(idBranche, EnumTypeLoi.LoiQpilZam, EnumTypeEMH.BRANCHE));
newLoi.setType(EnumTypeLoi.LoiQpilZam);
newLoi.setEvolutionFF(new EvolutionFF(new ArrayList<PtEvolutionFF>()));
// dataLinked.getLoiConteneur().addLois(newLoi);
@@ -1543,7 +1546,7 @@
private LoiFF createLoiZavZam(final String idBranche) {
final LoiFF newLoi = new LoiFF();
- newLoi.setNom(CruePrefix.addPrefixIfNeeded(idBranche, EnumTypeLoi.LoiZavZam));
+ newLoi.setNom(CruePrefix.addPrefixs(idBranche, EnumTypeLoi.LoiZavZam, EnumTypeEMH.BRANCHE));
newLoi.setEvolutionFF(new EvolutionFF(new ArrayList<PtEvolutionFF>()));
newLoi.setType(EnumTypeLoi.LoiZavZam);
// dataLinked.getLoiConteneur().addLois(newLoi);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -63,6 +63,7 @@
import org.fudaa.dodico.crue.metier.emh.ElemPdt;
import org.fudaa.dodico.crue.metier.emh.EnumMethodeInterpolation;
import org.fudaa.dodico.crue.metier.emh.EnumSensOuv;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeEMH;
import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
import org.fudaa.dodico.crue.metier.emh.EnumVerbosite;
import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
@@ -1506,7 +1507,7 @@
final DonLoiHYConteneur dlhy = res.getLoiConteneur();
final List<EMHBrancheSaintVenant> branches = res.getBranchesSaintVenant();
- final String nomLoi = CruePrefix.addPrefixIfNeeded("1", EnumTypeLoi.LoiTQruis);
+ final String nomLoi = CruePrefix.addPrefixs("1", EnumTypeLoi.LoiTQruis, EnumTypeEMH.BRANCHE);
final LoiDF loiDF = new LoiDF();
LoiFactory.alimenteDebutLoiDF(loiDF, nomLoi, EnumTypeLoi.LoiTQruis);
loiDF.setEvolutionFF(evolutionFF);
@@ -1572,7 +1573,7 @@
if (nncTrans instanceof CalcTransNoeudNiveauContinuQapp) {
- nomLoi = CruePrefix.addPrefixIfNeeded(nomEmh, EnumTypeLoi.LoiTQapp);
+ nomLoi = CruePrefix.addPrefixs(nomEmh, EnumTypeLoi.LoiTQapp, EnumTypeEMH.NOEUD);
final Loi loi = LoiHelper.findByReference(nomLoi, dlhy.getLois());
if (loi == null) {
final LoiDF loiDF = new LoiDF();
@@ -1588,7 +1589,7 @@
} else if (nncTrans instanceof CalcTransNoeudNiveauContinuLimnigramme) {
- nomLoi = CruePrefix.addPrefixIfNeeded(nomEmh, EnumTypeLoi.LoiTZ);
+ nomLoi = CruePrefix.addPrefixs(nomEmh, EnumTypeLoi.LoiTZ, EnumTypeEMH.NOEUD);
final Loi loi = LoiHelper.findByReference(nomLoi, dlhy.getLois());
if (loi == null) {
final LoiDF loiDF = new LoiDF();
@@ -1604,7 +1605,7 @@
} else if (nncTrans instanceof CalcTransNoeudNiveauContinuTarage) {
- nomLoi = CruePrefix.addPrefixIfNeeded(nomEmh, EnumTypeLoi.LoiQZ);
+ nomLoi = CruePrefix.addPrefixs(nomEmh, EnumTypeLoi.LoiQZ, EnumTypeEMH.NOEUD);
final Loi loi = LoiHelper.findByReference(nomLoi, dlhy.getLois());
if (loi == null) {
final LoiFF loiFF = new LoiFF();
@@ -1639,7 +1640,7 @@
if (brancheOrManoeuvre.getNomCalculParent() != null
&& brancheOrManoeuvre.getNomCalculParent().equals(calcTrans.getNom())) {
- nomLoi = CruePrefix.addPrefix(nomEmh, EnumTypeLoi.LoiTOuv, brancheOrManoeuvre.getSensOuv());
+ nomLoi = CruePrefix.addPrefixs(nomEmh, EnumTypeLoi.LoiTOuv, EnumTypeEMH.BRANCHE);
final Loi loi = LoiHelper.findByReference(nomLoi, dlhy.getLois());
if (loi == null) {
final LoiDF loiDF = new LoiDF();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -26,7 +26,7 @@
@Override
protected FCBSequentialReader internalReadResu() throws IOException {
final FCBSequentialReader infos = new FCBSequentialReader(file);
- // le premier entier doit etre 800.
+ // le premier entier doit etre sizeTitre*10.
// cette premiere partie est un procede pour savoir si on est en little ou big endian.
// on sait que le premier entier doit etre 800; soit la longueur des 10 commentaires comportant
// 256 caractères.
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -11,6 +11,7 @@
import org.fudaa.dodico.crue.metier.emh.DonFrt;
import org.fudaa.dodico.crue.metier.emh.DonFrtStrickler;
import org.fudaa.dodico.crue.metier.emh.EnumLitPosition;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeEMH;
import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
import org.fudaa.dodico.crue.metier.emh.LoiFF;
import org.fudaa.dodico.crue.metier.emh.ResPrtData;
@@ -194,7 +195,8 @@
private static LoiFF getLoiFFDeZRPTG(final float[] abscissesZ, final float[] ordonnees, final String nomLoi,
final EnumTypeLoi type) {
- return LoiFactory.getLoiFFRPTG(abscissesZ, ordonnees, CruePrefix.addPrefixIfNeeded(nomLoi, type), type);
+ return LoiFactory.getLoiFFRPTG(abscissesZ, ordonnees, CruePrefix.addPrefixs(nomLoi, type, EnumTypeEMH.SECTION),
+ type);
}
/**
@@ -208,7 +210,7 @@
final ResPrtData data = new ResPrtData();
data.setData(ordonnees);
- data.setNom(CruePrefix.addPrefixIfNeeded(nomData, loi));
+ data.setNom(CruePrefix.addPrefixs(nomData, loi, EnumTypeEMH.SECTION));
return data;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/Calc.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -44,6 +44,8 @@
return id;
}
+ public abstract boolean isUsed(CalcPseudoPermItem item);
+
/**
* @param newNom
* @pdOid 8c14d9ec-55e6-4022-aa1c-6db8de2aaac5
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPerm.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPerm.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcPseudoPerm.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -1,7 +1,5 @@
/***********************************************************************
- * Module: CalcPseudoPerm.java
- * Author: deniger
- * Purpose: Defines the Class CalcPseudoPerm
+ * Module: CalcPseudoPerm.java Author: deniger Purpose: Defines the Class CalcPseudoPerm
***********************************************************************/
package org.fudaa.dodico.crue.metier.emh;
@@ -56,6 +54,15 @@
return res;
}
+ public boolean isUsed(CalcPseudoPermItem item) {
+ if (getCalcPseudoPermBrancheOrificeManoeuvre().contains(item)) { return true; }
+ if (getCalcPseudoPermBrancheSaintVenantQruis().contains(item)) { return true; }
+ if (getCalcPseudoPermCasierProfilQruis().contains(item)) { return true; }
+ if (getCalcPseudoPermNoeudNiveauContinuQapp().contains(item)) { return true; }
+ if (getCalcPseudoPermNoeudNiveauContinuZimpose().contains(item)) { return true; }
+ return false;
+ }
+
/** @pdGenerated default iterator getter */
public java.util.Iterator getIteratorCalcPseudoPermBrancheOrificeManoeuvre() {
if (calcPseudoPermBrancheOrificeManoeuvre == null) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcTrans.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcTrans.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CalcTrans.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -1,7 +1,5 @@
/***********************************************************************
- * Module: CalcTrans.java
- * Author: deniger
- * Purpose: Defines the Class CalcTrans
+ * Module: CalcTrans.java Author: deniger Purpose: Defines the Class CalcTrans
***********************************************************************/
package org.fudaa.dodico.crue.metier.emh;
@@ -54,6 +52,18 @@
return res;
}
+ @Override
+ public boolean isUsed(CalcPseudoPermItem item) {
+ if (getCalcTransBrancheOrificeManoeuvre().contains(item)) { return true; }
+ if (getCalcTransBrancheSaintVenantQruis().contains(item)) { return true; }
+ if (getCalcTransCasierProfilQruis().contains(item)) { return true; }
+ if (getCalcTransNoeudNiveauContinuLimnigramme().contains(item)) { return true; }
+ if (getCalcTransNoeudNiveauContinuQapp().contains(item)) { return true; }
+ if (getCalcTransNoeudNiveauContinuTarage().contains(item)) { return true; }
+ return false;
+
+ }
+
/** @pdGenerated default getter */
public java.util.Collection<CalcTransBrancheOrificeManoeuvre> getCalcTransBrancheOrificeManoeuvre() {
if (calcTransBrancheOrificeManoeuvre == null) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -1,5 +1,8 @@
package org.fudaa.dodico.crue.metier.emh;
+import java.util.HashSet;
+import java.util.Set;
+
/** @pdOid 1d6a1d10-07d3-4240-bc8e-bfd128f024fc */
public abstract class DonFrt implements ObjetNomme {
/** @pdOid e7467b8c-41bd-4ab3-8353-e40fa95b3a51 */
@@ -20,6 +23,25 @@
return nom;
}
+ private Set<LitNumerote> users;
+
+ public void register(LitNumerote user) {
+ if (users == null) {
+ users = new HashSet<LitNumerote>();
+ }
+ users.add(user);
+ }
+
+ public void unregister(LitNumerote litNumerote) {
+ if (litNumerote != null) {
+ users.remove(litNumerote);
+ }
+ }
+
+ public boolean getUsed() {
+ return users != null && !users.isEmpty();
+ }
+
/**
* @param newNom
* @pdOid 7cfc0494-2ac8-4d3e-9dde-924339296844
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/LitNumerote.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/LitNumerote.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/LitNumerote.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -75,7 +75,13 @@
* @param newDonFrt
*/
public void setFrot(DonFrt newDonFrt) {
+ if (frot != null) {
+ frot.unregister(this);
+ }
this.frot = newDonFrt;
+ if (frot != null) {
+ frot.register(this);
+ }
}
/** @pdOid 5bc12552-3b39-449f-b54a-8affa84fa3cf */
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcScenario.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcScenario.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdCalcScenario.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -17,6 +17,13 @@
return EnumInfosEMH.ORD_CALC_SCENARIO;
}
+ public final boolean isUsed(Calc calc) {
+ for (OrdCalc c : getOrdCalc()) {
+ if (c.getCalc() == calc) { return true; }
+ }
+ return false;
+ }
+
/** @pdGenerated default getter */
public java.util.List<OrdCalc> getOrdCalc() {
if (ordCalc == null) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalcul.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalcul.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResCalcul.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -1,8 +1,103 @@
package org.fudaa.dodico.crue.metier.emh;
+import java.beans.PropertyDescriptor;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.StringUtils;
+
/**
* @author deniger
*/
public abstract class ResCalcul {
+ public static boolean isVisible(Class resClass, String prop, OrdResScenario ordRes) {
+
+ // ordRes.getOrdResBrancheBarrageFilEau()
+ try {
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+ public static Map<String, Boolean> retrieveOrdres(Class resClass, OrdResScenario ordRes) {
+ String thisName = resClass.getSimpleName();
+ String method = StringUtils.replaceOnce(thisName, "ResCal", "ordRes");
+ try {
+ OrdRes property = (OrdRes) PropertyUtils.getProperty(ordRes, method);
+ PropertyDescriptor[] describe = PropertyUtils.getPropertyDescriptors(resClass);
+ Map<String, Boolean> res = new HashMap<String, Boolean>();
+ for (int i = 0; i < describe.length; i++) {
+
+ PropertyDescriptor propertyDescriptor = describe[i];
+ String name = propertyDescriptor.getName();
+ if ("class".equals(name)) {
+ continue;
+ }
+ if (property == null) {
+ res.put(name, Boolean.FALSE);
+ } else {
+ String propInOrd = "dde" + StringUtils.capitalize(name);
+ propInOrd = StringUtils.removeEnd(propInOrd, "Min");
+ propInOrd = StringUtils.removeEnd(propInOrd, "Maj");
+ propInOrd = StringUtils.removeEnd(propInOrd, "Sto");
+ try {
+ res.put(name, ((Boolean) PropertyUtils.getProperty(property, propInOrd)).booleanValue());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return res;
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ }
+ return Collections.emptyMap();
+
+ }
+
+ public static Set<String> getOrdresProps(Class resClass, OrdResScenario ordRes) {
+ String thisName = resClass.getSimpleName();
+ String method = StringUtils.replaceOnce(thisName, "ResCal", "ordRes");
+ try {
+ OrdRes property = (OrdRes) PropertyUtils.getProperty(ordRes, method);
+ PropertyDescriptor[] describe = PropertyUtils.getPropertyDescriptors(resClass);
+ Set<String> res = new HashSet<String>();
+ for (int i = 0; i < describe.length; i++) {
+
+ PropertyDescriptor propertyDescriptor = describe[i];
+ String name = propertyDescriptor.getName();
+ if ("class".equals(name)) {
+ continue;
+ }
+ if (property != null) {
+ String propInOrd = "dde" + StringUtils.capitalize(name);
+ propInOrd = StringUtils.removeEnd(propInOrd, "Min");
+ propInOrd = StringUtils.removeEnd(propInOrd, "Maj");
+ propInOrd = StringUtils.removeEnd(propInOrd, "Sto");
+ try {
+ boolean value = ((Boolean) PropertyUtils.getProperty(property, propInOrd)).booleanValue();
+ if (value) {
+ res.add(name);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return res;
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ }
+ return Collections.emptySet();
+
+ }
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/FactoryEMH.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -9,7 +9,6 @@
import java.util.List;
import java.util.Locale;
-import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.io.common.CrueData;
import org.fudaa.dodico.crue.metier.emh.CatEMHBranche;
import org.fudaa.dodico.crue.metier.emh.CatEMHCasier;
@@ -24,6 +23,7 @@
import org.fudaa.dodico.crue.metier.emh.EMHSectionInterpolee;
import org.fudaa.dodico.crue.metier.emh.EMHSectionSansGeometrie;
import org.fudaa.dodico.crue.metier.emh.EnumPositionSection;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeEMH;
import org.fudaa.dodico.crue.metier.emh.EnumTypeLoi;
import org.fudaa.dodico.crue.metier.emh.EvolutionFF;
import org.fudaa.dodico.crue.metier.emh.LoiFF;
@@ -115,18 +115,17 @@
final List<PtEvolutionFF> listePoints = new ArrayList<PtEvolutionFF>();
listeEvolution.setPtEvolutionFF(listePoints);
final LoiFF newLoi = new LoiFF();
- final String brancheNom = getBrancheNomWithoutPrefix(idBranche);
- newLoi.setNom(CruePrefix.addPrefixIfNeeded(brancheNom, EnumTypeLoi.LoiQPdc));
+ newLoi.setNom(CruePrefix.addPrefixs(idBranche, EnumTypeLoi.LoiQPdc, EnumTypeEMH.BRANCHE));
newLoi.setEvolutionFF(listeEvolution);
newLoi.setType(EnumTypeLoi.LoiQPdc);
dataDCSP.setLoiQPdc(newLoi);
return dataDCSP;
}
- public static String getBrancheNomWithoutPrefix(final String idBranche) {
- return idBranche.startsWith(CruePrefix.P_BRANCHE) ? StringUtils.substringAfter(idBranche, CruePrefix.P_BRANCHE)
- : idBranche;
- }
+ // public static String getBrancheNomWithoutPrefix(final String idBranche) {
+ // return idBranche.startsWith(CruePrefix.P_BRANCHE) ? StringUtils.substringAfter(idBranche, CruePrefix.P_BRANCHE)
+ // : idBranche;
+ // }
public static OrdPrtCIniModeleBase createOPTI() {
return new OrdPrtCIniModeleBase();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioExporterCrue9.java 2010-03-14 23:46:20 UTC (rev 5717)
@@ -1,10 +1,12 @@
package org.fudaa.dodico.crue.projet;
import java.io.File;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.ctulu.CtuluLibFile;
import org.fudaa.dodico.crue.common.CrueErrorManager;
@@ -14,7 +16,14 @@
import org.fudaa.dodico.crue.io.common.CrueFileType;
import org.fudaa.dodico.crue.io.common.IOMessages;
import org.fudaa.dodico.crue.metier.ManagerEMHScenario;
+import org.fudaa.dodico.crue.metier.emh.Calc;
+import org.fudaa.dodico.crue.metier.emh.CalcTrans;
import org.fudaa.dodico.crue.metier.emh.CatEMHActivable;
+import org.fudaa.dodico.crue.metier.emh.DonCLimMScenario;
+import org.fudaa.dodico.crue.metier.emh.DonLoiHYConteneur;
+import org.fudaa.dodico.crue.metier.emh.Loi;
+import org.fudaa.dodico.crue.metier.emh.OrdCalcScenario;
+import org.fudaa.dodico.crue.metier.helper.EMHHelper;
/**
* Exporte les données au format crue neuf. Il est possible de définir les formats à exporter.
@@ -51,6 +60,32 @@
CtuluAnalyze log = new CtuluAnalyze(IOMessages.RESOURCE_BUNDLE);
addWarn(crueData.getBranches(), log, "dc.brancheInactive");
addWarn(crueData.getCasiers(), log, "dc.casierInactive");
+
+ OrdCalcScenario ordCalc = crueData.getOrdCalc();
+ DonCLimMScenario conditionsLim = crueData.getConditionsLim();
+ List<String> unused = new ArrayList<String>();
+ for (Calc calc : conditionsLim.getCalc()) {
+ if (!ordCalc.isUsed(calc)) {
+ unused.add(calc.getId());
+ }
+ }
+ if (!unused.isEmpty()) {
+ log.addWarn("dh.dclm.unused", StringUtils.join(unused, ", "));
+ }
+ final List<CalcTrans> calcsTrans = EMHHelper.collectCalcTrans(ordCalc.getOrdCalc());
+ if (calcsTrans.size() > 1) {
+ log.addWarn("crue9.compatible.calcTransMoreThanOne");
+ }
+ DonLoiHYConteneur loiConteneur = crueData.getLoiConteneur();
+ unused.clear();
+ for (Loi loi : loiConteneur.getLois()) {
+ if (!loi.getUsed()) {
+ unused.add(loi.getId());
+ }
+ }
+ if (!unused.isEmpty()) {
+ log.addWarn("dh.loi.unused", StringUtils.join(unused, ", "));
+ }
if (!log.isEmpty()) {
log.setDesc(IOMessages.getString("io.test.inactif"));
error.addAnalyzer(log);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java 2010-03-14 20:54:39 UTC (rev 5716)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java 2010-0...
[truncated message content] |
|
From: <de...@us...> - 2010-03-30 21:27:33
|
Revision: 5735
http://fudaa.svn.sourceforge.net/fudaa/?rev=5735&view=rev
Author: deniger
Date: 2010-03-30 21:27:25 +0000 (Tue, 30 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionProfil.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionSansGeometrie.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueProperties.java
trunk/soft/fudaa-crue/dodico/src/main/resources/default.ores.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-ores-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueFCB.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHManagerBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/view/CrueFilleEMH.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -134,9 +134,9 @@
final int nbNd = bf.getInt();
- final List<FCBValueObject.EnteteNoeud> nds = new ArrayList<FCBValueObject.EnteteNoeud>(nbNd);
+ final List<FCBValueObject.EnteteCasier> nds = new ArrayList<FCBValueObject.EnteteCasier>(nbNd);
for (int i = 0; i < nbNd; i++) {
- final FCBValueObject.EnteteNoeud nd = new FCBValueObject.EnteteNoeud();
+ final FCBValueObject.EnteteCasier nd = new FCBValueObject.EnteteCasier();
nd.setNom(helper.getStingFromBuffer(16).trim());
nd.setNumProfil(bf.getInt() - 1);
nds.add(nd);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -254,10 +254,10 @@
}
- private class ResBuilderNoeud implements ResBuilder<FCBValueObject.ResNoeud> {
+ private class ResBuilderNoeud implements ResBuilder<FCBValueObject.ResCasier> {
- public FCBValueObject.ResNoeud createRes() {
- return new FCBValueObject.ResNoeud();
+ public FCBValueObject.ResCasier createRes() {
+ return new FCBValueObject.ResCasier();
}
public int getOffset(final int idxEnr) {
@@ -394,7 +394,7 @@
private EnteteContainer<FCBValueObject.EnteteBranche, FCBValueObject.ResBranche> containerBranches = EMPTY;
- private EnteteContainer<FCBValueObject.EnteteNoeud, FCBValueObject.ResNoeud> containerNoeuds = EMPTY;
+ private EnteteContainer<FCBValueObject.EnteteCasier, FCBValueObject.ResCasier> containerCasiers = EMPTY;
private ByteOrder order;
@@ -441,8 +441,8 @@
/**
* @return le container des noeuds.
*/
- public EnteteContainer<FCBValueObject.EnteteNoeud, FCBValueObject.ResNoeud> getContainerNoeuds() {
- return containerNoeuds;
+ public EnteteContainer<FCBValueObject.EnteteCasier, FCBValueObject.ResCasier> getContainerCasiers() {
+ return containerCasiers;
}
/**
@@ -463,7 +463,7 @@
* @return le nombre de noeuds
*/
public Object getNbNoeuds() {
- return containerNoeuds.getNbData();
+ return containerCasiers.getNbData();
}
/**
@@ -534,9 +534,9 @@
* @return le resultat. inout si non null
* @throws IOException si erreur de lecture
*/
- public FCBValueObject.ResNoeud getResultatNoeud(final int idxPdt, final String nomNoeud,
- final FCBValueObject.ResNoeud inout) throws IOException {
- return getResultat(idxPdt, nomNoeud, inout, containerNoeuds);
+ public FCBValueObject.ResCasier getResultatNoeud(final int idxPdt, final String nomNoeud,
+ final FCBValueObject.ResCasier inout) throws IOException {
+ return getResultat(idxPdt, nomNoeud, inout, containerCasiers);
}
@@ -572,9 +572,9 @@
* @return le resultat. inout si non null
* @throws IOException si erreur de lecture
*/
- public FCBValueObject.ResNoeud getResultatNoeud(final int idxPdt, final int nomNoeud,
- final FCBValueObject.ResNoeud inout) throws IOException {
- return getResultat(idxPdt, nomNoeud, inout, containerNoeuds);
+ public FCBValueObject.ResCasier getResultatNoeud(final int idxPdt, final int nomNoeud,
+ final FCBValueObject.ResCasier inout) throws IOException {
+ return getResultat(idxPdt, nomNoeud, inout, containerCasiers);
}
@@ -638,8 +638,8 @@
new ResBuilderBranche());
}
- protected void setNoeuds(final List<FCBValueObject.EnteteNoeud> noeuds) {
- this.containerNoeuds = new EnteteContainer<FCBValueObject.EnteteNoeud, FCBValueObject.ResNoeud>(noeuds,
+ protected void setNoeuds(final List<FCBValueObject.EnteteCasier> noeuds) {
+ this.containerCasiers = new EnteteContainer<FCBValueObject.EnteteCasier, FCBValueObject.ResCasier>(noeuds,
new ResBuilderNoeud());
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -152,7 +152,7 @@
res.setSplanMin(su1bra);
res.setSplanMaj(su2bra);
res.setSplanSto(su4bra);
- res.setVol(volbra);
+ res.setVol(volbra * 1E6);
return res;
}
@@ -194,7 +194,7 @@
* @creation 27 mai 2009
* @version
*/
- public static class ResNoeud extends AbstractRes {
+ public static class ResCasier extends AbstractRes {
/**
* débit résultant du casier ip
@@ -428,7 +428,7 @@
*
* @author Adrien Hadoux
*/
- public static class EnteteNoeud extends AbstractEntete {
+ public static class EnteteCasier extends AbstractEntete {
private int numProfil;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -109,8 +109,8 @@
// Calcul des abscisses z
final int nbHaut = donneesSection.getNbHaut();
- final float zmin = donneesSection.getZFond();
final float dzpro = donneesSection.getDZpro();
+ final float zmin = donneesSection.getZFond() + dzpro;
final float[] abscissesZ = new float[nbHaut];
for (int i = 0; i < nbHaut; i++) {
@@ -154,7 +154,7 @@
// Alimentation loi LsupDeLit
rptgSection.setLitLsup(getDataDeLitRPTG(sectionAutreBranche.getListeLargHaut(), nom, EnumTypeLoi.LstLitLsup));
// Alimentation loi KsupDeLit
- rptgSection.setLitKsup(getDataDeLitRPTG(sectionAutreBranche.getListeStriHaut(), nom, EnumTypeLoi.LstLitKsup));
+ rptgSection.setLstLitKsup(getDataDeLitRPTG(sectionAutreBranche.getListeStriHaut(), nom, EnumTypeLoi.LstLitKsup));
// Alimentation loi LinfDeLit
rptgSection.setLitLinf(getDataDeLitRPTG(sectionAutreBranche.getListeLargFond(), nom, EnumTypeLoi.LstLitLinf));
// Alimentation loi SsupDeLit
@@ -177,7 +177,7 @@
// }
}
litPos.setPositions(enums);
- rptgSection.setLitPos(litPos);
+ rptgSection.setLstLitPos(litPos);
}
}
return rptgSection;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -5,7 +5,6 @@
import gnu.trove.TObjectIntHashMap;
-import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@@ -50,7 +49,7 @@
data.nbLitMax = paramsGen.getNblitmax();
data.nbHaut = paramsGen.getNbhaut();
data.file = file;
-
+ // 49 + 2*Npo + (17 + 2*NbStr)*NbLitMax + 9*NbHaut
int longueurEnregistrement = 49 + 2 * data.npo + (17 + 2 * data.nbStr) * data.nbLitMax + 9 * data.nbHaut;
longueurEnregistrement = longueurEnregistrement * 4;
final int longueurEnregistrementSTO = dimension.getLReclProf() * 4;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -159,32 +159,22 @@
final DonneesSectionOuProfil donneesSection = new DonneesSectionOuProfil();
donneesSection.setNom(getStringFromBuffer(bf, 16).trim());
- // System.out.print("Nom = " + donneesSection.getNom() + " | ");
donneesSection.setType(getStringFromBuffer(bf, 8).trim());
- // System.out.print("Type = " + donneesSection.getType() + " | ");
final int nTypBra = bf.getInt();
donneesSection.setNTypBra(nTypBra);
- // System.out.print("NTypBra = " + donneesSection.getNTypBra() + " | ");
-
donneesSection.setProfRef(getStringFromBuffer(bf, 16).trim());
- // System.out.print("ProfRef = " + donneesSection.getProfRef() + " | ");
donneesSection.setDZref(bf.getFloat());
- // System.out.print("DZref = " + donneesSection.getDZref() + " | ");
donneesSection.setNomCasier(getStringFromBuffer(bf, 16).trim());
- // System.out.print("NomCasier = " + donneesSection.getNomCasier() + " | ");
donneesSection.setDistAppliProfCasier(bf.getFloat());
- // System.out.print("DistAppliProfCasier = " + donneesSection.getDistAppliProfCasier() + " | ");
final int nbLit = bf.getInt();
donneesSection.setNbLit(nbLit);
- // System.out.print("NbLit = " + donneesSection.getNbLit() + " | ");
final String[] typesLits = new String[nbLit];
for (int j = 0; j < nbLit; j++) {
typesLits[j] = getStringFromBuffer(bf, 8).trim();
- // System.out.print("typesLits[j] = " + typesLits[j] + " | ");
}
donneesSection.setTypesLits(typesLits);
// on ne lit pas le reste...
@@ -192,9 +182,7 @@
final String[] nomsLits = new String[nbLit];
for (int j = 0; j < nbLit; j++) {
-
nomsLits[j] = getStringFromBuffer(bf, 16).trim();
- // System.out.print("nomsLits[j] = " + nomsLits[j] + " | ");
}
donneesSection.setNomsLits(nomsLits);
// on ne lit pas le reste...
@@ -202,12 +190,9 @@
final float[] fondsLits = new float[nbLit];
for (int j = 0; j < nbLit; j++) {
-
fondsLits[j] = bf.getFloat();
- // System.out.print("fondsLits[j] = " + fondsLits[j] + " | ");
}
donneesSection.setZFondsLits(fondsLits);
- // on ne lit pas le reste...
skip(bf, 4 * (nbLitMax - nbLit));
final List<DonneesStricklerPourLitSection> stricklers = new ArrayList<DonneesStricklerPourLitSection>(nbLit);
@@ -216,19 +201,14 @@
final DonneesStricklerPourLitSection strickler = new DonneesStricklerPourLitSection();
strickler.setNom(getStringFromBuffer(bf, 16));
- // System.out.print("Strickler_Nom = " + strickler.getNom() + " | ");
strickler.setType(getStringFromBuffer(bf, 8));
- // System.out.print("Strickler_Type = " + strickler.getType() + " | ");
strickler.setValeurConstante(bf.getFloat());
- // System.out.print("Strickler_ValeurConstante = " + strickler.getValeurConstante() + " | ");
final int nbPtLoiStrickler = bf.getInt();
strickler.setNbPtLoi(nbPtLoiStrickler);
- // System.out.print("Strickler_NbPtLoi = " + strickler.getNbPtLoi() + " | ");
final float[] zs = new float[nbPtLoiStrickler];
for (int j2 = 0; j2 < nbPtLoiStrickler; j2++) {
zs[j2] = bf.getFloat();
- // System.out.print("Strickler_zs[j2] = " + zs[j2] + " | ");
}
strickler.setZs(zs);
// on ne lit pas le reste...
@@ -237,7 +217,6 @@
final float[] ks = new float[nbPtLoiStrickler];
for (int j2 = 0; j2 < nbPtLoiStrickler; j2++) {
ks[j2] = bf.getFloat();
- // System.out.print("Strickler_ks[j2] = " + ks[j2] + " | ");
}
strickler.setKs(ks);
// on ne lit pas le reste...
@@ -252,21 +231,17 @@
final float[] params = new float[5];
for (int j = 0; j < 5; j++) {
-
params[j] = bf.getFloat();
- // System.out.print("params[j] = " + params[j] + " | ");
}
donneesSection.setParams(params);
final int nbPtProfil = bf.getInt();
donneesSection.setNbPtProfil(nbPtProfil);
- // System.out.print("nbPtProfil = " + nbPtProfil + " | ");
final float[] xsTravers = new float[nbPtProfil];
for (int j = 0; j < nbPtProfil; j++) {
xsTravers[j] = bf.getFloat();
- // System.out.print("xsTravers[j] = " + xsTravers[j] + " | ");
}
donneesSection.setXsTravers(xsTravers);
// on ne lit pas le reste...
@@ -276,7 +251,6 @@
for (int j = 0; j < nbPtProfil; j++) {
zsTravers[j] = bf.getFloat();
- // System.out.print("zsTravers[j] = " + zsTravers[j] + " | ");
}
donneesSection.setZsTravers(zsTravers);
// on ne lit pas le reste...
@@ -286,32 +260,21 @@
for (int j = 0; j < 2; j++) {
fentes[j] = bf.getFloat();
- // System.out.print("fentes[j] = " + fentes[j] + " | ");
}
donneesSection.setFentes(fentes);
donneesSection.setZDevers(bf.getFloat());
- // System.out.print("ZDevers = " + donneesSection.getZDevers() + " | ");
donneesSection.setHDevers(bf.getFloat());
- // System.out.print("HDevers = " + donneesSection.getHDevers() + " | ");
donneesSection.setZDigueG(bf.getFloat());
- // System.out.print("ZDigueG = " + donneesSection.getZDigueG() + " | ");
donneesSection.setZDigueD(bf.getFloat());
- // System.out.print("ZDigueD = " + donneesSection.getZDigueD() + " | ");
donneesSection.setCDigueG(bf.getFloat());
- // System.out.print("CDigueG = " + donneesSection.getCDigueG() + " | ");
donneesSection.setCDigueD(bf.getFloat());
- // System.out.print("CDigueD = " + donneesSection.getCDigueD() + " | ");
donneesSection.setZFond(bf.getFloat());
- // System.out.print("ZFond = " + donneesSection.getZFond() + " | ");
donneesSection.setZHaut(bf.getFloat());
- // System.out.print("ZHaut = " + donneesSection.getZHaut() + " | ");
donneesSection.setDZpro(bf.getFloat());
- // System.out.print("DZpro = " + donneesSection.getDZpro() + " | ");
final String typeLimLit = getStringFromBuffer(bf, 8);
donneesSection.setTypeLimLit(typeLimLit);
- // System.out.print("typeLimLit = " + typeLimLit + " | ");
if (typeLimLit != null && typeLimLit.length() > 0) {
DonneesLimites limites = null;
@@ -324,7 +287,8 @@
}
DonneesSectionPourBranche donneesBranche = null;
- if (nTypBra == 0 || nTypBra == 9) {
+ // 0, 2, 6, 9 ou 15
+ if (nTypBra == 0 || nTypBra == 2 || nTypBra == 6 || nTypBra == 9 || nTypBra == 15) {
donneesBranche = getBranche0Ou9(bf);
} else {
donneesBranche = getAutreBranche(bf, nbLit);
@@ -334,8 +298,6 @@
// points z sur cette hauteur pour l'affection des loisFF
donneesSection.setNbHaut(nbHaut);
- // System.out.println();
-
return donneesSection;
}
@@ -371,7 +333,6 @@
for (int j = 0; j < nbLit; j++) {
limsDeb[j] = bf.getInt();
- // System.out.print("limsDeb[j] = " + limsDeb[j] + " | ");
}
limites.setJLimsDeb(limsDeb);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -380,7 +341,6 @@
for (int j = 0; j < nbLit; j++) {
limsFin[j] = bf.getInt();
- // System.out.print("limsFin[j] = " + limsFin[j] + " | ");
}
limites.setJLimsFin(limsFin);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -401,9 +361,7 @@
final float[] limsDeb = new float[nbLit];
for (int j = 0; j < nbLit; j++) {
-
limsDeb[j] = bf.getFloat();
- // System.out.print("limsDeb[j] = " + limsDeb[j] + " | ");
}
limites.setXLimsDeb(limsDeb);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -412,7 +370,6 @@
for (int j = 0; j < nbLit; j++) {
limsFin[j] = bf.getFloat();
- // System.out.print("limsFin[j] = " + limsFin[j] + " | ");
}
limites.setXLimsFin(limsFin);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -431,35 +388,22 @@
final SectionPourBranche0Ou9 donneesBranche = new SectionPourBranche0Ou9();
donneesBranche.setUlm1(bf.getFloat());
- // System.out.print("Ulm1 = " + donneesBranche.getUlm1() + " | ");
donneesBranche.setUlm2(bf.getFloat());
- // System.out.print("Ulm2 = " + donneesBranche.getUlm2() + " | ");
donneesBranche.setUlm3(bf.getFloat());
- // System.out.print("Ulm3 = " + donneesBranche.getUlm3() + " | ");
donneesBranche.setDZg11(bf.getFloat());
- // System.out.print("DZg11 = " + donneesBranche.getDZg11() + " | ");
donneesBranche.setDZg12(bf.getFloat());
- // System.out.print("DZg12 = " + donneesBranche.getDZg12() + " | ");
donneesBranche.setDZg13(bf.getFloat());
- // System.out.print("DZg13 = " + donneesBranche.getDZg13() + " | ");
donneesBranche.setDZd11(bf.getFloat());
- // System.out.print("DZd11 = " + donneesBranche.getDZd11() + " | ");
donneesBranche.setDZd12(bf.getFloat());
- // System.out.print("DZd12 = " + donneesBranche.getDZd12() + " | ");
donneesBranche.setDZd13(bf.getFloat());
- // System.out.print("DZd13 = " + donneesBranche.getDZd13() + " | ");
donneesBranche.setISec2(bf.getInt());
- // System.out.print("ISec2 = " + donneesBranche.getISec2() + " | ");
donneesBranche.setIular4(bf.getInt());
- // System.out.print("Iular4 = " + donneesBranche.getIular4() + " | ");
donneesBranche.setStric(bf.getFloat());
- // System.out.print("Stric = " + donneesBranche.getStric() + " | ");
final float[] listeSec1 = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
listeSec1[j] = bf.getFloat();
- // System.out.print("listeSec1[j] = " + listeSec1[j] + " | ");
}
donneesBranche.setListeSec1(listeSec1);
@@ -467,7 +411,6 @@
for (int j = 0; j < nbHaut; j++) {
listePer1[j] = bf.getFloat();
- // System.out.print("listePer1[j] = " + listePer1[j] + " | ");
}
donneesBranche.setListePer1(listePer1);
@@ -475,7 +418,6 @@
for (int j = 0; j < nbHaut; j++) {
listeUlar1[j] = bf.getFloat();
- // System.out.print("listeUlar1[j] = " + listeUlar1[j] + " | ");
}
donneesBranche.setListeUlar1(listeUlar1);
@@ -483,7 +425,6 @@
for (int j = 0; j < nbHaut; j++) {
listeSec2[j] = bf.getFloat();
- // System.out.print("listeSec2[j] = " + listeSec2[j] + " | ");
}
donneesBranche.setListeSec2(listeSec2);
@@ -491,7 +432,6 @@
for (int j = 0; j < nbHaut; j++) {
listePer2[j] = bf.getFloat();
- // System.out.print("listePer2[j] = " + listePer2[j] + " | ");
}
donneesBranche.setListePer2(listePer2);
@@ -499,7 +439,6 @@
for (int j = 0; j < nbHaut; j++) {
listeUlar2[j] = bf.getFloat();
- // System.out.print("listeUlar2[j] = " + listeUlar2[j] + " | ");
}
donneesBranche.setListeUlar2(listeUlar2);
@@ -507,7 +446,6 @@
for (int j = 0; j < nbHaut; j++) {
listeUlar4[j] = bf.getFloat();
- // System.out.print("listeUlar4[j] = " + listeUlar4[j] + " | ");
}
donneesBranche.setListeUlar4(listeUlar4);
@@ -515,7 +453,6 @@
for (int j = 0; j < nbHaut; j++) {
listeCoefW1[j] = bf.getFloat();
- // System.out.print("listeCoefW1[j] = " + listeCoefW1[j] + " | ");
}
donneesBranche.setListeCoefW1(listeCoefW1);
@@ -523,7 +460,6 @@
for (int j = 0; j < nbHaut; j++) {
listeCoefW2[j] = bf.getFloat();
- // System.out.print("listeCoefW2[j] = " + listeCoefW2[j] + " | ");
}
donneesBranche.setListeCoefW2(listeCoefW2);
@@ -543,41 +479,31 @@
final float[] listeSLitActif = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
-
listeSLitActif[j] = bf.getFloat();
- // System.out.print("listeSLitActif[j] = " + listeSLitActif[j] + " | ");
}
donneesBranche.setListeSLitActif(listeSLitActif);
final float[] listeLargLitActif = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
-
listeLargLitActif[j] = bf.getFloat();
- // System.out.print("listeLargLitActif[j] = " + listeLargLitActif[j] + " | ");
}
donneesBranche.setListeLargLitActif(listeLargLitActif);
final float[] listeDebLitActif = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
-
listeDebLitActif[j] = bf.getFloat();
- // System.out.print("listeDebLitActif[j] = " + listeDebLitActif[j] + " | ");
}
donneesBranche.setListeDebLitActif(listeDebLitActif);
final float[] listeLargCont = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
-
listeLargCont[j] = bf.getFloat();
- // System.out.print("listeLargCont[j] = " + listeLargCont[j] + " | ");
}
donneesBranche.setListeLargCont(listeLargCont);
final float[] listeBeta = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
-
listeBeta[j] = bf.getFloat();
- // System.out.print("listeBeta[j] = " + listeBeta[j] + " | ");
}
donneesBranche.setListeBeta(listeBeta);
@@ -585,7 +511,6 @@
for (int j = 0; j < nbHaut; j++) {
listeLargSto[j] = bf.getFloat();
- // System.out.print("listeLargSto[j] = " + listeLargSto[j] + " | ");
}
donneesBranche.setListeLargSto(listeLargSto);
@@ -593,7 +518,6 @@
for (int j = 0; j < nbLit; j++) {
listeSurfHaut[j] = bf.getFloat();
- // System.out.print("listeSurfHaut[j] = " + listeSurfHaut[j] + " | ");
}
donneesBranche.setListeSurfHaut(listeSurfHaut);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -602,7 +526,6 @@
for (int j = 0; j < nbLit; j++) {
listePerHaut[j] = bf.getFloat();
- // System.out.print("listePerHaut[j] = " + listePerHaut[j] + " | ");
}
donneesBranche.setListePerHaut(listePerHaut);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -611,7 +534,6 @@
for (int j = 0; j < nbLit; j++) {
listeLargHaut[j] = bf.getFloat();
- // System.out.print("listeLargHaut[j] = " + listeLargHaut[j] + " | ");
}
donneesBranche.setListeLargHaut(listeLargHaut);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -620,7 +542,6 @@
for (int j = 0; j < nbLit; j++) {
listeStriHaut[j] = bf.getFloat();
- // System.out.print("listeStriHaut[j] = " + listeStriHaut[j] + " | ");
}
donneesBranche.setListeStriHaut(listeStriHaut);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -629,7 +550,6 @@
for (int j = 0; j < nbLit; j++) {
listeLargFond[j] = bf.getFloat();
- // System.out.print("listeLargFond[j] = " + listeLargFond[j] + " | ");
}
donneesBranche.setListeLargFond(listeLargFond);
skip(bf, 4 * (nbLitMax - nbLit));
@@ -638,20 +558,14 @@
for (int j = 0; j < nbLit; j++) {
listeLitExtreme[j] = bf.getInt();
- // System.out.print("listeLitExtreme[j] = " + listeLitExtreme[j] + " | ");
}
- // System.out.println();
donneesBranche.setListeLitExtreme(listeLitExtreme);
skip(bf, 4 * (nbLitMax - nbLit));
donneesBranche.setRecAm(bf.getInt());
- // System.out.print("RecAm = " + donneesBranche.getRecAm() + " | ");
donneesBranche.setRecAv(bf.getInt());
- // System.out.print("RecAv = " + donneesBranche.getRecAv() + " | ");
donneesBranche.setDistAm(bf.getFloat());
- // System.out.print("DistAm = " + donneesBranche.getDistAm() + " | ");
donneesBranche.setDistAv(bf.getFloat());
- // System.out.print("DistAv = " + donneesBranche.getDistAv() + " | ");
return donneesBranche;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResBrancheOrifice.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -21,13 +21,6 @@
return ddeCoefCtr;
}
- // /**
- // * @return the ddeOuv
- // */
- // public boolean getDdeOuv() {
- // return ddeOuv;
- // }
-
/**
* @return the ddeRegime
*/
@@ -42,13 +35,6 @@
this.ddeCoefCtr = ddeCoefCtr;
}
- // /**
- // * @param ddeOuv the ddeOuv to set
- // */
- // public void setDdeOuv(final boolean ddeOuv) {
- // this.ddeOuv = ddeOuv;
- // }
-
/**
* @param ddeRegime the ddeRegime to set
*/
@@ -58,7 +44,7 @@
@Override
public String toString() {
- return "OrdResBrancheOrifice [ddeCoefCtr=" + ddeCoefCtr + ", ddeRegime=" + ddeRegime + "...]";
+ return "OrdResBrancheOrifice [ddeCoefCtr=" + ddeCoefCtr + ", ddeRegime=" + ddeRegime + "]";
}
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResCasierProfil.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -7,9 +7,9 @@
// WARN: l'ordre des champs est important car utilise par l'ecriture/lecture de ORES
/** @pdOid 01ffbfed-95f5-4a76-b0f5-9c52ca9c745e */
public class OrdResCasierProfil extends OrdRes {
+ private boolean ddeQech;
/** @pdOid 82809ac1-081a-48a5-86bb-5e66e55226d4 */
private boolean ddeSplan;
- private boolean ddeQech;
/** @pdOid 7c1dbf13-c9b2-4ce1-baaf-11be633338af */
private boolean ddeVol;
@@ -55,7 +55,7 @@
@Override
public String toString() {
- return "OrdResCasierProfil [ddeSplan=" + ddeSplan + ", ddeVol=" + ddeVol + "]";
+ return "OrdResCasierProfil [ddeQech=" + ddeQech + ", ddeSplan=" + ddeSplan + ", ddeVol=" + ddeVol + "]";
}
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionIdem.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -313,7 +313,13 @@
@Override
public String toString() {
- return "OrdResSectionIdem [ddeQ=" + ddeQ + ", ddeZ=" + ddeZ + "...]";
+ // private boolean ddeDact;
+ // private boolean ddeDtot;
+ // private boolean ddeFr;
+ // private boolean ddeH;
+ // private boolean ddeHs;
+ return "OrdResSectionIdem [ddeDact=" + ddeDact + ", ddeDtot=" + ddeDtot + ", ddeFr=" + ddeFr + ", ddeH=" + ddeH
+ + ", ddeHs=" + ddeHs + ",...]";
}
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java 2010-03-28 20:51:07 UTC (rev 5734)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdResSectionInterpolee.java 2010-03-30 21:27:25 UTC (rev 5735)
@@ -313,7 +313,9 @@
@Override
public String toString() {
- return "OrdResSectionInterpolee [ddeQ=" + ddeQ + ", ddeZ=" + ddeZ + "...]";
+ return "OrdResSecti...
[truncated message content] |
|
From: <de...@us...> - 2010-04-08 20:50:26
|
Revision: 5741
http://fudaa.svn.sourceforge.net/fudaa/?rev=5741&view=rev
Author: deniger
Date: 2010-04-08 20:50:20 +0000 (Thu, 08 Apr 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoCasier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueProperties.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBSequentialReader.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -14,6 +14,7 @@
import java.util.List;
import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluLibFile;
import org.fudaa.dodico.crue.metier.emh.AbstractInfosEMH;
import org.fudaa.dodico.crue.metier.emh.EMH;
@@ -59,7 +60,11 @@
namePos = new TObjectIntHashMap();
int idx = 0;
for (final T t : struc) {
- namePos.put(t.getNom(), idx++);
+ String nom = t.getNom();
+ if (StringUtils.isNotBlank(nom)) {
+ namePos.put(nom, idx);
+ }
+ idx++;
}
nb = listData.size();
}
@@ -72,6 +77,10 @@
return new ResultatCalcul<T, R>(emh, getPosition(emh.getId()), this);
}
+ public ResultatCalcul createInfoEMH(EMH emh, int position) {
+ return new ResultatCalcul<T, R>(emh, position, this);
+ }
+
/**
* @param nom le nom
* @return la position de lecture. -1 si non present
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -492,7 +492,7 @@
// Zf et Zhaut
rptgCasier.setZf(casier.getZFon());
- rptgCasier.setZHaut(casier.getZHau());
+ rptgCasier.setZhaut(casier.getZHau());
// Calcul des abscisses z
final float zmin = casier.getZFon();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -91,7 +91,7 @@
rptgSection.setNom(donneesSection.getNom());
final String nom = rptgSection.getNom();
rptgSection.setZf(donneesSection.getZf());
- rptgSection.setZHaut(donneesSection.getZHaut());
+ rptgSection.setZhaut(donneesSection.getZHaut());
final float[] params = donneesSection.getParams();
if (params != null && params.length == 5) {
rptgSection.setNumLitZf((int) params[0]);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -386,18 +386,21 @@
private SectionPourBranche0Ou9 getBranche0Ou9(final ByteBuffer bf) {
final SectionPourBranche0Ou9 donneesBranche = new SectionPourBranche0Ou9();
-
+ // real(4) ulm1, ulm2, ulm3
donneesBranche.setUlm1(bf.getFloat());
donneesBranche.setUlm2(bf.getFloat());
donneesBranche.setUlm3(bf.getFloat());
+ // dzg11, dzd11, dzg12, dzd12, dzg13, dzd13
donneesBranche.setDZg11(bf.getFloat());
+ donneesBranche.setDZd11(bf.getFloat());
donneesBranche.setDZg12(bf.getFloat());
+ donneesBranche.setDZd12(bf.getFloat());
donneesBranche.setDZg13(bf.getFloat());
- donneesBranche.setDZd11(bf.getFloat());
- donneesBranche.setDZd12(bf.getFloat());
donneesBranche.setDZd13(bf.getFloat());
+ // integer(4) isec2, iular4
donneesBranche.setISec2(bf.getInt());
donneesBranche.setIular4(bf.getInt());
+ // real(4) stric
donneesBranche.setStric(bf.getFloat());
final float[] listeSec1 = new float[nbHaut];
@@ -406,28 +409,27 @@
listeSec1[j] = bf.getFloat();
}
donneesBranche.setListeSec1(listeSec1);
-
+ // real(4) per1(NBHAUT)
final float[] listePer1 = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
listePer1[j] = bf.getFloat();
}
donneesBranche.setListePer1(listePer1);
-
+ // ular1(NBHAUT)
final float[] listeUlar1 = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
listeUlar1[j] = bf.getFloat();
}
donneesBranche.setListeUlar1(listeUlar1);
-
final float[] listeSec2 = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
listeSec2[j] = bf.getFloat();
}
donneesBranche.setListeSec2(listeSec2);
-
+ // per2(NBHAUT)
final float[] listePer2 = new float[nbHaut];
for (int j = 0; j < nbHaut; j++) {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoCasier.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoCasier.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoCasier.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -9,7 +9,7 @@
/** @pdOid ff358a06-83c9-4e9c-8de9-a8beac1414d1 */
private double zf;
/** @pdOid 6fa21c2e-b14a-4ec6-b0fa-8980dbd79531 */
- private double zHaut;
+ private double zhaut;
/** @pdOid 8a6c003a-0a3b-4cd9-8b97-7d2ccc31fb7d */
public LoiFF getLoiZVol() {
@@ -61,16 +61,16 @@
}
/** @pdOid 70459e03-4357-4584-97c6-9edcf0f9e499 */
- public double getZHaut() {
- return zHaut;
+ public double getZhaut() {
+ return zhaut;
}
/**
* @param newZHaut
* @pdOid 672abbe7-478f-452a-b673-917eeded2407
*/
- public void setZHaut(final double newZHaut) {
- zHaut = newZHaut;
+ public void setZhaut(final double newZHaut) {
+ zhaut = newZHaut;
}
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -17,7 +17,7 @@
/** @pdOid 5425f33c-0624-4b12-9058-a7c6e53bebe4 */
private double zf;
/** @pdOid 9314a711-1f69-42d0-8901-33f3184c8314 */
- private double zHaut;
+ private double zhaut;
/** @pdOid 57047aee-0f0e-4d4b-9b63-ea78ef22ddf4 */
private ResPrtData lstLitKsup;
/** @pdOid e161bbff-84a1-4cc2-8eb7-b7ebbc07932f */
@@ -70,16 +70,16 @@
}
/** @pdOid 006b4f38-400a-4616-845b-a5736e6c0565 */
- public final double getZHaut() {
- return zHaut;
+ public final double getZhaut() {
+ return zhaut;
}
/**
* @param newZHaut
* @pdOid 297a2126-0b53-4d5b-ba24-f041455fb349
*/
- public final void setZHaut(double newZHaut) {
- zHaut = newZHaut;
+ public final void setZhaut(double newZHaut) {
+ zhaut = newZHaut;
}
/** @pdOid 480a26bf-6069-4f53-9f16-a2eb96a215b8 */
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -29,6 +29,7 @@
import org.fudaa.dodico.crue.io.neuf.STOSequentialReader;
import org.fudaa.dodico.crue.io.neuf.STRFactory;
import org.fudaa.dodico.crue.io.neuf.STRSequentialReader;
+import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalcul;
import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalculPasDeTemps;
import org.fudaa.dodico.crue.io.neuf.FCBValueObject.EnteteBranche;
import org.fudaa.dodico.crue.io.neuf.FCBValueObject.EnteteCasier;
@@ -165,9 +166,9 @@
}
private void validFcbProfils(final FCBSequentialReader res, final CrueData data, final CtuluAnalyze analyze) {
- int nbAbsolu = 0;
+
STOSequentialReader sto = data.getSto();
- TIntObjectHashMap numAbsoluProfil = new TIntObjectHashMap();
+ TIntObjectHashMap sectionByNumAbsolu = new TIntObjectHashMap();
List<DonneesBranche> donneesBranches = sto.getDonneesBranches();
for (DonneesBranche donneesBranche : donneesBranches) {
String nomBr = donneesBranche.getNomBr().trim();
@@ -175,26 +176,30 @@
List<RelationEMHSectionDansBranche> sections = branche.getSections();
Collections.sort(sections, new EMHHelper.ComparatorRelationEMHSectionDansBranche());
int[] n0Pr = donneesBranche.getN0Pr();
+ // WARN dans les données les indices fortran commencent à 1:
for (int i = 0; i < n0Pr.length; i++) {
- numAbsoluProfil.put(n0Pr[i], sections.get(i).getEmh());
+ // on enleve 1 pour partir de 0:
+ sectionByNumAbsolu.put(n0Pr[i] - 1, sections.get(i).getEmh());
}
}
+ int nbAbsolu = 0;
+ for (final EnteteProfil prof : res.getContainerProfil().getListData()) {
- for (final EnteteProfil prof : res.getContainerProfil().getListData()) {
- nbAbsolu++;
final String id = prof.getNom().toUpperCase();
- CatEMHSection foundSection = null;
+ final CatEMHSection foundSection = (CatEMHSection) sectionByNumAbsolu.get(nbAbsolu);
+ ResultatCalcul resultatCalcul = null;
if (StringUtils.isEmpty(id)) {
- foundSection = (CatEMHSection) numAbsoluProfil.get(nbAbsolu);
+ resultatCalcul = res.getContainerProfil().createInfoEMH(foundSection, nbAbsolu);
} else {
- foundSection = data.findSectionByReference(id);
+ resultatCalcul = res.getContainerProfil().createInfoEMH(foundSection);
}
if (StringUtils.isNotEmpty(id) && foundSection == null) {
analyze.addError("res.section.notFound", id);
// error = true;
} else if (foundSection != null) {
- foundSection.addInfosEMH(res.getContainerProfil().createInfoEMH(foundSection));
+ foundSection.addInfosEMH(resultatCalcul);
}
+ nbAbsolu++;
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueProperties.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueProperties.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/property/CrueProperties.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -1,7 +1,6 @@
package org.fudaa.dodico.crue.property;
import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -9,7 +8,6 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -88,7 +86,7 @@
if (numberFormat == null) {
numberFormat = new DecimalFormat();
numberFormat.setGroupingUsed(false);
- numberFormat.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US));
+ // numberFormat.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US));
numberFormat.setMaximumFractionDigits(nbDec);
nbDecFormat.put(nbDec, numberFormat);
}
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java 2010-04-07 07:57:36 UTC (rev 5740)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java 2010-04-08 20:50:20 UTC (rev 5741)
@@ -76,8 +76,8 @@
infoCrue_.banner = new BuIcon(pathLogo);
// infoCrue_.logo = new BuIcon(pathLogo);
infoCrue_.name = "Fudaa-Crue";
- infoCrue_.version = "0.24";
- infoCrue_.date = "07-Avril-2010";
+ infoCrue_.version = "0.25";
+ infoCrue_.date = "09-Avril-2010";
infoCrue_.rights = "";
infoCrue_.contact = "fu...@ge...";
infoCrue_.license = "GPL2";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2010-04-06 21:50:35
|
Revision: 5738
http://fudaa.svn.sourceforge.net/fudaa/?rev=5738&view=rev
Author: deniger
Date: 2010-04-06 21:50:28 +0000 (Tue, 06 Apr 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/io/default-comparaison.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/xsd/frag-ores-1.0.0.xsd
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/comparaison/TestRequete.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDH.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueETUFile.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestEMHPropertiesValidator.java
trunk/soft/fudaa-crue/dodico/src/test/resources/Etu4-0/M4-0_e1c9.dh
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3-4.dptg.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.ores.xml
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele7.dc
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHManagerBuilder.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/AbstractCrue9FileFormat.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -98,7 +98,10 @@
crue9reader.setDataLinked(dataLinked);
crue9reader.setFile(url);
final CtuluIOOperationSynthese read = crue9reader.read();
- final CrueIOResu<CrueData> source = (CrueIOResu<CrueData>) read.getSource();
+ CrueIOResu<CrueData> source = (CrueIOResu<CrueData>) read.getSource();
+ if (source == null) {
+ source = new CrueIOResu<CrueData>();
+ }
analyzer.merge(read.getAnalyze());
analyzer.setDesc(IOMessages.getString("read.file", url.toString()));
source.setAnalyse(analyzer);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DCFileReader.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -2038,7 +2038,7 @@
if (resu.getMetier().getPretraitementsGeom() == null) {
createDefaultOPTG(resu.getMetier());
}
- if (analyze_.containsFatalError()) { return null; }
+ // if (analyze_.containsFatalError()) { return null; }
return resu;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHReader.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -639,9 +639,9 @@
}
/**
- * On doit avoir Zini = Zfond + coefRempliPourBrancheI*(ZmaxProfil - Zfond). Pour connaître Zfond et Zmax, il faut
- * récupérer tous les points(x,y) de la section dans DPTG et détermniner le ymin et ymax entre tous ces points qui
- * correspondront respectivement à Zfond et Zmax.
+ * On doit avoir Zini = Zf + coefRempliPourBrancheI*(ZmaxProfil - Zf). Pour connaître Zf et Zmax, il faut récupérer
+ * tous les points(x,y) de la section dans DPTG et détermniner le ymin et ymax entre tous ces points qui
+ * correspondront respectivement à Zf et Zmax.
*
* @param sectionEMH
* @param coefRempliPourBrancheI
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/DHWriter.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -592,7 +592,7 @@
* @param sectionEMH
* @return
*/
- private List<Double> getZFondEtZMax(final EMHSectionProfil sectionEMH) {
+ private List<Double> getZfEtZmax(final EMHSectionProfil sectionEMH) {
double zmin = 0.0;
double zmax = 0.0;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -258,9 +258,9 @@
prof.setNom(helper.getStingFromBuffer(16).trim());
prof.setDistance(buffer.getFloat());
- prof.setZfond(buffer.getFloat());
+ prof.setZf(buffer.getFloat());
if (containsSsfente) {
- prof.setZFondSsfente(buffer.getFloat());
+ prof.setZfSsFente(buffer.getFloat());
}
final int ipro = buffer.getInt();
// bizarre, l'indice est ecrit en derniere position
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBValueObject.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -59,8 +59,8 @@
public static class EnteteProfil extends AbstractEntete {
private double distance;
- private double zFond;
- private double zFondSsfente;
+ private double zf;
+ private double zfSsFente;
/**
* @param distance the distance to set
@@ -70,17 +70,17 @@
}
/**
- * @param zfond the zfonds to set
+ * @param zf the zfonds to set
*/
- protected void setZfond(final double zfond) {
- this.zFond = zfond;
+ protected void setZf(final double zf) {
+ this.zf = zf;
}
/**
- * @param zFondSsfente the zzfondSsfente to set
+ * @param zfSsFente the ZfSsFente to set
*/
- protected void setZFondSsfente(final double zFondSsfente) {
- this.zFondSsfente = zFondSsfente;
+ protected void setZfSsFente(final double zfSsFente) {
+ this.zfSsFente = zfSsFente;
}
/**
@@ -93,20 +93,20 @@
/**
* @return the zfonds
*/
- public double getZfond() {
- return zFond;
+ public double getZf() {
+ return zf;
}
/**
- * @return the zzfondSsfente
+ * @return the ZfSsFente
*/
- public double getZfondSsfente() {
- return zFondSsfente;
+ public double getZfSsFente() {
+ return zfSsFente;
}
@Override
public String toString() {
- return nom + " dist=" + distance + ", zfond=" + zFond + ", sfondSsFente=" + zFondSsfente;
+ return nom + " dist=" + distance + ", Zf=" + zf + ", ZfSsFente=" + zfSsFente;
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOReader.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -295,12 +295,14 @@
// write(isto) (n0pr(i,ib),i=1,imax(ib))
readData = helper.readData();
+ int[] indexAbsoluProfil = new int[imax];
for (int j = 0; j < imax; j++) {
// n0pr(NPR,NBR) i2 : n° absolu du profil dont le n° est ip dans la branche ib
// pas sur que l'on en ait besoin
- donneesBranche.setN0Pr(readData.getShort());
+ indexAbsoluProfil[j] = readData.getShort();
// System.out.print("n0Pr = " + donneesBranche.getN0Pr() + " | ");
}
+ donneesBranche.setN0Pr(indexAbsoluProfil);
// System.out.println("");
// if(n.gt.0) then
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOSequentialReader.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STOSequentialReader.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -1,6 +1,5 @@
/**
- * Licence GPL
- * Copyright Genesis
+ * Licence GPL Copyright Genesis
*/
package org.fudaa.dodico.crue.io.neuf;
@@ -25,7 +24,7 @@
private float alpha;
private int iMax;
private int n;
- private int n0Pr;
+ private int n0Pr[];
private int nbSing;
private String nomBr;
private int nSing;
@@ -39,91 +38,91 @@
/**
* @return the alpha
*/
- protected float getAlpha() {
+ public float getAlpha() {
return alpha;
}
/**
* @return the iMax
*/
- protected int getIMax() {
+ public int getIMax() {
return iMax;
}
/**
* @return the n
*/
- protected int getN() {
+ public int getN() {
return n;
}
/**
* @return the n0Pr
*/
- protected int getN0Pr() {
+ public int[] getN0Pr() {
return n0Pr;
}
/**
* @return the nbSing
*/
- protected int getNbSing() {
+ public int getNbSing() {
return nbSing;
}
/**
* @return the nomBr
*/
- protected String getNomBr() {
+ public String getNomBr() {
return nomBr;
}
/**
* @return the nSing
*/
- protected int getNSing() {
+ public int getNSing() {
return nSing;
}
/**
* @return the nTyp
*/
- protected int getNTyp() {
+ public int getNTyp() {
return nTyp;
}
/**
* @return the nuPam
*/
- protected int getNuPam() {
+ public int getNuPam() {
return nuPam;
}
/**
* @return the nuPav
*/
- protected int getNuPav() {
+ public int getNuPav() {
return nuPav;
}
/**
* @return the ruiBra
*/
- protected float getRuiBra() {
+ public float getRuiBra() {
return ruiBra;
}
/**
* @return the sing
*/
- protected float[] getSing() {
+ public float[] getSing() {
return sing;
}
/**
* @return the sinuo
*/
- protected float getSinuo() {
+ public float getSinuo() {
return sinuo;
}
@@ -151,7 +150,7 @@
/**
* @param pr the n0Pr to set
*/
- protected void setN0Pr(final int pr) {
+ protected void setN0Pr(final int[] pr) {
n0Pr = pr;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -90,7 +90,7 @@
final ResPrtGeoSection rptgSection = new ResPrtGeoSection();
rptgSection.setNom(donneesSection.getNom());
final String nom = rptgSection.getNom();
- rptgSection.setZf(donneesSection.getZFond());
+ rptgSection.setZf(donneesSection.getZf());
rptgSection.setZHaut(donneesSection.getZHaut());
final float[] params = donneesSection.getParams();
if (params != null && params.length == 5) {
@@ -100,7 +100,7 @@
}
// Alimentation LitZf
- rptgSection.setLitZf(getDataDeLitRPTG(donneesSection.getZFondsLits(), nom, EnumTypeLoi.LstLitZf));
+ rptgSection.setLstLitZf(getDataDeLitRPTG(donneesSection.getZFondsLits(), nom, EnumTypeLoi.LstLitZf));
final DonneesSectionPourBranche sectionBranche = donneesSection.getDonneesPourBranche();
if (sectionBranche instanceof SectionPourAutreBranche) {
@@ -110,7 +110,7 @@
// Calcul des abscisses z
final int nbHaut = donneesSection.getNbHaut();
final float dzpro = donneesSection.getDZpro();
- final float zmin = donneesSection.getZFond() + dzpro;
+ final float zmin = donneesSection.getZf() + dzpro;
final float[] abscissesZ = new float[nbHaut];
for (int i = 0; i < nbHaut; i++) {
@@ -150,15 +150,15 @@
}
// Alimentation loi PsupDeLit
- rptgSection.setLitPsup(getDataDeLitRPTG(sectionAutreBranche.getListePerHaut(), nom, EnumTypeLoi.LstLitPsup));
+ rptgSection.setLstLitPsup(getDataDeLitRPTG(sectionAutreBranche.getListePerHaut(), nom, EnumTypeLoi.LstLitPsup));
// Alimentation loi LsupDeLit
- rptgSection.setLitLsup(getDataDeLitRPTG(sectionAutreBranche.getListeLargHaut(), nom, EnumTypeLoi.LstLitLsup));
+ rptgSection.setLstLitLsup(getDataDeLitRPTG(sectionAutreBranche.getListeLargHaut(), nom, EnumTypeLoi.LstLitLsup));
// Alimentation loi KsupDeLit
rptgSection.setLstLitKsup(getDataDeLitRPTG(sectionAutreBranche.getListeStriHaut(), nom, EnumTypeLoi.LstLitKsup));
// Alimentation loi LinfDeLit
- rptgSection.setLitLinf(getDataDeLitRPTG(sectionAutreBranche.getListeLargFond(), nom, EnumTypeLoi.LstLitLinf));
+ rptgSection.setLstLitLinf(getDataDeLitRPTG(sectionAutreBranche.getListeLargFond(), nom, EnumTypeLoi.LstLitLinf));
// Alimentation loi SsupDeLit
- rptgSection.setLitSsup(getDataDeLitRPTG(sectionAutreBranche.getListeSurfHaut(), nom, EnumTypeLoi.LstLitSsup));
+ rptgSection.setLstLitSsup(getDataDeLitRPTG(sectionAutreBranche.getListeSurfHaut(), nom, EnumTypeLoi.LstLitSsup));
// Alimentation LitPos
final int[] listeLitsExtremes = sectionAutreBranche.getListeLitExtreme();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -158,7 +158,8 @@
final DonneesSectionOuProfil donneesSection = new DonneesSectionOuProfil();
- donneesSection.setNom(getStringFromBuffer(bf, 16).trim());
+ String nom = getStringFromBuffer(bf, 16);
+ donneesSection.setNom(nom.trim());
donneesSection.setType(getStringFromBuffer(bf, 8).trim());
final int nTypBra = bf.getInt();
@@ -240,7 +241,6 @@
final float[] xsTravers = new float[nbPtProfil];
for (int j = 0; j < nbPtProfil; j++) {
-
xsTravers[j] = bf.getFloat();
}
donneesSection.setXsTravers(xsTravers);
@@ -249,7 +249,6 @@
final float[] zsTravers = new float[nbPtProfil];
for (int j = 0; j < nbPtProfil; j++) {
-
zsTravers[j] = bf.getFloat();
}
donneesSection.setZsTravers(zsTravers);
@@ -269,22 +268,24 @@
donneesSection.setZDigueD(bf.getFloat());
donneesSection.setCDigueG(bf.getFloat());
donneesSection.setCDigueD(bf.getFloat());
- donneesSection.setZFond(bf.getFloat());
+ donneesSection.setZf(bf.getFloat());
donneesSection.setZHaut(bf.getFloat());
donneesSection.setDZpro(bf.getFloat());
final String typeLimLit = getStringFromBuffer(bf, 8);
donneesSection.setTypeLimLit(typeLimLit);
- if (typeLimLit != null && typeLimLit.length() > 0) {
- DonneesLimites limites = null;
- if (typeLimLit.equals(TYPE_LIMITE_LIT_J)) {
- limites = getDonneesLimiteJ(bf, nbLit);
- } else if (typeLimLit.equals(TYPE_LIMITE_LIT_X)) {
- limites = getDonneesLimiteX(bf, nbLit);
- }
- donneesSection.setDonneesLimites(limites);
+ DonneesLimites limites = null;
+ if (TYPE_LIMITE_LIT_J.equals(typeLimLit)) {
+ limites = getDonneesLimiteJ(bf, nbLit);
+ } else if (TYPE_LIMITE_LIT_X.equals(typeLimLit)) {
+ limites = getDonneesLimiteX(bf, nbLit);
+ } else {
+ // sinon, on saute la partie concernant les limites des lits
+ // soit 2 fois la lecture de nbLitMax float.
+ skip(bf, 2 * (4 * nbLitMax));
}
+ donneesSection.setDonneesLimites(limites);
DonneesSectionPourBranche donneesBranche = null;
// 0, 2, 6, 9 ou 15
@@ -331,7 +332,6 @@
final int[] limsDeb = new int[nbLit];
for (int j = 0; j < nbLit; j++) {
-
limsDeb[j] = bf.getInt();
}
limites.setJLimsDeb(limsDeb);
@@ -745,7 +745,7 @@
/** Coefficient de débitance dénoyé du déversoir de la digue en RD */
private float cDigueD;
/** Cote du fond de la section */
- private float zFond;
+ private float zf;
/** Cote du point le plus haut de la section */
private float zHaut;
/** Pas de hauteur pour le planimétrage de la section */
@@ -935,10 +935,10 @@
}
/**
- * @return the zFond
+ * @return the Zf
*/
- public float getZFond() {
- return zFond;
+ public float getZf() {
+ return zf;
}
/**
@@ -1138,10 +1138,10 @@
}
/**
- * @param fond the zFond to set
+ * @param zf the Zfto set
*/
- public void setZFond(final float fond) {
- zFond = fond;
+ public void setZf(final float zf) {
+ this.zf = zf;
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHActivable.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -13,11 +13,11 @@
*/
public abstract class CatEMHActivable extends EMH {
/** @pdOid b63b4510-1dae-4615-a616-61f8911b6b7e */
- private boolean active;
+ private boolean userActive;
/** @pdOid adf7fd8e-2133-4f9f-a463-e263df0c7557 */
public boolean getUserActive() {
- return active;
+ return userActive;
}
/**
@@ -25,7 +25,7 @@
* @pdOid 9c6ae571-14f8-4227-b75a-e320a4e581d9
*/
public void setUserActive(final boolean newIsActive) {
- active = newIsActive;
+ userActive = newIsActive;
}
public CatEMHActivable() {
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSection.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -104,7 +104,7 @@
* @param newLitLsup
* @pdOid c7601dcc-d71f-4339-96c1-8b294c196906
*/
- public final void setLitLsup(ResPrtData newLitLsup) {
+ public final void setLstLitLsup(ResPrtData newLitLsup) {
lstLitLsup = newLitLsup;
}
@@ -117,7 +117,7 @@
* @param newLitPsup
* @pdOid 459e6a7e-d448-401b-8093-ca13c6a20bb4
*/
- public final void setLitPsup(ResPrtData newLitPsup) {
+ public final void setLstLitPsup(ResPrtData newLitPsup) {
lstLitPsup = newLitPsup;
}
@@ -130,7 +130,7 @@
* @param newLitSsup
* @pdOid 77850a3b-edff-4795-aff9-cc84ae058a10
*/
- public final void setLitSsup(ResPrtData newLitSsup) {
+ public final void setLstLitSsup(ResPrtData newLitSsup) {
lstLitSsup = newLitSsup;
}
@@ -143,7 +143,7 @@
* @param newLitZf
* @pdOid 94863da0-35c2-4814-9b45-427ad41e0323
*/
- public final void setLitZf(ResPrtData newLitZf) {
+ public final void setLstLitZf(ResPrtData newLitZf) {
lstLitZf = newLitZf;
}
@@ -156,7 +156,7 @@
* @param newLitLinf
* @pdOid c10b8c4f-b331-4056-a4c7-504cc969747f
*/
- public final void setLitLinf(ResPrtData newLitLinf) {
+ public final void setLstLitLinf(ResPrtData newLitLinf) {
lstLitLinf = newLitLinf;
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/helper/EMHHelper.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -546,6 +546,10 @@
if (o1 == o2) { return 0; }
if (o1 == null) { return -1; }
if (o2 == null) { return 1; }
+ if (o1.getPos().equals(EnumPositionSection.AMONT)) { return -1; }
+ if (o2.getPos().equals(EnumPositionSection.AMONT)) { return 1; }
+ if (EnumPositionSection.AVAL.equals(o1.getPos())) { return 1; }
+ if (EnumPositionSection.AVAL.equals(o2.getPos())) { return -1; }
// il faudrait utilise un epsilon donne
if (CtuluLib.isEquals(o1.getXp(), o2.getXp())) { return 0; }
return o1.getXp() > o2.getXp() ? 1 : -1;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-03-31 14:39:47 UTC (rev 5737)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-04-06 21:50:28 UTC (rev 5738)
@@ -3,7 +3,10 @@
*/
package org.fudaa.dodico.crue.projet;
+import gnu.trove.TIntObjectHashMap;
+
import java.io.File;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -30,6 +33,7 @@
import org.fudaa.dodico.crue.io.neuf.FCBValueObject.EnteteBranche;
import org.fudaa.dodico.crue.io.neuf.FCBValueObject.EnteteCasier;
import org.fudaa.dodico.crue.io.neuf.FCBValueObject.EnteteProfil;
+import org.fudaa.dodico.crue.io.neuf.STOSequentialReader.DonneesBranche;
import org.fudaa.dodico.crue.metier.ManagerEMHModeleBase;
import org.fudaa.dodico.crue.metier.ManagerEMHScenario;
import org.fudaa.dodico.crue.metier.emh.CatEMHBranche;
@@ -39,6 +43,7 @@
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
import org.fudaa.dodico.crue.metier.emh.OrdPrtGeoModeleBase;
import org.fudaa.dodico.crue.metier.emh.PlanimetrageNbrPdzCst;
+import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBranche;
import org.fudaa.dodico.crue.metier.emh.ResPrtReseau;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
import org.fudaa.dodico.crue.property.CrueProperties;
@@ -146,43 +151,76 @@
analyze.setDesc(CommonMessages.getString("load.validFcb"));
analyze.setDefaultResourceBundle(CommonMessages.RESOURCE_BUNDLE);
mng.addAnalyzer(analyze);
- boolean error = false;
- for (final EnteteBranche br : res.getContainerBranches().getListData()) {
- final String id = br.getNom().toUpperCase();
- final CatEMHBranche foundBranche = data.findBrancheByReference(id);
- if (foundBranche == null) {
- analyze.addError("res.branche.notFound", id);
- error = true;
- } else if ("EMHBrancheSaintVenant".equals(foundBranche.getType())) {
- foundBranche.addInfosEMH(res.getContainerBranches().createInfoEMH(foundBranche));
- }
+ // boolean error = false;
+ validFcbBranches(res, data, analyze);
+ validFcbCasiers(res, data, analyze);
+ validFcbProfils(res, data, analyze);
+
+ final ResultatCalculPasDeTemps pdt = res.getPdt();
+ if (pdt != null && pdt.getNbPdt() > 0) {
+ emh.addInfosEMH(pdt);
}
- for (final EnteteCasier nd : res.getContainerCasiers().getListData()) {
- final String id = nd.getNom().toUpperCase();
- final CatEMHNoeud foundNoeud = data.findNoeudByReference(id);
- if (foundNoeud == null) {
- analyze.addError("res.noeud.notFound", id);
- error = true;
- } else if (foundNoeud.getCasier() != null) {
- foundNoeud.getCasier().addInfosEMH(res.getContainerCasiers().createInfoEMH(foundNoeud));
+
+ }
+
+ private void validFcbProfils(final FCBSequentialReader res, final CrueData data, final CtuluAnalyze analyze) {
+ int nbAbsolu = 0;
+ STOSequentialReader sto = data.getSto();
+ TIntObjectHashMap numAbsoluProfil = new TIntObjectHashMap();
+ List<DonneesBranche> donneesBranches = sto.getDonneesBranches();
+ for (DonneesBranche donneesBranche : donneesBranches) {
+ String nomBr = donneesBranche.getNomBr().trim();
+ CatEMHBranche branche = data.findBrancheByReference(nomBr);
+ List<RelationEMHSectionDansBranche> sections = branche.getSections();
+ Collections.sort(sections, new EMHHelper.ComparatorRelationEMHSectionDansBranche());
+ int[] n0Pr = donneesBranche.getN0Pr();
+ for (int i = 0; i < n0Pr.length; i++) {
+ numAbsoluProfil.put(n0Pr[i], sections.get(i).getEmh());
}
}
+
for (final EnteteProfil prof : res.getContainerProfil().getListData()) {
+ nbAbsolu++;
final String id = prof.getNom().toUpperCase();
- final CatEMHSection foundSection = data.findSectionByReference(id);
+ CatEMHSection foundSection = null;
+ if (StringUtils.isEmpty(id)) {
+ foundSection = (CatEMHSection) numAbsoluProfil.get(nbAbsolu);
+ } else {
+ foundSection = data.findSectionByReference(id);
+ }
if (StringUtils.isNotEmpty(id) && foundSection == null) {
analyze.addError("res.section.notFound", id);
- error = true;
+ // error = true;
} else if (foundSection != null) {
foundSection.addInfosEMH(res.getContainerProfil().createInfoEMH(foundSection));
}
}
+ }
- final ResultatCalculPasDeTemps pdt = res.getPdt();
- if (pdt != null && pdt.getNbPdt() > 0) {
- emh.addInfosEMH(pdt);
+ private void validFcbCasiers(final FCBSequentialReader res, final CrueData data, final CtuluAnalyze analyze) {
+ for (final EnteteCasier nd : res.getContainerCasiers().getListData()) {
+ final String id = nd.getNom().toUpperCase();
+ final CatEMHNoeud foundNoeud = data.findNoeudByReference(id);
+ if (foundNoeud == null) {
+ analyze.addError("res.noeud.notFound", id);
+ // error = true;
+ } else if (foundNoeud.getCasier() != null) {
+ foundNoeud.getCasier().addInfosEMH(res.getContainerCasiers().createInfoEMH(foundNoeud));
+ }
}
+ }
+ private void validFcbBranches(final FCBSequentialReader res, final CrueData data, final CtuluAnalyze analyze) {
+ for (final EnteteBranche br : res.getContainerBranches().getListData()) {
+ final String id = br.getNom().toUpperCase();
+ final CatEMHBranche foundBranche = data.findBrancheByReference(id);
+ if (foundBranche == null) {
+ analyze.addError("res.branche.notFound", id);
+ // error = true;
+ } else if ("EMHBrancheSaintVenant".equals(foundBranche.getType())) {
+ foundBranche.addInfosEMH(res.getContainerBranches().createInfoEMH(foundBranche));
+ }
+ }
}
private void validStr(final CrueData data, final EMHScenario emh, final CrueErrorManager mng) {
@@ -202,34 +240,21 @@
final String ndNom = StringUtils.substringBeforeLast(id, "#");
final CatEMHNoeud nd = data.findNoeudByReference(ndNom);
if (nd == null) {
- analyze.addError("rptg.NoeudForCasier.notFound", ndNom, id);
+ analyze.addFatalError("rptg.NoeudForCasier.notFound", ndNom, id);
error = true;
} else {
casier = nd.getCasier();
if (casier == null) {
- analyze.addError("rptg.casier.notExist", ndNom);
+ analyze.addFatalError("rptg.casier.notExist", ndNom);
error = true;
}
}
- // final List<DonPrtGeoProfilCasier> profilCasier = EMHHelper.collectClass(casier.getInfosEMH(),
- // DonPrtGeoProfilCasier.class);
- ...
[truncated message content] |
|
From: <de...@us...> - 2010-04-19 20:35:41
|
Revision: 5742
http://fudaa.svn.sourceforge.net/fudaa/?rev=5742&view=rev
Author: deniger
Date: 2010-04-19 20:35:33 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/CompareActionBuilder.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayDouble.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayFloat.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayInteger.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayLong.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterCollection.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamDouble.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamEntier.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/common/commonMessages.properties
trunk/soft/fudaa-crue/dodico/src/main/resources/org/fudaa/dodico/crue/comparaison/common/comparaisonMessages.properties
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/projet/ScenarioComparaisonUI.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/ctulu/CtuluAnalyze.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -358,6 +358,10 @@
return logs.isEmpty();
}
+ public boolean isNotEmpty() {
+ return !isEmpty();
+ }
+
/**
* @param _e l'exception a ajouter a l'anayse
*/
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/CompareActionBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/CompareActionBuilder.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/CompareActionBuilder.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -8,5 +8,11 @@
*/
public interface CompareActionBuilder {
+ /**
+ * @param target
+ * @param parent
+ * @param collector
+ * @return true si identique...
+ */
boolean launch(ComparaisonNodeFinal target, ResultatTest parent, CtuluAnalyze collector);
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/ExecuteCompareActionOnObject.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -32,11 +32,11 @@
List b = target.listObjectB;
if (a == b) { return true; }
if (a == null) {
- parent.addDiff(new ResultatTest(a, b, "Liste de a est null"));
+ parent.addDiff(new ResultatTest(a, b, "list.a.isNull"));
return false;
}
if (b == null) {
- parent.addDiff(new ResultatTest(a, b, "Liste de b est null"));
+ parent.addDiff(new ResultatTest(a, b, "list.b.isNull"));
return false;
}
int size = a.size();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayDouble.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayDouble.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayDouble.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,6 +1,5 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
/**
* @author denf01a
@@ -37,8 +36,7 @@
if (!objTester.isSameDouble(o1[idx], o2[idx])) {
// TODO améliorer le tout pour avoir plus de res.
if (res != null) {
- res.addDiff(new ResultatTest(o1[idx], o2[idx], ComparaisonMessages.getString("comparaison.collection.item",
- idx)));
+ res.addDiff(new ResultatTest(o1[idx], o2[idx], "comparaison.collection.item", idx));
}
return false;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayFloat.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayFloat.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayFloat.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,6 +1,5 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
/**
* @author denf01a
@@ -37,8 +36,7 @@
if (!objTester.isSameDouble(o1[idx], o2[idx])) {
// TODO améliorer le tout pour avoir plus de res.
if (res != null) {
- res.addDiff(new ResultatTest(o1[idx], o2[idx], ComparaisonMessages.getString("comparaison.collection.item",
- idx)));
+ res.addDiff(new ResultatTest(o1[idx], o2[idx], "comparaison.collection.item", idx));
}
return false;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayInteger.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayInteger.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayInteger.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,6 +1,5 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
/**
* @author denf01a
@@ -38,8 +37,7 @@
if (!isSame) {
// TODO améliorer le tout pour avoir plus de res.
if (res != null) {
- res.addDiff(new ResultatTest(o1[idx], o2[idx], ComparaisonMessages.getString("comparaison.collection.item",
- idx)));
+ res.addDiff(new ResultatTest(o1[idx], o2[idx], "comparaison.collection.item", idx));
}
return false;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayLong.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayLong.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterArrayLong.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,6 +1,5 @@
package org.fudaa.dodico.crue.comparaison.tester;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
/**
* @author denf01a
@@ -38,8 +37,7 @@
if (!isSame) {
// TODO améliorer le tout pour avoir plus de res.
if (res != null) {
- res.addDiff(new ResultatTest(o1[idx], o2[idx], ComparaisonMessages.getString("comparaison.collection.item",
- idx)));
+ res.addDiff(new ResultatTest(o1[idx], o2[idx], "comparaison.collection.item", idx));
}
return false;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,6 +1,7 @@
package org.fudaa.dodico.crue.comparaison.tester;
import java.beans.PropertyDescriptor;
+import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -14,7 +15,6 @@
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.common.CustomPropertyUtilsBeanInstaller;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
import org.fudaa.dodico.crue.metier.emh.InfosEMH;
import org.fudaa.dodico.crue.metier.emh.ObjetWithID;
import org.slf4j.Logger;
@@ -58,7 +58,7 @@
return true;
}
- private static final String TYPE_DIFF = ComparaisonMessages.getString("compare.type.diff");
+ private static final String TYPE_DIFF = "compare.type.diff";
private final static Logger LOGGER = LoggerFactory.getLogger(EqualsTesterBean.class);
@@ -185,11 +185,17 @@
if (o1 instanceof ObjetWithID) {
pref = ((ObjetWithID) o1).getId() + ": ";
}
- final ResultatTest item = new ResultatTest(a, b, pref
- + ComparaisonMessages.getString("compare.property.diff", propName));
+ NumberFormat formatter = factory.getPropEps().getFormatter(propName);
+
+ final ResultatTest item = new ResultatTest(format(a, formatter), format(b, formatter), "compare.property.diff",
+ pref, propName);
item.updatePrint();
res.addDiff(item);
}
}
+ private Object format(final Object b, NumberFormat formatter) {
+ return formatter == null ? b : formatter.format(b);
+ }
+
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterCollection.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterCollection.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterCollection.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -3,8 +3,6 @@
import java.util.Collection;
import java.util.Iterator;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
-
/**
* @author denf01a
* @creation 22 juin 2009
@@ -16,7 +14,7 @@
private final String propName;
private final EqualsTester equalTester;
- public static final String TAILLE_DIFF = ComparaisonMessages.getString("comparaison.collection.size");
+ public static final String TAILLE_DIFF = "comparaison.collection.size";
public EqualsTesterCollection(final FactoryEqualsTester factory, final String propName) {
super();
@@ -83,7 +81,7 @@
private void addDiff(final ResultatTest res, final int idx, final Object obj1, final Object obj2) {
if (res != null) {
- res.addDiff(new ResultatTest(obj1, obj2, ComparaisonMessages.getString("comparaison.collection.item", idx)));
+ res.addDiff(new ResultatTest(obj1, obj2, "comparaison.collection.item", idx));
}
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterFente.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -35,14 +35,14 @@
bool = false;
if (res != null) {
res.addDiff(new ResultatTest(o1.getLargeurFente(), o2.getLargeurFente(), "compare.property.diff",
- "largeurFentre"));
+ "largeurFente"));
}
}
if (!profondeurFente.isSameDouble(o1.getProfondeurFente(), o2.getProfondeurFente())) {
bool = false;
if (res != null) {
res.addDiff(new ResultatTest(o1.getProfondeurFente(), o2.getProfondeurFente(), "compare.property.diff",
- "profondeurFentre"));
+ "profondeurFente"));
}
}
return bool;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterResultatPasDeTemps.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,5 +1,6 @@
package org.fudaa.dodico.crue.comparaison.tester;
+import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
@@ -8,6 +9,7 @@
import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.common.DoubleComparator;
import org.fudaa.dodico.crue.io.neuf.FCBSequentialReader.ResultatCalculPasDeTemps;
+import org.fudaa.dodico.crue.property.CrueProperties;
/**
* @author denf01a
@@ -17,14 +19,17 @@
public class EqualsTesterResultatPasDeTemps extends AbstractEqualsTester<ResultatCalculPasDeTemps> {
private final double epsPdt;
+ private final CrueProperties crueProperties;
final EqualsTesterDouble ruinouTester;
+ private NumberFormat pdtFormater;
/**
* @param epsPdt
*/
- public EqualsTesterResultatPasDeTemps(final double epsPdt, final EqualsTesterDouble ruinouTester) {
+ public EqualsTesterResultatPasDeTemps(final double epsPdt, final EqualsTesterDouble ruinouTester, CrueProperties props) {
super();
this.epsPdt = epsPdt;
+ this.crueProperties = props;
this.ruinouTester = ruinouTester;
}
@@ -33,6 +38,13 @@
return false;
}
+ private NumberFormat getNumberFormatForPdt() {
+ if (pdtFormater == null) {
+ pdtFormater = crueProperties.getFormatter("pdt");
+ }
+ return pdtFormater;
+ }
+
@Override
public boolean isSameSafe(final ResultatCalculPasDeTemps o1, final ResultatCalculPasDeTemps o2,
final ResultatTest res, final TesterContext context) {
@@ -52,28 +64,29 @@
for (int i = 0; i < nbPdt2; i++) {
pdtIn2.add(o2.getPdt(i));
}
+
List<String> pdtContainedBy2AndNotBy1 = new ArrayList<String>();
List<String> pdtContainedBy1AndNotBy2 = new ArrayList<String>();
for (Double pdt : pdtIn2) {
if (!pdtIn1.containsKey(pdt)) {
- pdtContainedBy2AndNotBy1.add(Double.toString(pdt));
+ pdtContainedBy2AndNotBy1.add(getNumberFormatForPdt().format(pdt));
}
}
for (Double pdt : pdtIn1.keySet()) {
if (!pdtIn2.contains(pdt)) {
- pdtContainedBy1AndNotBy2.add(Double.toString(pdt));
+ pdtContainedBy1AndNotBy2.add(getNumberFormatForPdt().format(pdt));
}
}
if (pdtContainedBy1AndNotBy2.size() > 0) {
bool = false;
- res.addDiff(new ResultatTest(StringUtils.join(pdtContainedBy1AndNotBy2, ", "), StringUtils.EMPTY,
+ res.addDiff(new ResultatTest(StringUtils.join(pdtContainedBy1AndNotBy2, "; "), StringUtils.EMPTY,
"compare.pdt.inA.diff"));
}
if (pdtContainedBy2AndNotBy1.size() > 0) {
bool = false;
- res.addDiff(new ResultatTest(StringUtils.join(pdtContainedBy2AndNotBy1, ", "), StringUtils.EMPTY,
+ res.addDiff(new ResultatTest(StringUtils.EMPTY, StringUtils.join(pdtContainedBy2AndNotBy1, "; "),
"compare.pdt.inB.diff"));
}
List<String> pdtWithDifferentRegul = new ArrayList<String>();
@@ -87,27 +100,26 @@
boolean isRegu2 = o2.isRegulation(pos2);
boolean isRegu1 = o1.isRegulation(pos1);
if (isRegu1 != isRegu2) {
- pdtWithDifferentRegul.add(Double.toString(pdt));
+ pdtWithDifferentRegul.add(getNumberFormatForPdt().format(pdt));
} else if (!isRegu1) {
double rui1 = o1.getRuinou(pos1);
double rui2 = o2.getRuinou(pos2);
if (!ruinouTester.isSameDouble(rui1, rui2)) {
- pdtWithDifferentRuinou.add(Double.toString(pdt));
+ pdtWithDifferentRuinou.add(getNumberFormatForPdt().format(pdt));
}
}
}
}
if (pdtWithDifferentRegul.size() > 0) {
- res.addDiff(new ResultatTest(StringUtils.EMPTY, StringUtils.join(pdtWithDifferentRegul, ", "),
+ res.addDiff(new ResultatTest(StringUtils.EMPTY, StringUtils.join(pdtWithDifferentRegul, "; "),
"compare.pdt.withDifferentRegu"));
}
if (pdtWithDifferentRuinou.size() > 0) {
- res.addDiff(new ResultatTest(StringUtils.EMPTY, StringUtils.join(pdtWithDifferentRuinou, ", "),
+ res.addDiff(new ResultatTest(StringUtils.EMPTY, StringUtils.join(pdtWithDifferentRuinou, "; "),
"compare.pdt.withDifferentRuinou"));
}
+ res.setNbObjectTested(o1.getNbPdt());
return bool;
- // return abs.isSameDouble(o1.getAbscisse(), o2.getAbscisse()) && ord.isSameDouble(o1.getOrdonnee(),
- // o2.getOrdonnee());
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamDouble.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamDouble.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamDouble.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,7 +1,6 @@
package org.fudaa.dodico.crue.comparaison.tester;
import org.apache.commons.lang.ObjectUtils;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
import org.fudaa.dodico.crue.metier.emh.ValParamDouble;
/**
@@ -27,7 +26,7 @@
final TesterContext context) throws Exception {
if (!ObjectUtils.equals(o1.getId(), o2.getId())) {
if (res != null) {
- res.addDiff(new ResultatTest(o1.getId(), o2.getId(), ComparaisonMessages.getString("compare.type.diff")));
+ res.addDiff(new ResultatTest(o1.getId(), o2.getId(), "compare.type.diff"));
return false;
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamEntier.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamEntier.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterValParamEntier.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -1,7 +1,6 @@
package org.fudaa.dodico.crue.comparaison.tester;
import org.apache.commons.lang.ObjectUtils;
-import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
import org.fudaa.dodico.crue.metier.emh.ValParamEntier;
/**
@@ -27,7 +26,7 @@
final TesterContext context) throws Exception {
if (!ObjectUtils.equals(o1.getId(), o2.getId())) {
if (res != null) {
- res.addDiff(new ResultatTest(o1.getId(), o2.getId(), ComparaisonMessages.getString("compare.type.diff")));
+ res.addDiff(new ResultatTest(o1.getId(), o2.getId(), "compare.type.diff"));
return false;
}
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/FactoryEqualsTester.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -58,17 +58,13 @@
final EqualsTesterFente fente = new EqualsTesterFente(new EqualsTesterDouble(factory.getEpsFor("largeurFente")),
new EqualsTesterDouble(factory.getEpsFor("profondeurFente")));
res.put(DonPrtGeoProfilSectionFenteData.class, fente);
- res.put(ResultatCalculPasDeTemps.class, new EqualsTesterResultatPasDeTemps(factory.getEpsFor("pdt"),
- new EqualsTesterDouble(factory.getEpsFor("qruis"))));
- res.put(ResultatCalcul.class, new EqualsTesterResultatCalcul(factory.getEpsFor("pdt"),
- new EqualsTesterBean(factory)));
return res;
}
private static Map<Class, EqualsTester> createMainKnownEqualsTester(final FactoryEqualsTester factory) {
final Map<Class, EqualsTester> res = new HashMap<Class, EqualsTester>();
res.put(ResultatCalculPasDeTemps.class, new EqualsTesterResultatPasDeTemps(factory.getEpsFor("pdt"),
- new EqualsTesterDouble(factory.getEpsFor("qruis"))));
+ new EqualsTesterDouble(factory.getEpsFor("qruis")), factory.getPropEps()));
res.put(ResultatCalcul.class, new EqualsTesterResultatCalcul(factory.getEpsFor("pdt"),
new EqualsTesterBean(factory)));
return res;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/comparaison/tester/ResultatTest.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -5,8 +5,9 @@
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
+import org.fudaa.dodico.crue.comparaison.common.ComparaisonMessages;
+import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
import org.fudaa.dodico.crue.metier.emh.ObjetWithID;
-import org.fudaa.dodico.crue.metier.emh.ObjetNomme;
/**
* @author denf01a
@@ -20,6 +21,7 @@
private List<ResultatTest> filsExt;
private String msg;
+ private String traductedMsg;
private Object[] msgArguments;
@@ -42,14 +44,13 @@
public ResultatTest(final Object a, final Object b, final String msg) {
objetA = a;
objetB = b;
- this.msg = msg;
+ setMsg(msg);
}
public ResultatTest(final Object a, final Object b, final String msg, final Object... args) {
objetA = a;
objetB = b;
- this.msg = msg;
- msgArguments = args;
+ setMsg(msg, args);
}
private void addFils(final ResultatTest item) {
@@ -145,12 +146,14 @@
return same;
}
- public void setMsg(final String msg) {
+ public void setMsg(final String msg, final Object... msgArguments) {
this.msg = msg;
+ this.msgArguments = msgArguments;
+ this.traductedMsg = ComparaisonMessages.getString(msg, msgArguments);
}
- protected void setMsgArguments(final Object[] msgArguments) {
- this.msgArguments = msgArguments;
+ public void setMsg(final String msg) {
+ setMsg(msg, null);
}
/**
@@ -200,4 +203,11 @@
return same;
}
+ /**
+ * @return the traductedMsg
+ */
+ public String getTraductedMsg() {
+ return traductedMsg;
+ }
+
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -42,7 +42,7 @@
tempInt = bf.getInt(0);
// toujours pas ... ce n'est pas un fichier correct
if (tempInt != firstInt) {
- analyze_.addFatalError("crue.io.fcb.notValid");
+ analyze_.addError("crue.io.fcb.notValid");
return null;
}
infos.setOrder(helper.getOrder());
@@ -85,8 +85,10 @@
infos.regulation = (icodav == 1 || icodav == 3);
final int nbBranches = bf.getInt();
int nbCharTitreDCDh = 256;
- final String nomDc = helper.getStingFromBuffer(nbCharTitreDCDh);
- final String nomDh = helper.getStingFromBuffer(nbCharTitreDCDh);
+ /** final String nomDc = **/
+ helper.getStingFromBuffer(nbCharTitreDCDh);
+ /** final String nomDh = **/
+ helper.getStingFromBuffer(nbCharTitreDCDh);
// -- on passe a la ligne contenant ibmax et iparam --//
// helper.skipRecord();
@@ -109,12 +111,9 @@
helper.readSequentialData();
// readRegulationParam(infos); pas pris en compte dans le lot0
}
-
// -- on arrive au CORPS, on repere les indice de chaque PDT --//
readPdt(infos);
-
// --on passee les lignes de Crue--//
-
return infos;
}
@@ -161,11 +160,7 @@
// final TDoubleArrayList pdtRegul = new TDoubleArrayList();
while (helper.getAvailable() > 0) {
- long position = helper.getCurrentPosition();
- long size = helper.getChannel().size();
helper.readData();
- position = helper.getCurrentPosition();
- size = helper.getChannel().size();
// ici on a la ligne
// write(9) test,sngl(t) si regul
// (ifi2) test,sngl(t),sngl(ruinou) pour un pas de temps normal
@@ -185,22 +180,15 @@
// on enregistre la position intéressante: celle juste avant les donnéées
posNormal.add(helper.getCurrentPosition());
// on saute la ligne profil ou regul
- position = helper.getCurrentPosition();
helper.skipRecord();
- position = helper.getCurrentPosition();
- size = helper.getChannel().size();
// si pas regu
if (!isRegu) {
// on saute la ligne branche
helper.skipRecord();
- position = helper.getCurrentPosition();
- size = helper.getChannel().size();
// on saute la ligne point
helper.skipRecord();
- position = helper.getCurrentPosition();
- size = helper.getChannel().size();
}
}
infos.setPdt(new FCBSequentialReader.ResultatCalculPasDeTemps(posNormal, pdtNormal, regul, ruinouNormal));
@@ -265,7 +253,7 @@
final int ipro = buffer.getInt();
// bizarre, l'indice est ecrit en derniere position
if (ipro != (i + 1)) {
- analyze_.addFatalError("io.crue.fcb.profilIndice.error");
+ analyze_.addError("io.crue.fcb.profilIndice.error");
throw new IOException("io.crue.fcb.profilIndice.error");
}
// helper.getBuffer().getDouble();
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoader.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -85,7 +85,7 @@
emhScenario = new ScenarioLoaderCrue10(scenario, readFileBilan, propDefinition, analyzer).compute(files);
}
}
- if (emhScenario == null) { return errorMng; }
+ if (emhScenario == null || errorMng.containsFatalError()) { return errorMng; }
emhScenario.sort();
emhScenario.setNom(scenario.getNom());
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-04-08 20:50:20 UTC (rev 5741)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-04-19 20:35:33 UTC (rev 5742)
@@ -113,16 +113,16 @@
// on charge les valeurs par defaut pour ores.
final CtuluAnalyze ores = new CtuluAnalyze();
Crue10FileFormatFactory.getInstance().getORES().read("/default.ores.xml", ores, res);
- if (ores.containsErrorOrFatalError()) {
+ if (ores.isNotEmpty()) {
errorMng.getAnalyser().add(ores);
}
if (ores.containsFatalError()) { return null; }
// on verifie que l'on peut renommer les noms correctement.
final CtuluAnalyze verifiePrefixeNomDonneesCrue9 = CruePrefix.verifiePrefixeNomDonneesCrue9(res);
- if (verifiePrefixeNomDonneesCrue9.containsErrorOrFatalError()) {
+ if (verifiePrefixeNomDonneesCrue9.isNotEmpty()) {
errorMng.getAnalyser().add(verifiePrefixeNomDonneesCrue9);
- return null;
}
+ if (verifiePrefixeNomDonneesCrue9.containsFatalError()) { return null; }
final EMHScenario emhScenario = res.getScenarioData();
res.g...
[truncated message content] |
|
From: <de...@us...> - 2010-05-19 22:37:59
|
Revision: 5752
http://fudaa.svn.sourceforge.net/fudaa/?rev=5752&view=rev
Author: deniger
Date: 2010-05-19 22:37:52 +0000 (Wed, 19 May 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/ResPrtReseauCrue9Adapter.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumTypeLoi.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtData.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSectionTypeBranche9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java
trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java
trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml
trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueSTR.java
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestCruePrefix.java
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/FCBReader.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -8,6 +8,9 @@
import java.util.ArrayList;
import java.util.List;
+import org.fudaa.dodico.crue.metier.emh.EnumTypeEMH;
+import org.fudaa.dodico.crue.validation.CruePrefix;
+
/**
* Reader pour FCB.
*
@@ -136,7 +139,7 @@
final List<FCBValueObject.EnteteCasier> nds = new ArrayList<FCBValueObject.EnteteCasier>(nbNd);
for (int i = 0; i < nbNd; i++) {
final FCBValueObject.EnteteCasier nd = new FCBValueObject.EnteteCasier();
- nd.setNom(helper.getStingFromBuffer(16).trim());
+ nd.setNom(CruePrefix.changePrefix(helper.getStingFromBuffer(16).trim(), EnumTypeEMH.NOEUD));
nd.setNumProfil(bf.getInt() - 1);
nds.add(nd);
}
@@ -220,7 +223,7 @@
numeroAbsProfil[iProf] = buffer.getShort() - 1;
}
br.setTableauIndiceProfils(numeroAbsProfil);
- br.setNom(helper.getStingFromBuffer(16).trim());
+ br.setNom(CruePrefix.changePrefix(helper.getStingFromBuffer(16).trim(), EnumTypeEMH.BRANCHE));
br.setProfilAmont(buffer.getInt() - 1);
br.setProfilAval(buffer.getInt() - 1);
brs.add(br);
@@ -243,7 +246,8 @@
final ByteBuffer buffer = helper.getBuffer();
for (int i = 0; i < nbProfils; i++) {
final FCBValueObject.EnteteProfil prof = new FCBValueObject.EnteteProfil();
- prof.setNom(helper.getStingFromBuffer(16).trim());
+ String nom = helper.getStingFromBuffer(16).trim();
+ prof.setNom(CruePrefix.changePrefix(nom, EnumTypeEMH.SECTION));
prof.setDistance(buffer.getFloat());
prof.setZf(buffer.getFloat());
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/ResPrtReseauCrue9Adapter.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/ResPrtReseauCrue9Adapter.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/ResPrtReseauCrue9Adapter.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -67,8 +67,9 @@
this.resSto = new HashMap<String, AbstractResPrtGeoCasierContainer>(readSto.size());
final List tmplistCasier = new ArrayList<String>();
for (final Map.Entry<String, ResPrtGeoCasier> it : readSto.entrySet()) {
- tmplistCasier.add(it.getKey());
- resSto.put(it.getKey(), new ResPrtGeoCasierContainer(it.getKey(), it.getValue()));
+ String nomCasier = it.getKey();
+ tmplistCasier.add(nomCasier);
+ resSto.put(nomCasier, new ResPrtGeoCasierContainer(nomCasier, it.getValue()));
}
listCasier = Collections.unmodifiableList(tmplistCasier);
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRFactory.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -3,11 +3,16 @@
*/
package org.fudaa.dodico.crue.io.neuf;
+import gnu.trove.TFloatArrayList;
+
+import java.util.ArrayList;
import java.util.List;
import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.DonneesSectionOuProfil;
import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.DonneesSectionPourBranche;
+import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.DonneesStricklerPourLitSection;
import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.SectionPourAutreBranche;
+import org.fudaa.dodico.crue.io.neuf.STRSequentialReader.SectionPourBranche0Ou9;
import org.fudaa.dodico.crue.metier.emh.DonFrt;
import org.fudaa.dodico.crue.metier.emh.DonFrtStrickler;
import org.fudaa.dodico.crue.metier.emh.EnumLitPosition;
@@ -21,6 +26,7 @@
import org.fudaa.dodico.crue.metier.emh.ResPrtGeoSectionTypeBranche9;
import org.fudaa.dodico.crue.metier.helper.LoiFactory;
import org.fudaa.dodico.crue.validation.CruePrefix;
+import org.fudaa.dodico.mesure.EvolutionReguliere;
/**
* @author cde
@@ -36,6 +42,7 @@
* Sauvegarde du profil dans les objets métier
*
* @param donneesSection Profil à sauvegarder
+ * @return data transformed to ResPrtGeoSection
*/
public static ResPrtGeoSection convertDonnees(final DonneesSectionOuProfil donneesSection) {
@@ -45,7 +52,7 @@
final ResPrtGeoSection rptgSection = isTypeBrancheSpecCrue9 ? new ResPrtGeoSectionTypeBranche9()
: new ResPrtGeoSection();
rptgSection.setNom(donneesSection.getNom());
- final String nom = rptgSection.getNom();
+
rptgSection.setZf(donneesSection.getZf());
rptgSection.setZhaut(donneesSection.getZHaut());
final float[] params = donneesSection.getParams();
@@ -56,93 +63,268 @@
}
// Alimentation LitZf
- rptgSection.setLstLitZf(getDataDeLitRPTG(donneesSection.getZFondsLits(), nom, EnumTypeLoi.LstLitZf));
+ rptgSection
+ .setLstLitZf(getDataDeLitRPTG(donneesSection.getZFondsLits(), rptgSection.getNom(), EnumTypeLoi.LstLitZf));
final DonneesSectionPourBranche sectionBranche = donneesSection.getDonneesPourBranche();
- // Traiter le cas pour
- if (sectionBranche instanceof SectionPourAutreBranche) {
- final SectionPourAutreBranche sectionAutreBranche = (SectionPourAutreBranche) sectionBranche;
+ if (isTypeBrancheSpecCrue9) {
+ fillSectionPourBrancheSpec9(donneesSection, rptgSection);
- // Calcul des abscisses z
- final int nbHaut = donneesSection.getNbHaut();
- final float dzpro = donneesSection.getDZpro();
- final float zmin = donneesSection.getZf() + dzpro;
- final float[] abscissesZ = new float[nbHaut];
+ } else if (sectionBranche instanceof SectionPourAutreBranche) {
+ fillSectionPourAutreBranche(donneesSection, rptgSection);
+ }
+ return rptgSection;
+ }
- for (int i = 0; i < nbHaut; i++) {
- abscissesZ[i] = zmin + i * dzpro;
- }
+ /**
+ * @param tab1
+ * @param tab2 not null and its length must equals or higher than tab1
+ * @return tab tab[i]=tab1[i]+tab2[i] and with the size of tab1 and
+ */
+ private static float[] sum(float[] tab1, float[] tab2) {
+ int length = tab1.length;
+ float[] res = new float[length];
+ for (int i = 0; i < length; i++) {
+ res[i] = tab1[i] + tab2[i];
+ }
+ return res;
+ }
- // Alimentation loi LaDeZ
- LoiFF loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeLargLitActif(), "ZLact",
- EnumTypeLoi.LoiZLact);
- if (loiFF != null) {
- rptgSection.setLoiZLact(loiFF);
+ static float[] getFinalFloat(String[] lits, float[] init) {
+ TFloatArrayList res = new TFloatArrayList(init.length);
+ for (int i = 0; i < init.length; i++) {
+ if (lits[i] != null) {
+ res.add(init[i]);
}
+ }
+ return res.toNativeArray();
+ }
- // Alimentation loi DaDeZ
+ static double[] getFinalFloat(float[] init) {
+ double[] res = new double[init.length];
+ for (int i = 0; i < init.length; i++) {
+ res[i] = init[i];
+ }
+ return res;
+ }
- loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeDebLitActif(), nom, EnumTypeLoi.LoiZDact);
- if (loiFF != null) {
- rptgSection.setLoiZDact(loiFF);
+ static String[] getFinalLit(String[] lits) {
+ List<String> res = new ArrayList<String>(lits.length);
+ for (int i = 0; i < lits.length; i++) {
+ if (lits[i] != null) {
+ res.add(lits[i]);
}
+ }
+ return res.toArray(new String[res.size()]);
+ }
- // Alimentation loi SaDeZ
- loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeSLitActif(), nom, EnumTypeLoi.LoiZSact);
- if (loiFF != null) {
- rptgSection.setLoiZSact(loiFF);
+ static EnumLitPosition[] getFinalPosition(EnumLitPosition[] pos) {
+ List<EnumLitPosition> res = new ArrayList<EnumLitPosition>(pos.length);
+ for (int i = 0; i < pos.length; i++) {
+ if (pos[i] != null) {
+ res.add(pos[i]);
}
+ }
+ return res.toArray(new EnumLitPosition[res.size()]);
+ }
- // Alimentation loi BetaDeZ
- loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeBeta(), nom, EnumTypeLoi.LoiZBeta);
- if (loiFF != null) {
- rptgSection.setLoiZBeta(loiFF);
- }
+ private static void fillSectionPourBrancheSpec9(DonneesSectionOuProfil in, ResPrtGeoSection out) {
+ final String nom = out.getNom();
+ ResPrtGeoSectionTypeBranche9 specOut = (ResPrtGeoSectionTypeBranche9) out;
+ final SectionPourBranche0Ou9 inSection = (SectionPourBranche0Ou9) in.getDonneesPourBranche();
+ // we create all data.
+ // used lits will have a name not null;
+ String[] nomLits = new String[5];
+ nomLits[2] = "Lt_Mineur";
+ EnumLitPosition[] posLits = new EnumLitPosition[5];
+ posLits[2] = inSection.getISec2() == 1 ? EnumLitPosition.PAS_BORDURE : EnumLitPosition.BORDURE_2_COTES;
+ if (inSection.getIular4() == 1) {
+ nomLits[0] = "Lt_StoD";
+ posLits[0] = EnumLitPosition.BORDURE_2_COTES;
+ nomLits[4] = "Lt_StoG";
+ posLits[4] = EnumLitPosition.BORDURE_2_COTES;
+ }
+ if (inSection.getISec2() == 1) {
+ nomLits[1] = "Lt_MajD";
+ posLits[1] = EnumLitPosition.BORDURE_DROITE;
+ nomLits[3] = "Lt_MajG";
+ posLits[3] = EnumLitPosition.BORDURE_GAUCHE;
+ }
+ ResPrtDataLitPos newLitPos = createResLitPos(in);
+ newLitPos.setPositions(getFinalPosition(posLits));
+ out.setLstLitPos(newLitPos);
- // Alimentation loi LsDeZ
- loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeLargSto(), nom, EnumTypeLoi.LoiZLsto);
- if (loiFF != null) {
- rptgSection.setLoiZLsto(loiFF);
- }
+ float[] litInf = new float[nomLits.length];
+ litInf[0] = inSection.getListeUlar4()[0] / 2;
+ litInf[4] = litInf[0];
+ litInf[1] = inSection.getListeUlar2()[0] / 2;
+ litInf[3] = litInf[1];
+ litInf[2] = inSection.getListeUlar1()[0] / 2;
+ out.setLstLitLinf(getDataDeLitRPTG(getFinalFloat(nomLits, litInf), nom, EnumTypeLoi.LstLitLinf));
- // Alimentation loi PsupDeLit
- rptgSection.setLstLitPsup(getDataDeLitRPTG(sectionAutreBranche.getListePerHaut(), nom, EnumTypeLoi.LstLitPsup));
- // Alimentation loi LsupDeLit
- rptgSection.setLstLitLsup(getDataDeLitRPTG(sectionAutreBranche.getListeLargHaut(), nom, EnumTypeLoi.LstLitLsup));
- // Alimentation loi KsupDeLit
- rptgSection.setLstLitKsup(getDataDeLitRPTG(sectionAutreBranche.getListeStriHaut(), nom, EnumTypeLoi.LstLitKsup));
- // Alimentation loi LinfDeLit
- rptgSection.setLstLitLinf(getDataDeLitRPTG(sectionAutreBranche.getListeLargFond(), nom, EnumTypeLoi.LstLitLinf));
- // Alimentation loi SsupDeLit
- rptgSection.setLstLitSsup(getDataDeLitRPTG(sectionAutreBranche.getListeSurfHaut(), nom, EnumTypeLoi.LstLitSsup));
+ float[] litSup = new float[nomLits.length];
+ litSup[0] = inSection.getListeUlar4()[inSection.getListeUlar4().length - 1] / 2;
+ litSup[4] = litInf[0];
+ litSup[1] = inSection.getListeUlar2()[inSection.getListeUlar2().length - 1] / 2;
+ litSup[3] = litInf[1];
+ litSup[2] = inSection.getListeUlar1()[inSection.getListeUlar1().length - 1] / 2;
+ out.setLstLitLsup(getDataDeLitRPTG(getFinalFloat(nomLits, litSup), nom, EnumTypeLoi.LstLitLsup));
- // Alimentation LitPos
- final int[] listeLitsExtremes = sectionAutreBranche.getListeLitExtreme();
- if (listeLitsExtremes != null) {
- final ResPrtDataLitPos litPos = new ResPrtDataLitPos();
- litPos.setNom(CruePrefix.P_LIT_POS + donneesSection.getNom());
- final EnumLitPosition[] valuesEnum = EnumLitPosition.values();
- final EnumLitPosition[] enums = new EnumLitPosition[listeLitsExtremes.length];
- for (int i = 0, imax = listeLitsExtremes.length; i < imax; i++) {
- int j = listeLitsExtremes[i];
- if (j >= 0 && j < valuesEnum.length) {
- enums[i] = valuesEnum[j];
- }
- // else {
- // System.err.println("aie");
- // }
+ float[] litPSup = new float[nomLits.length];
+ litPSup[0] = 0;
+ litPSup[4] = litInf[0];
+ litPSup[1] = inSection.getListePer2()[inSection.getListePer2().length - 1] / 2;
+ litPSup[3] = litInf[1];
+ litPSup[2] = inSection.getListePer1()[inSection.getListePer1().length - 1] / 2;
+ out.setLstLitPsup(getDataDeLitRPTG(getFinalFloat(nomLits, litPSup), nom, EnumTypeLoi.LstLitPsup));
+
+ float[] litSSup = new float[nomLits.length];
+ litSSup[0] = 0;
+ litSSup[4] = litInf[0];
+ litSSup[1] = inSection.getListeSec2()[inSection.getListeSec2().length - 1] / 2;
+ litSSup[3] = litInf[1];
+ litSSup[2] = inSection.getListeSec1()[inSection.getListeSec1().length - 1] / 2;
+ out.setLstLitPsup(getDataDeLitRPTG(getFinalFloat(nomLits, litSSup), nom, EnumTypeLoi.LstLitSsup));
+
+ List<DonneesStricklerPourLitSection> stricklers = in.getStricklers();
+ int max = Math.min(stricklers.size(), nomLits.length);
+ float[] litKs = new float[nomLits.length];
+ for (int i = 0; i < max; i++) {
+ DonneesStricklerPourLitSection stric = stricklers.get(i);
+ EvolutionReguliere evol = new EvolutionReguliere(getFinalFloat(stric.getZs()), getFinalFloat(stric.getKs()),
+ false);
+ litKs[i] = (float) evol.getInterpolateYValueFor(in.getZHaut());
+ }
+
+ // we build the discretisation in z:
+ final float[] abscissesZ = getDiscretisationEnZ(in);
+ // LoiZLact LoiFF STR.ular1(NbHaut) + STR.ular2(NbHaut)
+ specOut.setLoiZLact(getLoiFFDeZRPTG(abscissesZ, sum(inSection.getListeUlar1(), inSection.getListeUlar2()), nom,
+ EnumTypeLoi.LoiZLact));
+ // LoiZLsto LoiFF STR.ular4(NbHaut)
+ specOut.setLoiZLsto(getLoiFFDeZRPTG(abscissesZ, inSection.getListeUlar4(), nom, EnumTypeLoi.LoiZLsto));
+ // LoiZSact LoiFF STR.sec1(NbHaut) + STR.sec2(NbHaut)
+ specOut.setLoiZSact(getLoiFFDeZRPTG(abscissesZ, sum(inSection.getListeSec1(), inSection.getListeSec2()), nom,
+ EnumTypeLoi.LoiZSact));
+ // ZLimGLitSto double STR.dzg11
+ specOut.setzLimGLitSto(inSection.getDZg11());
+ // ZLimDLitSto double STR.dzd11
+ specOut.setzLimDLitSto(inSection.getDZd11());
+ // ZLimGLitMaj double STR.dzg12
+ specOut.setzLimGLitMaj(inSection.getDZg12());
+ // ZLimDLitMaj double STR.dzd12
+ specOut.setzLimDLitMaj(inSection.getDZd12());
+ // ZLimGLitMin double STR.dzg13
+ specOut.setzLimGLitMin(inSection.getDZg13());
+ // ZLimDLitMin double STR.dzd13
+ specOut.setzLimDLitMin(inSection.getDZd13());
+ // CoefKextrapol double STR.stric
+ specOut.setCoefKextrapol(inSection.getStric());
+
+ // LoiZSmin LoiFF STR.sec1(NbHaut)
+ specOut.setLoiZSmin(getLoiFFDeZRPTG(abscissesZ, inSection.getListeSec1(), nom, EnumTypeLoi.LoiZSmin));
+ // LoiZPmin LoiFF STR.per1(NbHaut)
+ specOut.setLoiZPmin(getLoiFFDeZRPTG(abscissesZ, inSection.getListePer1(), nom, EnumTypeLoi.LoiZPmin));
+ // LoiZLmin LoiFF STR.ular1(NbHaut)
+ specOut.setLoiZLmin(getLoiFFDeZRPTG(abscissesZ, inSection.getListeUlar1(), nom, EnumTypeLoi.LoiZLmin));
+ // LoiZSmaj LoiFF STR.sec2(NbHaut)
+ specOut.setLoiZSmaj(getLoiFFDeZRPTG(abscissesZ, inSection.getListeSec2(), nom, EnumTypeLoi.LoiZSmaj));
+ // LoiZPmaj LoiFF STR.per2(NbHaut)
+ specOut.setLoiZPmaj(getLoiFFDeZRPTG(abscissesZ, inSection.getListePer2(), nom, EnumTypeLoi.LoiZPmaj));
+ // LoiZLmaj LoiFF STR.ular2(NbHaut)
+ specOut.setLoiZLmaj(getLoiFFDeZRPTG(abscissesZ, inSection.getListeUlar2(), nom, EnumTypeLoi.LoiZLmaj));
+ // LoiZCoefW1 LoiFF STR.coefw1(NbHaut)
+ specOut.setLoiZCoefW1(getLoiFFDeZRPTG(abscissesZ, inSection.getListeCoefW1(), nom, EnumTypeLoi.LoiZCoefW1));
+ // LoiZCoefW2 LoiFF STR.coefw2(NbHaut)
+ specOut.setLoiZCoefW2(getLoiFFDeZRPTG(abscissesZ, inSection.getListeCoefW2(), nom, EnumTypeLoi.LoiZCoefW2));
+
+ }
+
+ private static void fillSectionPourAutreBranche(final DonneesSectionOuProfil inDonneesSection,
+ final ResPrtGeoSection outRptgSection) {
+ final String nom = outRptgSection.getNom();
+ final SectionPourAutreBranche sectionAutreBranche = (SectionPourAutreBranche) inDonneesSection
+ .getDonneesPourBranche();
+
+ final float[] abscissesZ = getDiscretisationEnZ(inDonneesSection);
+
+ // Alimentation loi LaDeZ
+ LoiFF loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeLargLitActif(), nom, EnumTypeLoi.LoiZLact);
+ if (loiFF != null) {
+ outRptgSection.setLoiZLact(loiFF);
+ }
+
+ // Alimentation loi DaDeZ
+
+ loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeDebLitActif(), nom, EnumTypeLoi.LoiZDact);
+ if (loiFF != null) {
+ outRptgSection.setLoiZDact(loiFF);
+ }
+
+ // Alimentation loi SaDeZ
+ loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeSLitActif(), nom, EnumTypeLoi.LoiZSact);
+ if (loiFF != null) {
+ outRptgSection.setLoiZSact(loiFF);
+ }
+
+ // Alimentation loi BetaDeZ
+ loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeBeta(), nom, EnumTypeLoi.LoiZBeta);
+ if (loiFF != null) {
+ outRptgSection.setLoiZBeta(loiFF);
+ }
+
+ // Alimentation loi LsDeZ
+ loiFF = getLoiFFDeZRPTG(abscissesZ, sectionAutreBranche.getListeLargSto(), nom, EnumTypeLoi.LoiZLsto);
+ if (loiFF != null) {
+ outRptgSection.setLoiZLsto(loiFF);
+ }
+
+ // Alimentation loi PsupDeLit
+ outRptgSection.setLstLitPsup(getDataDeLitRPTG(sectionAutreBranche.getListePerHaut(), nom, EnumTypeLoi.LstLitPsup));
+ // Alimentation loi LsupDeLit
+ outRptgSection.setLstLitLsup(getDataDeLitRPTG(sectionAutreBranche.getListeLargHaut(), nom, EnumTypeLoi.LstLitLsup));
+ // Alimentation loi KsupDeLit
+ outRptgSection.setLstLitKsup(getDataDeLitRPTG(sectionAutreBranche.getListeStriHaut(), nom, EnumTypeLoi.LstLitKsup));
+ // Alimentation loi LinfDeLit
+ outRptgSection.setLstLitLinf(getDataDeLitRPTG(sectionAutreBranche.getListeLargFond(), nom, EnumTypeLoi.LstLitLinf));
+ // Alimentation loi SsupDeLit
+ outRptgSection.setLstLitSsup(getDataDeLitRPTG(sectionAutreBranche.getListeSurfHaut(), nom, EnumTypeLoi.LstLitSsup));
+
+ // Alimentation LitPos
+ final int[] listeLitsExtremes = sectionAutreBranche.getListeLitExtreme();
+ if (listeLitsExtremes != null) {
+ final ResPrtDataLitPos litPos = createResLitPos(inDonneesSection);
+ final EnumLitPosition[] valuesEnum = EnumLitPosition.values();
+ final EnumLitPosition[] enums = new EnumLitPosition[listeLitsExtremes.length];
+ for (int i = 0, imax = listeLitsExtremes.length; i < imax; i++) {
+ int j = listeLitsExtremes[i];
+ if (j >= 0 && j < valuesEnum.length) {
+ enums[i] = valuesEnum[j];
}
- litPos.setPositions(enums);
- rptgSection.setLstLitPos(litPos);
}
- } else {
+ litPos.setPositions(enums);
+ outRptgSection.setLstLitPos(litPos);
+ }
+ }
- if (isTypeBrancheSpecCrue9) {
- // TODO to continue.
- }
+ private static ResPrtDataLitPos createResLitPos(final DonneesSectionOuProfil inDonneesSection) {
+ final ResPrtDataLitPos litPos = new ResPrtDataLitPos();
+ litPos.setNom(CruePrefix.changePrefix(CruePrefix.P_LIT_POS, inDonneesSection.getNom()));
+ return litPos;
+ }
+
+ private static float[] getDiscretisationEnZ(final DonneesSectionOuProfil inDonneesSection) {
+ // Calcul des abscisses z
+ final int nbHaut = inDonneesSection.getNbHaut();
+ final float dzpro = inDonneesSection.getDZpro();
+ final float zmin = inDonneesSection.getZf() + dzpro;
+ final float[] abscissesZ = new float[nbHaut];
+
+ for (int i = 0; i < nbHaut; i++) {
+ abscissesZ[i] = zmin + i * dzpro;
}
- return rptgSection;
+ return abscissesZ;
}
/**
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRReader.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -62,7 +62,7 @@
final int nbProfil = (int) (helper.getChannel().size() / data.longueurEnregistrement);
final int nbProfilStoRes = dimension.getNbRecProf();
if (nbProfilStoRes != nbProfil) {
- analyze_.addFatalError("io.str.nbProfil.wrong.error", Integer.valueOf(nbProfil));
+ analyze_.addError("io.str.nbProfil.wrong.error", Integer.valueOf(nbProfil));
return null;
}
@@ -73,7 +73,9 @@
final ByteBuffer bf = ByteBuffer.allocate(lengthNom);
helper.getChannel().read(bf, i * data.longueurEnregistrement);
bf.rewind();
- final String nom = STRSequentialReader.getStringFromBuffer(bf, lengthNom);
+
+ String nom = STRSequentialReader.getStringFromBuffer(bf, lengthNom);
+ // nom = CruePrefix.changePrefix(nom, EnumTypeEMH.SECTION);
data.nomProfils.add(nom);
data.nomProfilPosition.put(nom, i);
}
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/io/neuf/STRSequentialReader.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -20,9 +20,11 @@
import com.memoire.fu.FuLog;
import org.apache.commons.collections.map.LRUMap;
+import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluLibFile;
import org.fudaa.dodico.crue.metier.emh.AbstractResPrtGeoSectionContainer;
import org.fudaa.dodico.crue.metier.emh.ResPrtGeoSection;
+import org.fudaa.dodico.crue.validation.CruePrefix;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +41,7 @@
protected ByteOrder byteOrder;
/**
- * Permet d'avoir la correspondance entre le nom du profil et sa position dans le STR.
+ * Permet d'avoir la correspondance entre le nom du profil et sa position dans le STR. Rempli par StrReader.
*/
TObjectIntHashMap nomProfilPosition;
List<String> nomProfils;
@@ -159,14 +161,20 @@
final DonneesSectionOuProfil donneesSection = new DonneesSectionOuProfil();
String nom = getStringFromBuffer(bf, 16);
+ // nom = CruePrefix.changePrefix(nom, EnumTypeEMH.SECTION);
donneesSection.setNom(nom.trim());
donneesSection.setType(getStringFromBuffer(bf, 8).trim());
final int nTypBra = bf.getInt();
donneesSection.setNTypBra(nTypBra);
- donneesSection.setProfRef(getStringFromBuffer(bf, 16).trim());
+ String prefRef = getStringFromBuffer(bf, 16).trim();
+ donneesSection.setProfRef(prefRef);
donneesSection.setDZref(bf.getFloat());
- donneesSection.setNomCasier(getStringFromBuffer(bf, 16).trim());
+ String nomCasier = getStringFromBuffer(bf, 16).trim();
+ // if (StringUtils.isNotBlank(nomCasier)) {
+ // nomCasier = CruePrefix.changePrefix(nomCasier, EnumTypeEMH.CASIER);
+ // }
+ donneesSection.setNomCasier(nomCasier);
donneesSection.setDistAppliProfCasier(bf.getFloat());
final int nbLit = bf.getInt();
@@ -184,6 +192,9 @@
final String[] nomsLits = new String[nbLit];
for (int j = 0; j < nbLit; j++) {
nomsLits[j] = getStringFromBuffer(bf, 16).trim();
+ if (StringUtils.isNotBlank(nomsLits[j])) {
+ nomsLits[j] = CruePrefix.changePrefix(CruePrefix.P_LIT, nomsLits[j]);
+ }
}
donneesSection.setNomsLits(nomsLits);
// on ne lit pas le reste...
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumTypeLoi.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumTypeLoi.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/EnumTypeLoi.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -50,6 +50,14 @@
public final static EnumTypeLoi LstLitZf = new EnumTypeLoi("LstLitZf", BASE_TYPE_LOI);
public final static EnumTypeLoi LstLitPos = new EnumTypeLoi("LstLitPos", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZSmin = new EnumTypeLoi("LoiZSmin", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZSmaj = new EnumTypeLoi("LoiZSmaj", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZPmin = new EnumTypeLoi("LoiZPmin", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZPmaj = new EnumTypeLoi("LoiZPmaj", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZLmin = new EnumTypeLoi("LoiZLmin", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZLmaj = new EnumTypeLoi("LoiZLmaj", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZCoefW1 = new EnumTypeLoi("LoiZCoefW1", BASE_TYPE_LOI);
+ public static final EnumTypeLoi LoiZCoefW2 = new EnumTypeLoi("LoiZCoefW2", BASE_TYPE_LOI);
/**
* @param id l'identifiant de la loi
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtData.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtData.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtData.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -1,7 +1,5 @@
/***********************************************************************
- * Module: ResPrtData.java
- * Author: deniger
- * Purpose: Defines the Class ResPrtData
+ * Module: ResPrtData.java Author: deniger Purpose: Defines the Class ResPrtData
***********************************************************************/
package org.fudaa.dodico.crue.metier.emh;
Modified: trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSectionTypeBranche9.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSectionTypeBranche9.java 2010-05-06 15:56:10 UTC (rev 5751)
+++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/metier/emh/ResPrtGeoSectionTypeBranche9.java 2010-05-19 22:37:52 UTC (rev 5752)
@@ -16,16 +16,16 @@
private double zLimDLitMaj;
private double zLimGLitMin;
private double zLimDLitMin;
- private double zoefKextrapol;
+ private double coefKextrapol;
- private LoiFF ZSmin;
- private LoiFF ZPmin;
- private LoiFF ZLmin;
- private LoiFF ZSmaj;
- private LoiFF ZPmaj;
- private LoiFF ZLmaj;
- private LoiFF ZCoefW1;
- private LoiFF ZCoefW2;
+ private LoiFF loiZSmin;
+ private LoiFF loiZPmin;
+ private LoiFF loiZLmin;
+ private LoiFF loiZSmaj;
+ private LoiFF loiZPmaj;
+ private LoiFF loiZLmaj;
+ private LoiFF loiZCoefW1;
+ private LoiFF loiZCoefW2;
/**
* @return the zLimGLitSto
@@ -114,127 +114,127 @@
/**
* @return the zoefKextrapol
*/
- public double getZoefKextrapol() {
- return zoefKextrapol;
+ public double getCoefKextrapol() {
+ return coefKextrapol;
}
/**
* @param zoefKextrapol the zoefKextrapol to set
*/
- public void setZoefKextrapol(double zoefKextrapol) {
- this.zoefKextrapol = zoefKextrapol;
+ public void setCoefKextrapol(double zoefKextrapol) {
+ this.coefKextrapol = zoefKextrapol;
}
/**
* @return the zSmin
*/
- public LoiFF getZSmin() {
- return ZSmin;
+ public LoiFF getLoiZSmin() {
+ return loiZSmin;
}
/**
* @param zSmin the zSmin to set
*/
- public void setZSmin(LoiFF zSmin) {
- ZSmin = zSmin;
+ public void setLoiZSmin(LoiFF zSmin) {
+ loiZSmin = zSmin;
}
/**
* @return the zPmin
*/
- public LoiFF getZPmin() {
- return ZPmin;
+ public LoiFF getLoiZPmin() {
+ return loiZPmin;
}
/**
* @param zPmin the zPmin to set
*/
- public void setZPmin(LoiFF zPmin) {
- ZPmin = zPmin;
+ public void setLoiZPmin(LoiFF zPmin) {
+ loiZPmin = zPmin;
}
/**
*...
[truncated message content] |