Commit 0ce46e46 authored by Dorchies David's avatar Dorchies David
Browse files

Closes #51

+ MAJ package.json
+ ParallelStructure Gestion message d'erreur sur débits trop élevé sur calcul d'un paramètre d'ouvrage
parent 7db012b7
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@types/jasmine": { "@types/jasmine": {
"version": "2.8.2", "version": "2.8.8",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.8.2.tgz", "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.8.8.tgz",
"integrity": "sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug==", "integrity": "sha512-OJSUxLaxXsjjhob2DBzqzgrkLmukM3+JMpRp0r0E4HTdT1nwDCWhaswjYxazPij6uOdzHCJfNbDjmQ1/rnNbCg==",
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "8.0.53", "version": "10.5.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.53.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz",
"integrity": "sha512-54Dm6NwYeiSQmRB1BLXKr5GELi0wFapR1npi8bnZhEcu84d/yQKqnwwXQ56hZ0RUbTG6L5nqDZaN3dgByQXQRQ==", "integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q==",
"dev": true "dev": true
}, },
"ansi-regex": { "ansi-regex": {
...@@ -28,6 +28,15 @@ ...@@ -28,6 +28,15 @@
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
"dev": true "dev": true
}, },
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
"sprintf-js": "1.0.3"
}
},
"babel-code-frame": { "babel-code-frame": {
"version": "6.26.0", "version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
...@@ -107,10 +116,10 @@ ...@@ -107,10 +116,10 @@
} }
} }
}, },
"coffee-script": { "coffeescript": {
"version": "1.12.7", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.3.1.tgz",
"integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==", "integrity": "sha512-DNJmSPMyiz+OjWYyuDXNBcFutDjP2TS2owsZ8YvT65hA8c5IdHWIBqdA3Yf/XHoK23d/f1HqLjQbEJJZJoeV1w==",
"dev": true "dev": true
}, },
"color-convert": { "color-convert": {
...@@ -152,90 +161,24 @@ ...@@ -152,90 +161,24 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true "dev": true
}, },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
"esutils": { "esutils": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true "dev": true
}, },
"exit": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
"integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
"dev": true
},
"fileset": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz",
"integrity": "sha1-UGuRqTluqn4y+0KoQHfHoMc2t0E=",
"dev": true,
"requires": {
"glob": "3.2.11",
"minimatch": "0.4.0"
},
"dependencies": {
"glob": {
"version": "3.2.11",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=",
"dev": true,
"requires": {
"inherits": "2.0.3",
"minimatch": "0.3.0"
},
"dependencies": {
"minimatch": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=",
"dev": true,
"requires": {
"lru-cache": "2.7.3",
"sigmund": "1.0.1"
}
}
}
},
"minimatch": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.4.0.tgz",
"integrity": "sha1-vSx9Bg0sjI/Xzefx8u0tWycP2xs=",
"dev": true,
"requires": {
"lru-cache": "2.7.3",
"sigmund": "1.0.1"
}
}
}
},
"fs.realpath": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true "dev": true
}, },
"gaze": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz",
"integrity": "sha1-X5S92gr+U7xxCWm81vKCVI1gwnk=",
"dev": true,
"requires": {
"fileset": "0.1.8",
"minimatch": "0.2.14"
},
"dependencies": {
"minimatch": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=",
"dev": true,
"requires": {
"lru-cache": "2.7.3",
"sigmund": "1.0.1"
}
}
}
},
"glob": { "glob": {
"version": "7.1.2", "version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
...@@ -250,11 +193,16 @@ ...@@ -250,11 +193,16 @@
"path-is-absolute": "1.0.1" "path-is-absolute": "1.0.1"
} }
}, },
"growl": { "globule": {
"version": "1.7.0", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.7.0.tgz", "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz",
"integrity": "sha1-3i1mE20ALhErpw8/EMMc98NQsto=", "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==",
"dev": true "dev": true,
"requires": {
"glob": "7.1.2",
"lodash": "4.17.10",
"minimatch": "3.0.4"
}
}, },
"has-ansi": { "has-ansi": {
"version": "2.0.0", "version": "2.0.0",
...@@ -288,45 +236,61 @@ ...@@ -288,45 +236,61 @@
"dev": true "dev": true
}, },
"jasmine": { "jasmine": {
"version": "2.8.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.1.0.tgz",
"integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", "integrity": "sha1-K9Wf1+xuwOistk4J9Fpo7SrRlSo=",
"dev": true, "dev": true,
"requires": { "requires": {
"exit": "0.1.2",
"glob": "7.1.2", "glob": "7.1.2",
"jasmine-core": "2.8.0" "jasmine-core": "3.1.0"
} }
}, },
"jasmine-core": { "jasmine-core": {
"version": "2.8.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.1.0.tgz",
"integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=", "integrity": "sha1-pHheE11d9lAk38kiSVPfWFvSdmw=",
"dev": true "dev": true
}, },
"jasmine-growl-reporter": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/jasmine-growl-reporter/-/jasmine-growl-reporter-0.0.3.tgz",
"integrity": "sha1-uHrlUeNZ0orVIXdl6u9sB7dj9sg=",
"dev": true,
"requires": {
"growl": "1.7.0"
}
},
"jasmine-node": { "jasmine-node": {
"version": "1.14.5", "version": "1.15.0",
"resolved": "https://registry.npmjs.org/jasmine-node/-/jasmine-node-1.14.5.tgz", "resolved": "https://registry.npmjs.org/jasmine-node/-/jasmine-node-1.15.0.tgz",
"integrity": "sha1-GOg5e4VpJO53ADZmw3MbWupQw50=", "integrity": "sha512-W8ehdkjov8kaVEdGmqmfobuJk04NmYarfVKAl/HUeVsCxP+E25pcW+l6Y46yXMthjj+3Qi3gaWkC+LU8toqa2w==",
"dev": true, "dev": true,
"requires": { "requires": {
"coffee-script": "1.12.7", "coffeescript": "2.3.1",
"gaze": "0.3.4", "gaze": "1.1.3",
"jasmine-growl-reporter": "0.0.3", "jasmine-growl-reporter": "1.0.1",
"jasmine-reporters": "1.0.2", "jasmine-reporters": "1.0.2",
"mkdirp": "0.3.5", "mkdirp": "0.3.5",
"requirejs": "2.3.5", "requirejs": "2.3.5",
"underscore": "1.8.3", "underscore": "1.8.3",
"walkdir": "0.0.12" "walkdir": "0.0.12"
},
"dependencies": {
"gaze": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz",
"integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==",
"dev": true,
"requires": {
"globule": "1.2.1"
}
},
"growl": {
"version": "1.10.5",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
"jasmine-growl-reporter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/jasmine-growl-reporter/-/jasmine-growl-reporter-1.0.1.tgz",
"integrity": "sha512-dh7VjP3l0OLxL9+sw5vK6RrdH4gdHCNkTnUd9orViHDPr7Fe8LsXY+IObWauS2hX5khMFtjKRZCfTcDHKAjm/A==",
"dev": true,
"requires": {
"growl": "1.10.5"
}
}
} }
}, },
"jasmine-reporters": { "jasmine-reporters": {
...@@ -344,10 +308,20 @@ ...@@ -344,10 +308,20 @@
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
"dev": true "dev": true
}, },
"lru-cache": { "js-yaml": {
"version": "2.7.3", "version": "3.12.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
"integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
"dev": true,
"requires": {
"argparse": "1.0.10",
"esprima": "4.0.1"
}
},
"lodash": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
"dev": true "dev": true
}, },
"minimatch": { "minimatch": {
...@@ -407,10 +381,10 @@ ...@@ -407,10 +381,10 @@
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
"dev": true "dev": true
}, },
"sigmund": { "sprintf-js": {
"version": "1.0.1", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true "dev": true
}, },
"strip-ansi": { "strip-ansi": {
...@@ -435,9 +409,9 @@ ...@@ -435,9 +409,9 @@
"dev": true "dev": true
}, },
"tslint": { "tslint": {
"version": "5.8.0", "version": "5.11.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.8.0.tgz", "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz",
"integrity": "sha1-H0mtWy53x2w69N3K5VKuTjYS6xM=", "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=",
"dev": true, "dev": true,
"requires": { "requires": {
"babel-code-frame": "6.26.0", "babel-code-frame": "6.26.0",
...@@ -446,26 +420,29 @@ ...@@ -446,26 +420,29 @@
"commander": "2.12.2", "commander": "2.12.2",
"diff": "3.4.0", "diff": "3.4.0",
"glob": "7.1.2", "glob": "7.1.2",
"js-yaml": "3.12.0",
"minimatch": "3.0.4", "minimatch": "3.0.4",
"resolve": "1.5.0", "resolve": "1.5.0",
"semver": "5.4.1", "semver": "5.4.1",
"tslib": "1.8.1", "tslib": "1.8.1",
"tsutils": "2.13.0" "tsutils": "2.28.0"
}
}, },
"dependencies": {
"tsutils": { "tsutils": {
"version": "2.13.0", "version": "2.28.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.13.0.tgz", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.28.0.tgz",
"integrity": "sha512-FuWzNJbMsp3gcZMbI3b5DomhW4Ia41vMxjN63nKWI0t7f+I3UmHfRl0TrXJTwI2LUduDG+eR1Mksp3pvtlyCFQ==", "integrity": "sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA==",
"dev": true, "dev": true,
"requires": { "requires": {
"tslib": "1.8.1" "tslib": "1.8.1"
} }
}
}
}, },
"typescript": { "typescript": {
"version": "2.6.1", "version": "2.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.6.1.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
"integrity": "sha1-7znN6ierrAtQAkLWcmq5DgyEZjE=", "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==",
"dev": true "dev": true
}, },
"underscore": { "underscore": {
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
"module": "build/index.js", "module": "build/index.js",
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@types/jasmine": "2.8.2", "@types/jasmine": "2.8.8",
"@types/node": "8.0.53", "@types/node": "10.5.2",
"jasmine": "2.8.0", "jasmine": "3.1.0",
"jasmine-core": "2.8.0", "jasmine-core": "3.1.0",
"jasmine-node": "1.14.5", "jasmine-node": "1.15.0",
"tslint": "5.8.0", "tslint": "5.11.0",
"typescript": "2.6.1" "typescript": "2.9.2"
}, },
"scripts": { "scripts": {
"build": "npm run preprocess; ./node_modules/typescript/bin/tsc --p src/tsconfig.app.json", "build": "npm run preprocess; ./node_modules/typescript/bin/tsc --p src/tsconfig.app.json",
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
// import { describe, expect, it, xdescribe, xit } from "../mock_jasmine"; // import { describe, expect, it, xdescribe, xit } from "../mock_jasmine";
import { MessageCode } from "../../src";
import { CreateStructure } from "../../src/structure/factory_structure"; import { CreateStructure } from "../../src/structure/factory_structure";
import { ParallelStructure } from "../../src/structure/parallel_structure"; import { ParallelStructure } from "../../src/structure/parallel_structure";
import { ParallelStructureParams } from "../../src/structure/parallel_structure_params"; import { ParallelStructureParams } from "../../src/structure/parallel_structure_params";
...@@ -38,6 +39,12 @@ describe("Class ParallelStructure: ", () => { ...@@ -38,6 +39,12 @@ describe("Class ParallelStructure: ", () => {
itParallelStructure("Q", 30, 15); itParallelStructure("Q", 30, 15);
itParallelStructure("Z1", 30, 15); itParallelStructure("Z1", 30, 15);
itParallelStructure("Z2", 15, 15); itParallelStructure("Z2", 15, 15);
itParallelStructure("0.ZDV", 0, 15);
itParallelStructure("1.ZDV", 0, 15);
it("shoud return an error Q too high", () => {
pstruct.prms.Q.v = 15;
expect(pstruct.Calc("1.ZDV").code).toBe(MessageCode.ERROR_STRUCTURE_Q_TROP_ELEVE);
});
}); });
}); });
......
...@@ -40,7 +40,7 @@ class StructureTest extends Structure { ...@@ -40,7 +40,7 @@ class StructureTest extends Structure {
Structure.CheckEquation(sVarCalc); Structure.CheckEquation(sVarCalc);
const data = this.getResultData(); const data = this.getResultData();
return new Result(this.prms.Z1.v - this.prms.Z2.v, data); return new Result(this.prms.Z1.v - this.prms.Z2.v - this.prms.ZDV.v, data);
} }
/** /**
......
...@@ -201,6 +201,8 @@ export class ParallelStructure extends Nub { ...@@ -201,6 +201,8 @@ export class ParallelStructure extends Nub {
// Pour les caractéristiques des ouvrages // Pour les caractéristiques des ouvrages
const sVC = this.getStructureVarCalc(sVarCalc); const sVC = this.getStructureVarCalc(sVarCalc);
res = this.CalcStructPrm(sVC, rInit, rPrec); res = this.CalcStructPrm(sVC, rInit, rPrec);
// Suppression des extraResults : ils sont complétés plus bas pour chaque ouvrage
res.resultElement.extraResults = {};
if (res.ok) { if (res.ok) {
this.structures[sVC.index].getParameter(sVC.prm).setValue(res.vCalc); this.structures[sVC.index].getParameter(sVC.prm).setValue(res.vCalc);
} }
......
...@@ -144,9 +144,11 @@ export abstract class Structure extends Nub { ...@@ -144,9 +144,11 @@ export abstract class Structure extends Nub {
default: default:
rPrm = 0; rPrm = 0;
} }
// TODO Ajouter un message d'erreur const res: Result = new Result(new Message(MessageCode.ERROR_STRUCTURE_Q_TROP_ELEVE), flagsNull);
res.vCalc = rPrm;
// "Les cotes et le débit ne sont pas cohérents => fermeture de l'ouvrage // "Les cotes et le débit ne sont pas cohérents => fermeture de l'ouvrage
return new Result(rPrm, flagsNull); return res;
} }
} }
......
...@@ -221,6 +221,11 @@ export enum MessageCode { ...@@ -221,6 +221,11 @@ export enum MessageCode {
*/ */
ERROR_STRUCTURE_ZDV_PAS_CALCULABLE, ERROR_STRUCTURE_ZDV_PAS_CALCULABLE,
/**
* Le débit passant par les autres ouvrages est trop important
*/
ERROR_STRUCTURE_Q_TROP_ELEVE,
/** /**
* StructureKivi : La pelle du seuil doit mesurer au moins 0,1 m. Le coefficient béta est forcé à 0. * StructureKivi : La pelle du seuil doit mesurer au moins 0,1 m. Le coefficient béta est forcé à 0.
*/ */
......
import { JalhydObject } from "../jalhyd_object"; import { JalhydObject } from "../jalhyd_object";
import { NamedIterableValues, NumberIterator, NumberArrayReverseIterator, NumberArrayIterator } from "../param/param-value-iterator"; // tslint:disable-next-line:max-line-length
import { NamedIterableValues, NumberArrayIterator, NumberArrayReverseIterator, NumberIterator } from "../param/param-value-iterator";
import { cLog } from "./log"; import { cLog } from "./log";
import { Message, MessageCode, MessageSeverity } from "./message"; import { Message, MessageCode, MessageSeverity } from "./message";
import { ResultElement } from "./resultelement"; import { ResultElement } from "./resultelement";
...@@ -267,14 +268,11 @@ export class Result extends JalhydObject implements NamedIterableValues { ...@@ -267,14 +268,11 @@ export class Result extends JalhydObject implements NamedIterableValues {
// interface NamedIterableValues // interface NamedIterableValues
public get name(): string {
return this._name;
}
public get valuesIterator(): NumberIterator { public get valuesIterator(): NumberIterator {
const tmp: number[] = []; const tmp: number[] = [];
for (const re of this._resultElements) for (const re of this._resultElements) {
tmp.push(re.vCalc); tmp.push(re.vCalc);
}
return tmp[Symbol.iterator]() as NumberIterator; return tmp[Symbol.iterator]() as NumberIterator;
} }
...@@ -296,8 +294,9 @@ export class Result extends JalhydObject implements NamedIterableValues { ...@@ -296,8 +294,9 @@ export class Result extends JalhydObject implements NamedIterableValues {
} }
} }
if (found) if (found) {
return res; return res;
}
return undefined; return undefined;
} }
...@@ -308,10 +307,11 @@ export class Result extends JalhydObject implements NamedIterableValues { ...@@ -308,10 +307,11 @@ export class Result extends JalhydObject implements NamedIterableValues {
vals.push(r.vCalc); vals.push(r.vCalc);
} }
if (reverse) if (reverse) {
this._iterator = new NumberArrayReverseIterator(vals); this._iterator = new NumberArrayReverseIterator(vals);
else } else {
this._iterator = new NumberArrayIterator(vals); this._iterator = new NumberArrayIterator(vals);
}
return this._iterator; return this._iterator;
} }
...@@ -325,8 +325,9 @@ export class Result extends JalhydObject implements NamedIterableValues { ...@@ -325,8 +325,9 @@ export class Result extends JalhydObject implements NamedIterableValues {