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

Fixed bug in CalcSerie() for SectionParametree

Showing with 25 additions and 12 deletions
+25 -12
...@@ -339,17 +339,9 @@ export abstract class Nub extends ComputeNode implements IObservable { ...@@ -339,17 +339,9 @@ export abstract class Nub extends ComputeNode implements IObservable {
} }
// find calculated parameter // find calculated parameter
let computedSymbol: any; const computedSymbol = this.findCalculatedParameter(sDonnee);
if (sDonnee) {
computedSymbol = sDonnee;
} else {
if (this.calculatedParam === undefined) {
throw new Error(`CalcSerie() : aucun paramètre à calculer`);
}
computedSymbol = this.calculatedParamDescriptor;
}
if (rInit === undefined) { if (rInit === undefined && this.calculatedParam) {
rInit = this.calculatedParam.v; rInit = this.calculatedParam.v;
} }
...@@ -436,8 +428,10 @@ export abstract class Nub extends ComputeNode implements IObservable { ...@@ -436,8 +428,10 @@ export abstract class Nub extends ComputeNode implements IObservable {
this.progress = 100; this.progress = 100;
} }
const realSymbol = (typeof computedSymbol === "string") ? computedSymbol : computedSymbol.symbol; if (computedSymbol !== undefined) {
this._result.name = realSymbol; const realSymbol = (typeof computedSymbol === "string") ? computedSymbol : computedSymbol.symbol;
this._result.name = realSymbol;
}
this.notifyResultUpdated(); this.notifyResultUpdated();
...@@ -1141,6 +1135,19 @@ export abstract class Nub extends ComputeNode implements IObservable { ...@@ -1141,6 +1135,19 @@ export abstract class Nub extends ComputeNode implements IObservable {
this._observable.notifyObservers(data, sender); this._observable.notifyObservers(data, sender);
} }
protected findCalculatedParameter(sDonnee: any): any {
let computedSymbol: any;
if (sDonnee) {
computedSymbol = sDonnee;
} else {
if (this.calculatedParam === undefined) {
throw new Error(`CalcSerie() : aucun paramètre à calculer`);
}
computedSymbol = this.calculatedParamDescriptor;
}
return computedSymbol;
}
protected doCalc(computedSymbol?: any, rInit?: number) { protected doCalc(computedSymbol?: any, rInit?: number) {
return this.Calc(computedSymbol, rInit); return this.Calc(computedSymbol, rInit);
} }
......
...@@ -137,6 +137,12 @@ export class SectionParametree extends SectionNub { ...@@ -137,6 +137,12 @@ export class SectionParametree extends SectionNub {
return this._result; return this._result;
} }
// calculated param is always "Y"
protected findCalculatedParameter(sDonnee: any): any {
return undefined;
}
// calculated param is always "Y"
protected doCalc(computedSymbol?: any, rInit?: number) { protected doCalc(computedSymbol?: any, rInit?: number) {
return this.Calc(); return this.Calc();
} }
......
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