|
From: <de...@us...> - 2010-10-18 21:36:18
|
Revision: 5985
http://fudaa.svn.sourceforge.net/fudaa/?rev=5985&view=rev
Author: deniger
Date: 2010-10-18 21:36:11 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarBcMng.java
trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarOuvrage.java
trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt
trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarCLIReader.java
trunk/business/dodico-h2d/pom.xml
Modified: trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarBcMng.java
===================================================================
--- trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarBcMng.java 2010-10-18 00:18:17 UTC (rev 5984)
+++ trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarBcMng.java 2010-10-18 21:36:11 UTC (rev 5985)
@@ -1,8 +1,12 @@
/*
* @creation 9 juin 2004
+ *
* @modification $Date: 2007-04-30 14:21:34 $
+ *
* @license GNU General Public License 2
+ *
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ *
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.rubar;
@@ -305,7 +309,7 @@
// ecriture des indices errones dans le fichier de log
if (timeNotDefined.size() > 0) {
final String s = DodicoLib.getS("Des conditions limites ont \xE9t\xE9 cr\xE9\xE9es par d\xE9faut");
- _an.addError(s + CtuluLibString.LINE_SEP + DodicoLib.getS("Les indices sont dans le fichier de log"), -1);
+ _an.addWarn(s + CtuluLibString.LINE_SEP + DodicoLib.getS("Les indices sont dans le fichier de log"), -1);
CtuluLibMessage.info(s);
CtuluLibMessage.info(CtuluLibString.arrayToString(timeNotDefined.toNativeArray()));
_cliChanged[0] = true;
@@ -378,9 +382,7 @@
* @return les aretes entrantes dans l'ordre utilise par le fichier dat.
*/
protected int[] getAreteEntrante() {
- if ((externeAretes_ == null) || (externeAretes_.length == 0)) {
- return new int[0];
- }
+ if ((externeAretes_ == null) || (externeAretes_.length == 0)) { return new int[0]; }
final TIntArrayList l = new TIntArrayList(externeAretes_.length);
for (int i = 0; i < externeAretes_.length; i++) {
if (externeAretes_[i].isExternAndLiquidAndTransient(type_)) {
@@ -445,9 +447,7 @@
}
private void createDefaultCurves() {
- if (defaultEvolForConcentration_ != null) {
- return;
- }
+ if (defaultEvolForConcentration_ != null) { return; }
defaultEvolForConcentration_ = H2dRubarEvolution.createH2dRubarEvolution(H2dVariableTransType.CONCENTRATION,
new EvolutionReguliere(), this);
defaultEvolForConcentration_.setNom(H2dResource.getS("D\xE9faut"));
@@ -511,9 +511,7 @@
}
public void iterateOnTarageCurves(final H2dEvolutionUseCounter _m) {
- if (tarages_ == null) {
- return;
- }
+ if (tarages_ == null) { return; }
for (int i = 0; i < getNbBcArete(); i++) {
final int global = getGlobalIdx(i);
final EvolutionReguliereInterface evol = tarages_.getEvol(global);
@@ -648,9 +646,7 @@
public H2dRubarTimeConditionInterface[] getCliInOrder() {
H2dRubarTimeConditionInterface[] r = null;
final int[] idx = getAreteEntrante();
- if (idx == null) {
- return null;
- }
+ if (idx == null) { return null; }
r = new H2dRubarTimeConditionInterface[idx.length];
for (int i = 0; i < idx.length; i++) {
final int globalIdx = idx[i];
@@ -673,15 +669,11 @@
public boolean hasDataForCli() {
final int[] idx = getAreteEntrante();
- if (idx == null) {
- return false;
- }
+ if (idx == null) { return false; }
for (int i = 0; i < idx.length; i++) {
final int globalIdx = idx[i];
final H2dRubarBoundaryType type = g_.getRubarArete(globalIdx).getType();
- if (!H2dRubarBcTypeList.TARAGE.equals(type) && !H2dRubarBcTypeList.CRITIQUE.equals(type)) {
- return true;
- }
+ if (!H2dRubarBcTypeList.TARAGE.equals(type) && !H2dRubarBcTypeList.CRITIQUE.equals(type)) { return true; }
}
return false;
}
@@ -733,25 +725,15 @@
}
protected boolean verifyTimeData(final int[] _areteIdx, final H2dRubarBoundaryType _t, final H2dRubarTimeCondition _s) {
- if (_t.isTypeDebitGlobal()) {
- return verifyGroupDebit(_t, _s);
- }
+ if (_t.isTypeDebitGlobal()) { return verifyGroupDebit(_t, _s); }
final List l = getVariableRequired(_t);
- if ((l == null) || (l.size() == 0)) {
- return true;
- }
+ if ((l == null) || (l.size() == 0)) { return true; }
final List varNotSet = _s.isVariableRequiredSet(l);
- if (varNotSet == null) {
- return true;
- }
+ if (varNotSet == null) { return true; }
for (int i = _areteIdx.length - 1; i >= 0; i--) {
final H2dRubarTimeCondition c = (H2dRubarTimeCondition) timeCl_.get(_areteIdx[i]);
- if (c == null) {
- return false;
- }
- if (!c.isVariableSet(varNotSet)) {
- return false;
- }
+ if (c == null) { return false; }
+ if (!c.isVariableSet(varNotSet)) { return false; }
}
return true;
@@ -785,9 +767,8 @@
public CtuluPermanentList getAllTimeVar() {
if (timeVars_ == null) {
if (type_ == H2dRubarProjetType.COURANTOLOGIE_2D) {
- timeVars_ = new CtuluPermanentList(
- CtuluLibArray.sort(new Object[] { H2dVariableType.DEBIT_NORMAL, H2dVariableType.DEBIT_TANGENTIEL,
- H2dVariableType.COTE_EAU }));
+ timeVars_ = new CtuluPermanentList(CtuluLibArray.sort(new Object[] { H2dVariableType.DEBIT_NORMAL,
+ H2dVariableType.DEBIT_TANGENTIEL, H2dVariableType.COTE_EAU }));
} else {
timeVars_ = new CtuluPermanentList(CtuluLibArray.sort(new Object[] { H2dVariableType.DEBIT_NORMAL,
H2dVariableType.DEBIT_TANGENTIEL, H2dVariableType.COTE_EAU, H2dVariableTransType.CONCENTRATION }));
@@ -816,9 +797,7 @@
* @return les valeurs communes a ces index
*/
public H2dRubarTimeConditionCommon getCommonTimeCondition(final int[] _ar) {
- if ((_ar == null) || (_ar.length == 0)) {
- return H2dRubarTimeConditionCommon.getEmptyCommon();
- }
+ if ((_ar == null) || (_ar.length == 0)) { return H2dRubarTimeConditionCommon.getEmptyCommon(); }
H2dRubarArete a = g_.getRubarArete(_ar[0]);
H2dRubarTimeConditionCommon r0 = null;
if (a.getType().isTypeDebitGlobal()) {
@@ -837,9 +816,7 @@
} else {
r0.keepSameEvolution((H2dRubarTimeCondition) timeCl_.get(_ar[i]));
}
- if (r0.isNothingInCommons()) {
- return r0;
- }
+ if (r0.isNothingInCommons()) { return r0; }
}
return r0;
}
@@ -893,9 +870,7 @@
*/
public List getUsedBoundaryType() {
final Set r = new HashSet(15);
- if (externeAretes_ == null) {
- return Collections.EMPTY_LIST;
- }
+ if (externeAretes_ == null) { return Collections.EMPTY_LIST; }
for (int i = externeAretes_.length - 1; i >= 0; i--) {
r.add(externeAretes_[i].getType());
}
@@ -909,9 +884,7 @@
* @return la list des variables correspondantes
*/
public List getVariableAllowed(final H2dRubarBoundaryType _t) {
- if (_t == null) {
- return null;
- }
+ if (_t == null) { return null; }
return _t.getAllowedVariable(type_);
}
@@ -943,18 +916,12 @@
* @return true si le type de bord est utilise
*/
public boolean isUsedBoundaryType(final H2dRubarBoundaryType _t) {
- if (externeAretes_ == null || _t == null) {
- return false;
- }
- if (_t.isSolide()) {
- return externeAretes_.length != timeCl_.size();
- }
+ if (externeAretes_ == null || _t == null) { return false; }
+ if (_t.isSolide()) { return externeAretes_.length != timeCl_.size(); }
final TIntObjectIterator it = timeCl_.iterator();
for (int i = timeCl_.size(); i-- > 0;) {
it.advance();
- if (_t == g_.getRubarArete(it.key()).getType()) {
- return true;
- }
+ if (_t == g_.getRubarArete(it.key()).getType()) { return true; }
}
return false;
}
@@ -1038,9 +1005,7 @@
public CtuluCommand setDefined(final H2dRubarBoundaryFlowrateGroupType _t, final H2dRubarEvolution _qn,
final H2dRubarEvolution _qt, final H2dRubarEvolution _h) {
final H2dRubarEvolution h = _h == H2dRubarParameters.NON_TORENTIEL ? null : _h;
- if (isDefined(_t)) {
- return null;
- }
+ if (isDefined(_t)) { return null; }
if (flowrateGroups_ == null) {
flowrateGroups_ = new TreeMap();
}
@@ -1074,15 +1039,11 @@
*/
public CtuluCommand setEvolution(final H2dRubarBoundaryFlowrateGroupType _t, final H2dRubarEvolution _evolInit,
final H2dVariableType _type) {
- if (!isDefined(_t)) {
- return null;
- }
+ if (!isDefined(_t)) { return null; }
final H2dRubarEvolution evol = _evolInit == H2dRubarParameters.NON_TORENTIEL ? null : _evolInit;
final H2dRubarTimeCondition r = getGroupTimeCondition(_t);
final H2dRubarEvolution old = r.getEvol(_type);
- if (old == evol) {
- return null;
- }
+ if (old == evol) { return null; }
final CtuluCommandCompositeInverse cmd = new CtuluCommandCompositeInverse();
r.setEvolution(_type, evol, cmd);
fireFlowrateGroupChanged(_t);
@@ -1111,9 +1072,7 @@
* @return la commande si modif
*/
public CtuluCommand setUndefined(final H2dRubarBoundaryFlowrateGroupType _t) {
- if (!isDefined(_t) || isUsedBoundaryType(_t)) {
- return null;
- }
+ if (!isDefined(_t) || isUsedBoundaryType(_t)) { return null; }
final H2dRubarTimeCondition timeMem = (H2dRubarTimeCondition) flowrateGroups_.remove(_t);
fireFlowrateGroupChanged(_t);
return new CtuluCommand() {
@@ -1131,9 +1090,7 @@
}
public static void groupCommonsCurves(final TIntObjectHashMap _idxCl) {
- if (_idxCl == null) {
- return;
- }
+ if (_idxCl == null) { return; }
final Object[] o = _idxCl.getValues();
if (!CtuluLibArray.isEmpty(o)) {
Modified: trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarOuvrage.java
===================================================================
--- trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarOuvrage.java 2010-10-18 00:18:17 UTC (rev 5984)
+++ trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarOuvrage.java 2010-10-18 21:36:11 UTC (rev 5985)
@@ -1,8 +1,12 @@
/*
* @creation 3 janv. 2005
+ *
* @modification $Date: 2007-04-30 14:21:34 $
+ *
* @license GNU General Public License 2
+ *
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ *
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.rubar;
@@ -53,18 +57,14 @@
}
public H2dRubarOuvrageElementaireInterface[] getElementaireOuvrages() {
- if (ouvIntern_ == null || ouvIntern_.getSize() == 0) {
- return null;
- }
+ if (ouvIntern_ == null || ouvIntern_.getSize() == 0) { return null; }
final H2dRubarOuvrageElementaireInterface[] r = new H2dRubarOuvrageElementaireInterface[ouvIntern_.getSize()];
ouvIntern_.toArray(r);
return r;
}
public H2dRubarOuvrageElementaireInterface[] getCopyOfElementaireOuvrages() {
- if (ouvIntern_ == null || ouvIntern_.getSize() == 0) {
- return null;
- }
+ if (ouvIntern_ == null || ouvIntern_.getSize() == 0) { return null; }
final H2dRubarOuvrageElementaireInterface[] r = new H2dRubarOuvrageElementaireInterface[ouvIntern_.getSize()];
for (int i = r.length - 1; i >= 0; i--) {
r[i] = getOuvrageElementaire(i).getCopyWithoutEvt();
@@ -81,9 +81,7 @@
}
public double getXa2() {
- if (isElt2Set()) {
- return mng_.getGrid().getRubarGrid().getXCentreArete(arete2_);
- }
+ if (isElt2Set()) { return mng_.getGrid().getRubarGrid().getXCentreArete(arete2_); }
return mng_.getGrid().getGrid().getMaxX() + 100;
}
@@ -92,9 +90,7 @@
}
public double getXe2() {
- if (isElt2Set()) {
- return mng_.getGrid().getGrid().getMoyCentreXElement(elt2_);
- }
+ if (isElt2Set()) { return mng_.getGrid().getGrid().getMoyCentreXElement(elt2_); }
return mng_.getGrid().getGrid().getMaxX() + 100;
}
@@ -109,9 +105,7 @@
}
public double getYa2() {
- if (isElt2Set()) {
- return mng_.getGrid().getRubarGrid().getYCentreArete(arete2_);
- }
+ if (isElt2Set()) { return mng_.getGrid().getRubarGrid().getYCentreArete(arete2_); }
return mng_.getGrid().getGrid().getMaxY() + 100;
}
@@ -120,9 +114,7 @@
}
public double getYe2() {
- if (isElt2Set()) {
- return mng_.getGrid().getGrid().getMoyCentreYElement(elt2_);
- }
+ if (isElt2Set()) { return mng_.getGrid().getGrid().getMoyCentreYElement(elt2_); }
return mng_.getGrid().getGrid().getMaxY() + 100;
}
@@ -216,7 +208,8 @@
if (r.elt1_ < 0) {
if (_analyze != null) {
- _analyze.addError(H2dResource.getS("L'\xE9l\xE9ment {0} ne peut pas \xEAtre retrouv\xE9"), _i);
+ _analyze.addError(H2dResource.getS("L'\xE9l\xE9ment de l'ouvrage {0} ne peut pas \xEAtre retrouv\xE9", Integer
+ .toString(_i + 1)), _i);
}
return null;
}
@@ -304,9 +297,7 @@
* @return true si les elements 1 et 2 sont adjacents
*/
public static boolean isAdjacent(final int _elt1, final int _elt2, final H2dRubarGridAreteSource _grid) {
- if (_elt1 == _elt2) {
- return true;
- }
+ if (_elt1 == _elt2) { return true; }
final int[] idx = _grid.elementsVoisinsParElement()[_elt1];
return CtuluLibArray.findInt(idx, _elt2) >= 0;
}
@@ -337,9 +328,7 @@
if (_elt2 >= 0) {
set.add(_elt2);
}
- if (set.size() == 1) {
- return true;
- }
+ if (set.size() == 1) { return true; }
final int[] sel = set.toArray();
Arrays.sort(sel);
return isSelectionCorrect(sel, _grid);
@@ -348,9 +337,7 @@
protected static void parcourt(final int _i, final int[] _selectedIdx, final boolean[] _done,
final boolean[] _traverse, final H2dRubarGridAreteSource _grid) {
final int[] adjacent = _grid.elementsVoisinsParElement()[_selectedIdx[_i]];
- if (_done[_i]) {
- return;
- }
+ if (_done[_i]) { return; }
_done[_i] = true;
for (int i = adjacent.length - 1; i >= 0; i--) {
final int idxInSelected = Arrays.binarySearch(_selectedIdx, adjacent[i]);
@@ -368,18 +355,12 @@
* @return true si la selection est correcte
*/
public static boolean isSelectionCorrect(final int[] _selectedIdx, final H2dRubarGridAreteSource _grid) {
- if (_selectedIdx == null || _selectedIdx.length == 0) {
- return false;
- }
- if (_selectedIdx.length == 1) {
- return true;
- }
+ if (_selectedIdx == null || _selectedIdx.length == 0) { return false; }
+ if (_selectedIdx.length == 1) { return true; }
final boolean[] traverse = new boolean[_selectedIdx.length];
parcourt(0, _selectedIdx, new boolean[_selectedIdx.length], traverse, _grid);
for (int i = traverse.length - 1; i >= 0; i--) {
- if (!traverse[i]) {
- return false;
- }
+ if (!traverse[i]) { return false; }
}
return true;
}
@@ -394,14 +375,10 @@
* @return true si l'element 1 est adjacent oua au moins un element du tableau _elt2
*/
public static boolean isAdjacent(final int _elt1, final int[] _tabElt2, final H2dRubarGridAreteSource _grid) {
- if (_tabElt2 == null || _tabElt2.length == 0) {
- return true;
- }
+ if (_tabElt2 == null || _tabElt2.length == 0) { return true; }
final int[] idx = _grid.elementsVoisinsParElement()[_elt1];
for (int i = _tabElt2.length - 1; i >= 0; i--) {
- if ((_elt1 != _tabElt2[i]) && (CtuluLibArray.findInt(idx, _tabElt2[i]) >= 0)) {
- return true;
- }
+ if ((_elt1 != _tabElt2[i]) && (CtuluLibArray.findInt(idx, _tabElt2[i]) >= 0)) { return true; }
}
return false;
}
@@ -416,9 +393,7 @@
*/
public static int[][] testElementIntern(final int _i1, final int _i2, final int[] _initialElt,
final H2dRubarGridAreteSource _src) {
- if (_initialElt == null) {
- return null;
- }
+ if (_initialElt == null) { return null; }
final TIntHashSet r = new TIntHashSet(_initialElt.length);
final TIntHashSet falseIdx = new TIntHashSet(_initialElt.length);
for (int i = _initialElt.length - 1; i >= 0; i--) {
@@ -496,9 +471,7 @@
}
// max 5.
- if (_elem.length > 5) {
- return false;
- }
+ if (_elem.length > 5) { return false; }
for (int i = _elem.length - 1; i >= 0; i--) {
_elem[i].ouvrageParent_ = this;
}
@@ -529,13 +502,9 @@
*/
public boolean setReference(final H2dRubarOuvrageRef _ref, final CtuluCommandContainer _cmd) {
// nouvelle ref null ou identique a l'ancienne : on ne fait rien
- if (_ref == null || _ref == rubarRef_) {
- return false;
- }
+ if (_ref == null || _ref == rubarRef_) { return false; }
// pour une ref de -2 l'element 2 doit etre initialise
- if (_ref.getRubarCode() == -2 && !isElt2Set()) {
- return false;
- }
+ if (_ref.getRubarCode() == -2 && !isElt2Set()) { return false; }
final H2dRubarOuvrageRef old = rubarRef_;
if (_cmd != null) {
_cmd.addCmd(new CtuluCommand() {
Modified: trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt
===================================================================
--- trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt 2010-10-18 00:18:17 UTC (rev 5984)
+++ trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt 2010-10-18 21:36:11 UTC (rev 5985)
@@ -346,6 +346,8 @@
Apport d\xE9bit=Flowrate inflow
Transfert d\xE9bit=Flowrate transfer
L'\xE9l\xE9ment {0} ne peut pas \xEAtre retrouv\xE9=The element {0} can't be found
+L'\xE9l\xE9ment de l'ouvrage {0} ne peut pas \xEAtre retrouv\xE9=The element of the structure {0} can't be found
+Erreur dans la lecture du fichier cli=Error occured while opening cli file
Les \xE9l\xE9ments ne sont pas adjacents=The elements are not adjacent
L'ar\xEAte {0} est mal d\xE9finie=The edge {0} is is undefined
Cote de la cr\xEAte de la digue=Elevation of the top of the dike
Modified: trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarCLIReader.java
===================================================================
--- trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarCLIReader.java 2010-10-18 00:18:17 UTC (rev 5984)
+++ trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarCLIReader.java 2010-10-18 21:36:11 UTC (rev 5985)
@@ -92,7 +92,7 @@
return null;
}
if (source[source.length - 1] == null) {
- analyze_.addFatalError(H2dResource.getS("Erreur dans la lecture"));
+ analyze_.addError(H2dResource.getS("Erreur dans la lecture du fichier cli"));
}
// verif pas de temps
if (source.length > 0) {
Modified: trunk/business/dodico-h2d/pom.xml
===================================================================
--- trunk/business/dodico-h2d/pom.xml 2010-10-18 00:18:17 UTC (rev 5984)
+++ trunk/business/dodico-h2d/pom.xml 2010-10-18 21:36:11 UTC (rev 5985)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.fudaa.pom</groupId>
<artifactId>business-pom</artifactId>
- <version>0.5</version>
+ <version>0.7</version>
</parent>
<groupId>org.fudaa.business.dodico-h2d</groupId>
<artifactId>dodico-h2d</artifactId>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|