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; } /** * @return the zLmin */ - public LoiFF getZLmin() { - return ZLmin; + public LoiFF getLoiZLmin() { + return loiZLmin; } /** * @param zLmin the zLmin to set */ - public void setZLmin(LoiFF zLmin) { - ZLmin = zLmin; + public void setLoiZLmin(LoiFF zLmin) { + loiZLmin = zLmin; } /** * @return the zSmaj */ - public LoiFF getZSmaj() { - return ZSmaj; + public LoiFF getLoiZSmaj() { + return loiZSmaj; } /** * @param zSmaj the zSmaj to set */ - public void setZSmaj(LoiFF zSmaj) { - ZSmaj = zSmaj; + public void setLoiZSmaj(LoiFF zSmaj) { + loiZSmaj = zSmaj; } /** * @return the zPmaj */ - public LoiFF getZPmaj() { - return ZPmaj; + public LoiFF getLoiZPmaj() { + return loiZPmaj; } /** * @param zPmaj the zPmaj to set */ - public void setZPmaj(LoiFF zPmaj) { - ZPmaj = zPmaj; + public void setLoiZPmaj(LoiFF zPmaj) { + loiZPmaj = zPmaj; } /** * @return the zLmaj */ - public LoiFF getZLmaj() { - return ZLmaj; + public LoiFF getLoiZLmaj() { + return loiZLmaj; } /** * @param zLmaj the zLmaj to set */ - public void setZLmaj(LoiFF zLmaj) { - ZLmaj = zLmaj; + public void setLoiZLmaj(LoiFF zLmaj) { + loiZLmaj = zLmaj; } /** * @return the zCoefW1 */ - public LoiFF getZCoefW1() { - return ZCoefW1; + public LoiFF getLoiZCoefW1() { + return loiZCoefW1; } /** * @param zCoefW1 the zCoefW1 to set */ - public void setZCoefW1(LoiFF zCoefW1) { - ZCoefW1 = zCoefW1; + public void setLoiZCoefW1(LoiFF zCoefW1) { + loiZCoefW1 = zCoefW1; } /** * @return the zCoefW2 */ - public LoiFF getZCoefW2() { - return ZCoefW2; + public LoiFF getLoiZCoefW2() { + return loiZCoefW2; } /** * @param zCoefW2 the zCoefW2 to set */ - public void setZCoefW2(LoiFF zCoefW2) { - ZCoefW2 = zCoefW2; + public void setLoiZCoefW2(LoiFF zCoefW2) { + loiZCoefW2 = zCoefW2; } } 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-05-06 15:56:10 UTC (rev 5751) +++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/projet/ScenarioLoaderCrue9.java 2010-05-19 22:37:52 UTC (rev 5752) @@ -42,6 +42,7 @@ 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.EnumTypeEMH; import org.fudaa.dodico.crue.metier.emh.OrdPrtGeoModeleBase; import org.fudaa.dodico.crue.metier.emh.PlanimetrageNbrPdzCst; import org.fudaa.dodico.crue.metier.emh.RelationEMHSectionDansBranche; @@ -239,11 +240,12 @@ final int nbProfil = rptg.getNbResOnProfil(); for (int i = 0; i < nbProfil; i++) { final String nom = rptg.getProfilNom(i); - final String id = nom.toUpperCase(); + // c'est un profil de casier CatEMHCasier casier = null; - if (id.indexOf('#') > 0) { - final String ndNom = StringUtils.substringBeforeLast(id, "#"); + if (nom.indexOf('#') > 0) { + final String id = nom.toUpperCase(); + final String ndNom = CruePrefix.changePrefix(StringUtils.substringBeforeLast(id, "#"), EnumTypeEMH.NOEUD); final CatEMHNoeud nd = data.findNoeudByReference(ndNom); if (nd == null) { analyze.addFatalError("rptg.NoeudForCasier.notFound", ndNom, id); @@ -257,7 +259,8 @@ } } else { - final CatEMHSection nd = data.findSectionByReference(id); + final CatEMHSection nd = data.findSectionByReference(CruePrefix.changePrefix(nom.toUpperCase(), + EnumTypeEMH.SECTION)); if (nd == null) { error = true; analyze.addFatalError("rptg.section.notFound", nom); 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-05-06 15:56:10 UTC (rev 5751) +++ trunk/soft/fudaa-crue/dodico/src/main/java/org/fudaa/dodico/crue/validation/CruePrefix.java 2010-05-19 22:37:52 UTC (rev 5752) @@ -175,66 +175,42 @@ * @return le nom de la loit */ public static String changePrefix(final String nom, final String oldPref, final EnumTypeLoi typeLoi) { - return changePrefix(nom, oldPref, getPrefix(typeLoi)); + return changePrefix(cleanNom(nom), oldPref, getPrefix(typeLoi)); } - private static String addPrefix(final String newPref, final String nom) { - return changePrefix(nom, null, newPref); + public static String changePrefix(final String nom, final EnumTypeEMH typeEmh) { + return changePrefix(cleanNom(nom), null, getPrefix(typeEmh)); } - /** - * @param nom le nom initial - * @param oldPref l'ancien prefixe a enlever - * @param loi le type de loi - * @param sensOuv le sens d'ouverture - * @return le nom change - */ - public static String addPrefix(String nom, EnumTypeLoi loi) { - return changePrefix(nom, null, getPrefix(loi)); + public static String changePrefix(final String newPref, final String nom) { + return changePrefix(cleanNom(nom), null, newPref); } public static String addPrefixs(String nomEMH, EnumTypeLoi loi, EnumTypeEMH typeEMH) { return changePrefix(getNomAvecPrefixFor(nomEMH, typeEMH), null, getPrefix(loi)); } - /** - * Modifie le nom et renvoie true si modifié - * - * @param emh - */ - public static void addPrefixIfNeeded(final EMH emh) { - if (emh != null) { - emh.setNom(getNomAvecPrefix(emh)); - } - } - - public static String getNomAvecPrefix(final EMH emh) { + private static String getNomAvecPrefix(final EMH emh) { if (emh == null) { return null; } final String prefix = getPrefixFor(emh); return getNomAvecPrefixe(prefix, emh.getNom()); } - public static String getNomAvecPrefixForBranche(final String nom) { - return getNomAvecPrefixFor(nom, EnumTypeEMH.BRANCHE); - } - - public static String getNomAvecPrefixFor(final String nom, EnumTypeEMH type) { + private static String getNomAvecPrefixFor(final String nom, EnumTypeEMH type) { if (nom == null) { return null; } - final String prefix = ENUM_PREFIX.get(type); + final String prefix = getPrefix(type); return getNomAvecPrefixe(prefix, nom); } + private static String getPrefix(EnumTypeEMH type) { + return ENUM_PREFIX.get(type); + } + private static String getPrefixFor(final EMH emh) { - final String prefix = ENUM_PREFIX.get(emh.getCatType()); + final String prefix = getPrefix(emh.getCatType()); return prefix; } - // public static String getNomAvecPrefix(final Loi loi) { - // if (loi == null) { return null; } - // final String prefix = getPrefix(loi.getType()); - // return getNomAvecPrefixe(prefix, loi.getNom()); - // } - /** * La taille max autorisé pour les noms crue 9 */ @@ -278,33 +254,9 @@ } /** - * @param prefixe - * @param loi - */ - public static void addPrefixIfNeeded(final String prefixe, final ObjetNomme loi) { - - if (loi == null) { return; } - - loi.setNom(getNomAvecPrefixe(prefixe, loi.getNom())); - } - - /** - * @param prefixe - * @param iterator - */ - public static void addPrefixIfNeeded(final String prefixe, final Iterator iterator) { - - if (iterator == null) { return; } - while (iterator.hasNext()) { - final ObjetNomme loi = (ObjetNomme) iterator.next(); - CruePrefix.addPrefixIfNeeded(prefixe, loi); - } - } - - /** * @param param */ - public static void addPrefixIfNeeded(final ValParam param) { + private static void addPrefixIfNeeded(final ValParam param) { if (param == null) { return; } @@ -316,7 +268,7 @@ * @param nomInitial le nom intial * @return le nom transforme. */ - public static String getNomAvecPrefixe(final String prefixe, final String nomInitialNonClean) { + private static String getNomAvecPrefixe(final String prefixe, final String nomInitialNonClean) { // pas de nom initial: on ne fait rien if (nomInitialNonClean == null) { return null; } final String nomInitial = cleanNom(nomInitialNonClean); Modified: trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml =================================================================== --- trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml 2010-05-06 15:56:10 UTC (rev 5751) +++ trunk/soft/fudaa-crue/dodico/src/main/resources/configLoi.xml 2010-05-19 22:37:52 UTC (rev 5752) @@ -155,7 +155,79 @@ <VarAbscisse>Z</VarAbscisse> <VarOrdonnee>Vol</VarOrdonnee> </ConfigLoi> + <!-- A confirmer --> <ConfigLoi> + <Type>LoiZSmin</Type> + <Commentaire>Smin en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>Smin</VarOrdonnee> + </ConfigLoi> + <!-- A confirmer --> + <ConfigLoi> + <Type>LoiZSmaj</Type> + <Commentaire>Smaj en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>Smaj</VarOrdonnee> + </ConfigLoi> + <!-- A confirmer --> + <ConfigLoi> + <Type>LoiZPmin</Type> + <Commentaire>Pmin en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>Pmin</VarOrdonnee> + </ConfigLoi> + <!-- A confirmer --> + <ConfigLoi> + <Type>LoiZPmaj</Type> + <Commentaire>Pmaj en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>Pmaj</VarOrdonnee> + </ConfigLoi> + <!-- A confirmer --> + <ConfigLoi> + <Type>LoiZLmin</Type> + <Commentaire>Lmin en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>Lmin</VarOrdonnee> + </ConfigLoi> + <!-- A confirmer --> + <ConfigLoi> + <Type>LoiZLmaj</Type> + <Commentaire>Lmaj en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>Lmaj</VarOrdonnee> + </ConfigLoi> + <!-- A confirmer --> + <ConfigLoi> + <Type>LoiZCoefW1</Type> + <Commentaire>CoefW2 en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>CoefW1</VarOrdonnee> + </ConfigLoi> + <!-- A confirmer --> + <ConfigLoi> + <Type>LoiZCoefW2</Type> + <Commentaire>coefW1 en fonction de la cote</Commentaire> + <ExtrapolInf>ValCst</ExtrapolInf> + <ExtrapolSup>ValCst</ExtrapolSup> + <VarAbscisse>Z</VarAbscisse> + <VarOrdonnee>CoefW2</VarOrdonnee> + </ConfigLoi> + <ConfigLoi> <Type>LstLitKsup</Type> <Commentaire>Strickler à la cote supérieure du lit</Commentaire> <ExtrapolInf>Aucune</ExtrapolInf> Modified: trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv =================================================================== --- trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv 2010-05-06 15:56:10 UTC (rev 5751) +++ trunk/soft/fudaa-crue/dodico/src/main/resources/crue-variable.csv 2010-05-19 22:37:52 UTC (rev 5752) @@ -6,6 +6,12 @@ "CoefCtrLim";"CoefCtr";0.65;">0.0";;">=0.6";"<=1.0" "CoefD";"CoefD";1;">0.0";;">=0.2";"<=1.0" "CoefDiv";"CoefDiv";0;">=0.0";;">=0.0";"<=1.0" +#a confirmer +"coefKextrapol";"CoefDiv";0;">=0.0";;">=0.0";"<=1.0" +#a confirmer +"coefW2";"CoefDiv";0;">=0.0";;">=0.0";"<=1.0" +#a confirmer +"coefW1";"CoefDiv";0;">=0.0";;">=0.0";"<=1.0" "CoefPdc";"CoefPdc";1;">0.0";;">=0.2";"<=1.0" "CoefPond";"CoefPond";0.5;">0.0";;">=0.5";"<=1.0" "CoefRelaxQ";"CoefRelax";1;">0.0";;; @@ -53,6 +59,8 @@ "LargeurFente";"Dy";;">0.0";;">0.0";"<=1.0" "Linf";"Dy";;">=0.0";;">0.0"; "Lit";"Num";;;;; +"Lmin";"Dy";;">=0.0";;">0.0"; +"Lmaj";"Dy";;">=0.0";;">0.0"; "Longueur";"Dx";;">=0.0";;; "LongueurMajeur";"Dx";;">=0.0";;">0.0"; "LongueurMineur";"Dx";;">=0.0";;">0.0"; @@ -69,6 +77,8 @@ "OuvVersBas";"Ouv";;">=0.0";;">=0.0";"<=100.0" "OuvVersHaut";"Ouv";;">=0.0";;">=0.0";"<=100.0" "P";"Dy";;">=0.0";;">0.0"; +"Pmin";"Dy";;">=0.0";;">0.0"; +"Pmaj";"Dy";;">=0.0";;">0.0"; "Pdc";"Pdc";;">=0.0";;;"<=30.0" "Pdt";"Dt";;">0.0";;">=0.01";"<=86400.0" "PdtCouplage";"Dt";;">0.0";;">=1.0";"<=86400.0" @@ -111,6 +121,8 @@ "RegleProfPlat";"Jfy";;">=0.0";;">0.0";"<=0.1" "Sact";"S";;">=0.0";;">0.0"; "Sens";"Enum";"Bidirect";;;; +"Smin";"S";;">=0.0";;">0.0"; +"Smaj";"S";;">=0.0";;">0.0"; "Splan";"Splan";;">=0.0";;; "SplanBati";"Splan";;">=0.0";;; "Ssto";"S";;">=0.0";;; @@ -136,6 +148,12 @@ "Yc";"Dz";;">=0.0";;;"<=100.0" "Yn";"Dz";;">=0.0";;;"<=100.0" "Z";"Z";;;;">=0.0";"<=4000.0" +"ZLimGLitSto";"Z";;;;">=0.0";"<=4000.0" +"ZLimDLitSto";"Z";;;;">=0.0";"<=4000.0" +"zLimGLitMaj";"Z";;;;">=0.0";"<=4000.0" +"zLimDLitMaj";"Z";;;;">=0.0";"<=4000.0" +"zLimGLitMin";"Z";;;;">=0.0";"<=4000.0" +"zLimDLitMin";"Z";;;;">=0.0";"<=4000.0" "Zam";"Z";;;;">=0.0";"<=4000.0" "Zav";"Z";;;;">=0.0";"<=4000.0" "ZBatiTotal";"Z";;;;; Modified: 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/io/TestCrueSTR.java 2010-05-06 15:56:10 UTC (rev 5751) +++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueSTR.java 2010-05-19 22:37:52 UTC (rev 5752) @@ -71,8 +71,9 @@ testAnalyser(analyzer); assertEquals(nbProf, res.getNbResOnProfil()); for (int i = 0; i < nbProf; i++) { - System.err.println(res.getProfilNom(i)); - assertFalse(StringUtils.isBlank(res.getProfilNom(i))); + String profilNom = res.getProfilNom(i); + assertFalse(StringUtils.isBlank(profilNom)); + assertNotNull(res.getResultatOnProfil(profilNom).getResultat()); } assertEquals(nbCasier, res.getNbResOnCasier()); for (int i = 0; i < nbCasier; i++) { Modified: 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/TestCruePrefix.java 2010-05-06 15:56:10 UTC (rev 5751) +++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/validation/TestCruePrefix.java 2010-05-19 22:37:52 UTC (rev 5752) @@ -5,7 +5,7 @@ import junit.framework.TestCase; -import org.fudaa.dodico.crue.metier.emh.EMHNoeudFactory; +import org.fudaa.dodico.crue.metier.emh.EnumTypeEMH; /** * @author deniger @@ -17,50 +17,20 @@ * Teste le changement de prefixe */ public void testChangePrefixe() { - EMHNoeudFactory nodeFactory = new EMHNoeudFactory(); - assertEquals(expected, CruePrefix - .getNomAvecPrefix(nodeFactory.getNode("test")/* new EMHNoeudNiveauContinu("test") */)); - assertEquals("Nd_tes_t", CruePrefix.getNomAvecPrefix(nodeFactory.getNode("tes#t")/* - * new - * EMHNoeudNiveauContinu("tes#t") - */)); - assertEquals("Nd_tes_t", CruePrefix.getNomAvecPrefix(nodeFactory.getNode("tes/t")/* - * new - * EMHNoeudNiveauContinu("tes/t") - */)); - assertEquals(expected, CruePrefix.getNomAvecPrefix(nodeFactory.getNode("ND_test")/* - * new - * EMHNoeudNiveauContinu("ND_test") - */)); - assertEquals(expected, CruePrefix.getNomAvecPrefix(nodeFactory.getNode("nd_test")));/* - * new - * EMHNoeudNiveauContinu("nd_test" - * ) - */ + assertEquals(expected, CruePrefix.changePrefix("test", EnumTypeEMH.NOEUD)); + assertEquals("Nd_tes_t", CruePrefix.changePrefix("tes#t", EnumTypeEMH.NOEUD)); + assertEquals("Nd_tes_t", CruePrefix.changePrefix("tes/t", EnumTypeEMH.NOEUD)); + assertEquals(expected, CruePrefix.changePrefix("ND_test", EnumTypeEMH.NOEUD)); } /** * Teste le changement de prefixe si ce dernier commence par un autre prefix */ public void testChangePrefixeDouble() { - EMHNoeudFactory nodeFactory = new EMHNoeudFactory(); - assertEquals(expected, CruePrefix.getNomAvecPrefix(nodeFactory.getNode("st_test")/* - * new - * EMHNoeudNiveauContinu("st_test") - */)); - assertEquals(expected, CruePrefix.getNomAvecPrefix(nodeFactory.getNode("St_test")/* - * new - * EMHNoeudNiveauContinu("St_test") - */)); - assertEquals(expected, CruePrefix.getNomAvecPrefix(nodeFactory.getNode("ST_test")/* - * new - * EMHNoeudNiveauContinu("ST_test") - */)); - assertEquals("Nd_SI_test", CruePrefix.getNomAvecPrefix(nodeFactory.getNode("SI_test")/* - * new - * EMHNoeudNiveauContinu("SI_test" - * ) - */)); + assertEquals(expected, CruePrefix.changePrefix("st_test", "st_", CruePrefix.P_NOEUD)); + assertEquals(expected, CruePrefix.changePrefix("St_test", "st_", CruePrefix.P_NOEUD)); + assertEquals(expected, CruePrefix.changePrefix("ST_test", "st_", CruePrefix.P_NOEUD)); + assertEquals(expected, CruePrefix.changePrefix("SI_test", "si_", CruePrefix.P_NOEUD)); } } 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-05-06 15:56:10 UTC (rev 5751) +++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/explorer/CrueLauncher.java 2010-05-19 22:37:52 UTC (rev 5752) @@ -76,8 +76,8 @@ infoCrue_.banner = new BuIcon(pathLogo); // infoCrue_.logo = new BuIcon(pathLogo); infoCrue_.name = "Fudaa-Crue"; - infoCrue_.version = "0.26"; - infoCrue_.date = "19-Avril-2010"; + infoCrue_.version = "0.27"; + infoCrue_.date = "20-Mai-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. |