diff options
Diffstat (limited to 'js/Hydraulics/PerteDP.js')
-rw-r--r-- | js/Hydraulics/PerteDP.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/js/Hydraulics/PerteDP.js b/js/Hydraulics/PerteDP.js index c9fd922e..de0ebb69 100644 --- a/js/Hydraulics/PerteDP.js +++ b/js/Hydraulics/PerteDP.js @@ -1,30 +1,30 @@ /* autogenerated from "macros/Hydraulics/PerteDP.sci" */ function PerteDP() { PerteDP.prototype.define = function PerteDP() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.L = 10; this.D = 0.2; this.lambda = 0.03; this.z1 = 0; this.z2 = 0; this.p_rho = 0; - model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; - model.sim = "PerteDP"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; + this.model.sim = new ScilabString("PerteDP"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PerteDP"; mo.inputs = "C1"; mo.outputs = "C2"; mo.parameters = list([["L"],["D"],["lambda"],["z1"],["z2"],["p_rho"]],[[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.L)],[string(this.D)],[string(this.lambda)],[string(this.z1)],[string(this.z2)],[string(this.p_rho)]]; gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -53,17 +53,17 @@ function PerteDP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho,exprs] = scicos_getvalue("Parametres du tuyau",["Longueur du tube : L (m)","Diamètre interne du tube : D (m)","Coefficient de perte de charge-frottement(S.U) : lambda","Altitude entrée tuyauterie : z1 (m)","Altitude sortie tuyauterie : z2 (m)","Si >0, masse volumique imposée fu fluide : p_rho (kg/m3)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; - model.equations.parameters[2-1] = list(this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho); + this.model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; + this.model.equations.parameters[('2', 'double')] = list(this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); |