org.fudaa.dodico.telemac.io.TelemacCLTomawacVersion Maven / Gradle / Ivy
/**
* @creation 1 juin 2004
* @modification $Date: 2006-09-28 13:40:00 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail [email protected]
*/
package org.fudaa.dodico.telemac.io;
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.h2d.resource.H2dResource;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLElementSource;
import org.fudaa.dodico.h2d.type.H2dBoundaryHouleType;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dBoundaryTypeCommon;
/**
* @author Fred Deniger
* @version $Id: TelemacCLTomawacVersion.java,v 1.12 2006-09-28 13:40:00 deniger Exp $
*/
public class TelemacCLTomawacVersion extends TelemacCLVersion {
/**
* @param _v
*/
public TelemacCLTomawacVersion(final String _v) {
super(_v);
}
@Override
public final int getCodeLibre() {
return 4;
}
/**
* @return le code impose
*/
public final int getCodeImpose() {
return 5;
}
@Override
public void getFileLineFromH2dData(final CtuluAnalyze _r, final TelemacCLLine _target,
final H2dTelemacCLElementSource _source, final int _indexFrontiere) {
initDefaultData(_target, _source, _indexFrontiere);
final H2dBoundaryType t = _source.bordType_;
int r = -1;
if (t.equals(H2dBoundaryHouleType.FRONTIERE_LIBRE)) {
r = getCodeLibre();
} else if (t.equals(H2dBoundaryHouleType.FRONTIERE_VALEURS_IMPOSEES)) {
r = getCodeImpose();
} else if (t.equals(H2dBoundaryTypeCommon.SOLIDE)) {
r = getCodeSolide();
} else {
if (_r != null) {
_r.addError(H2dResource.getS("Le type de bord est incompatible avec le projet"), _indexFrontiere);
}
r = getCodeLibre();
}
_target.lihbor_ = r;
}
@Override
public boolean getH2dDataFromFile(final CtuluAnalyze _r, final H2dTelemacCLElementSource _target,
final TelemacCLLine _l, final int _indicesFrontieres) {
initH2dData(_target, _l);
final int id = _l.lihbor_;
if (id == getCodeLibre()) {
_target.bordType_ = H2dBoundaryHouleType.FRONTIERE_LIBRE;
} else if (id == getCodeImpose()) {
_target.bordType_ = H2dBoundaryHouleType.FRONTIERE_VALEURS_IMPOSEES;
} else if (id == getCodeSolide()) {
_target.bordType_ = H2dBoundaryTypeCommon.SOLIDE;
} else {
if (_r != null) {
_r.addFatalError(H2dResource.getS("Codes inconnus"));
}
return false;
}
return true;
}
@Override
public boolean isCodeHauteur(final int _c) {
return (_c == 4) || (_c == 5) || (_c == 2);
}
@Override
public boolean isCodeTraceur(final int _c) {
return true;
}
@Override
public boolean isCodeVitesse(final int _c) {
return true;
}
}