|
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 {0} non trouv\u00E9e.
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-12-01 17:02:25 UTC (rev 5519)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java 2009-12-02 17:06:03 UTC (rev 5520)
@@ -70,12 +70,8 @@
final DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode("root");
if (!data.isEmpty()) {
+ addNodesForEMH(root, data);
- final TreeNodeString rootScenario = new TreeNodeString("Scénarios");
- root.add(rootScenario);
-
- addNodesForEMH(rootScenario, data);
-
final TreeNodeString rootModels = new TreeNodeString("Modèles");
root.add(rootModels);
@@ -149,7 +145,7 @@
return parent;
}
- private static void addNodesForEMH(final TreeNodeString rootNodes, final EMH emh) {
+ private static void addNodesForEMH(final DefaultMutableTreeTableNode rootNodes, final EMH emh) {
final TreeNodeEMH nodeEMH = new TreeNodeEMH(emh);
rootNodes.add(nodeEMH);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|