Commit 66992741 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

tslint

Showing with 24 additions and 22 deletions
+24 -22
......@@ -408,25 +408,25 @@ export class CourbeRemous extends Nub {
}
// Définition des abscisses
let trX: number[] = [];
let trXabsc: number[] = [];
if (nFlu !== 0) {
trX = Object.keys(crbFlu).map((k) => +k);
trXabsc = Object.keys(crbFlu).map((k) => +k);
}
if (nTor !== 0) {
const kTor = Object.keys(crbTor).map((k) => +k);
trX = trX.concat(kTor);
trXabsc = trXabsc.concat(kTor);
}
// this.debug("trX=" + trX);
trX.sort((a, b) => {
trXabsc.sort((a, b) => {
if (a > b) { return 1; }
if (a < b) { return -1; }
return 0;
});
// this.debug("trX tri=" + trX);
trX = trX.filter((elem, index, array) => {
trXabsc = trXabsc.filter((elem, index, array) => {
if (index > 0) {
return elem !== array[index - 1];
}
......@@ -435,11 +435,11 @@ export class CourbeRemous extends Nub {
// this.debug("trX unique=" + trX);
this.debug("abscisses ");
this.logArray(trX);
this.logArray(trXabsc);
// compilation des résultats
for (const x of trX) {
for (const x of trXabsc) {
let ligneDeau;
if (crbFlu[x] === undefined) {
......
......@@ -35,7 +35,7 @@ export class cHautCritique extends acNewton {
}
// Calcul de la fonction
// if (this.Sn.Calc("S", rX) != 0)
// if (this.Sn.Calc("S", rX) !== 0)
if (rS.vCalc === 0) {
return new Result(new Message(MessageCode.ERROR_SECTION_SURFACE_NULLE));
}
......@@ -69,7 +69,7 @@ export class cHautCritique extends acNewton {
return rS;
}
const S = rS.vCalc;
// if (S != 0) {
// if (S !== 0) {
if (S === 0) {
return new Result(new Message(MessageCode.ERROR_SECTION_SURFACE_NULLE));
}
......@@ -241,6 +241,7 @@ export class cHautCorrespondante extends acNewton {
this.Y = Sn.prms.Y.v;
// this.rS2 = Math.pow(Sn.Calc("S"), -2);
this.Sn = Sn;
// tslint:disable-next-line:no-unused-expression
this.rS2; // pour initialiser la valeur @WTF (utilise le getter)
this.rQ2G = Math.pow(Sn.prms.Q.v, 2) / (2 * cParamsCanal.G);
}
......@@ -291,7 +292,7 @@ export class cHautCorrespondante extends acNewton {
const S = rS.vCalc;
// L'initialisation a été faite lors de l'appel à CalcFn
// if (S != 0)
// if (S !== 0)
if (S === 0) {
return new Result(new Message(MessageCode.ERROR_SECTION_SURFACE_NULLE));
}
......
......@@ -559,7 +559,7 @@ export abstract class acSection extends ComputeNode {
return rP;
}
// if (P != 0)
// if (P !== 0)
if (rP.vCalc === 0) {
return new Result(new Message(MessageCode.ERROR_SECTION_PERIMETRE_NUL));
}
......@@ -717,7 +717,7 @@ export abstract class acSection extends ComputeNode {
const hautCritique = new cHautCritique(this, this._newtonMaxIter, this.newtonDbg);
this._hautCritique = hautCritique.Newton(this.prms.YB.v);
// if (this.HautCritique == undefined || !hautCritique.hasConverged()) {
// if (this.HautCritique === undefined || !hautCritique.hasConverged()) {
if (!this._hautCritique.ok) {
const m = new Message(MessageCode.ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCRITIQUE);
// this.oLog.add(m);
......@@ -747,7 +747,7 @@ export abstract class acSection extends ComputeNode {
// let res = oHautNormale.Newton(this.CalcGeo("Yc"));
let rYN = oHautNormale.Newton(rYC.vCalc);
// if (res == undefined || !oHautNormale.hasConverged()) {
// if (res === undefined || !oHautNormale.hasConverged()) {
if (!rYN.ok) {
const m = new Message(MessageCode.ERROR_SECTION_NON_CONVERGENCE_NEWTON_HNORMALE);
// this.oLog.add(m);
......@@ -780,7 +780,7 @@ export abstract class acSection extends ComputeNode {
}
let rYF = oHautCorrespondante.Newton(rYC.vCalc * 2);
// if (res == undefined || !oHautCorrespondante.hasConverged()) {
// if (res === undefined || !oHautCorrespondante.hasConverged()) {
if (!rYF.ok) {
const m = new Message(MessageCode.ERROR_SECTION_NON_CONVERGENCE_NEWTON_HFLU);
// this.oLog.add(m);
......@@ -808,7 +808,7 @@ export abstract class acSection extends ComputeNode {
const oHautCorrespondante = new cHautCorrespondante(this, this._newtonMaxIter, this._newtonDbg);
// let res = oHautCorrespondante.Newton(this.CalcGeo("Yc") / 2);
let rYT = oHautCorrespondante.Newton(rGeoYC.vCalc / 2);
// if (res == undefined || !oHautCorrespondante.hasConverged()) {
// if (res === undefined || !oHautCorrespondante.hasConverged()) {
if (!rYT.ok) {
const m = new Message(MessageCode.ERROR_SECTION_NON_CONVERGENCE_NEWTON_HTOR);
// this.oLog.add(m);
......@@ -849,7 +849,7 @@ export abstract class acSection extends ComputeNode {
// tslint:disable-next-line:variable-name
const Yco: Result = oHautConj.Newton(Y0.vCalc);
// if (Yco == undefined || !oHautConj.hasConverged()) {
// if (Yco === undefined || !oHautConj.hasConverged()) {
if (!Yco.ok) {
const m = new Message(MessageCode.ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG);
// this.oLog.add(m);
......
......@@ -119,11 +119,12 @@ export class Session {
const nodeType: ComputeNodeType = params.getPropValue("nodeType");
let nub: Nub;
let prms: any;
switch (calcType) {
case CalculatorType.ConduiteDistributrice:
{
const prms = new ConduiteDistribParams(3, // débit Q
prms = new ConduiteDistribParams(3, // débit Q
1.2, // diamètre D
0.6, // perte de charge J
100, // Longueur de la conduite Lg
......@@ -135,7 +136,7 @@ export class Session {
case CalculatorType.LechaptCalmon:
{
const prms = new LechaptCalmonParams(3, // débit
prms = new LechaptCalmonParams(3, // débit
1.2, // diamètre
0.6, /// perte de charge
100, // longueur du toyo
......@@ -160,7 +161,7 @@ export class Session {
case CalculatorType.CourbeRemous:
{
const sectCR: acSection = this.createSection(nodeType, dbg);
const prms = new CourbeRemousParams(sectCR, 0.15, // Yamont = tirant amont
prms = new CourbeRemousParams(sectCR, 0.15, // Yamont = tirant amont
0.4, // Yaval = tirant aval
100, // Long= Longueur du bief
5, // Dx=Pas d'espace
......@@ -172,7 +173,7 @@ export class Session {
case CalculatorType.PabDimensions:
{
const prms = new PabDimensionParams(
prms = new PabDimensionParams(
2, // Longueur L
1, // Largeur W
0.5, // Tirant d'eau Y
......@@ -184,7 +185,7 @@ export class Session {
case CalculatorType.PabPuissance:
{
const prms = new PabPuissanceParams(
prms = new PabPuissanceParams(
0.3, // Chute entre bassins DH (m)
0.1, // Débit Q (m3/s)
0.5, // Volume V (m3)
......@@ -201,7 +202,7 @@ export class Session {
break;
case CalculatorType.ParallelStructure:
const prms = new ParallelStructureParams(0.5, // Q
prms = new ParallelStructureParams(0.5, // Q
102, // Z1
101.5 // Z2
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment