summaryrefslogtreecommitdiff
path: root/js/Hydraulics
diff options
context:
space:
mode:
Diffstat (limited to 'js/Hydraulics')
-rw-r--r--js/Hydraulics/Bache.js31
-rw-r--r--js/Hydraulics/Bache.pickle6
-rw-r--r--js/Hydraulics/Flowmeter.js65
-rw-r--r--js/Hydraulics/Flowmeter.pickle6
-rw-r--r--js/Hydraulics/PerteDP.js31
-rw-r--r--js/Hydraulics/PerteDP.pickle6
-rw-r--r--js/Hydraulics/PuitsP.js29
-rw-r--r--js/Hydraulics/PuitsP.pickle6
-rw-r--r--js/Hydraulics/SourceP.js29
-rw-r--r--js/Hydraulics/SourceP.pickle6
-rw-r--r--js/Hydraulics/VanneReglante.js31
-rw-r--r--js/Hydraulics/VanneReglante.pickle6
12 files changed, 135 insertions, 117 deletions
diff --git a/js/Hydraulics/Bache.js b/js/Hydraulics/Bache.js
index e8e30f10..9a0d0a11 100644
--- a/js/Hydraulics/Bache.js
+++ b/js/Hydraulics/Bache.js
@@ -29,30 +29,31 @@ function Bache() {
model.out = ones(size(mo.outputs,"*"),1);
exprs = [[string(Patm)],[string(A)],[string(ze1)],[string(ze2)],[string(zs1)],[string(zs2)],[string(z0)],[string(T0)],[string(p_rho)]];
gr_i = [];
- x = standard_define([2,2],model,exprs,list(gr_i,0));
- x.graphics.in_implicit = [["I"],["I"]];
- x.graphics.out_implicit = [["I"],["I"],["E"]];
+ this.x = standard_define([2,2],model,exprs,list(gr_i,0));
+ this.x.graphics.in_implicit = [["I"],["I"]];
+ this.x.graphics.out_implicit = [["I"],["I"],["E"]];
}
Bache.prototype.details = function Bache() {
+ return this.x;
}
Bache.prototype.get = function Bache() {
}
Bache.prototype.set = function Bache() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,Patm,A,ze1,ze2,zs1,zs2,z0,T0,p_rho,exprs] = scicos_getvalue("Parametres de la bache",[["Pression dans le ciel de la bache : Patm (Pa)"],["Section de la bache : A (m2)"],["Altitude du piquage d entrée 1: ze1 (m)"],["Altitude du piquage d entrée 2: ze2 (m)"],["Altitude du piquage de sortie 1: zs1 (m)"],["Altitude du piquage de sortie 2: zs2 (m)"],["Altitude initiale du fluide : z0 (m)"],["Température initiale du fluide : T0 (K)"],["Si >0, masse volumique imposée du fluide : p_rho (kg/m3)"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs);
- if (!ok) {
-break;
-}
- model.rpar = [[Patm],[A],[ze1],[ze2],[zs1],[zs2],[z0],[T0],[p_rho]];
- model.equations.parameters[2-1] = list(Patm,A,ze1,ze2,zs1,zs2,z0,T0,p_rho);
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,Patm,A,ze1,ze2,zs1,zs2,z0,T0,p_rho,exprs] = scicos_getvalue("Parametres de la bache",[["Pression dans le ciel de la bache : Patm (Pa)"],["Section de la bache : A (m2)"],["Altitude du piquage d entrée 1: ze1 (m)"],["Altitude du piquage d entrée 2: ze2 (m)"],["Altitude du piquage de sortie 1: zs1 (m)"],["Altitude du piquage de sortie 2: zs2 (m)"],["Altitude initiale du fluide : z0 (m)"],["Température initiale du fluide : T0 (K)"],["Si >0, masse volumique imposée du fluide : p_rho (kg/m3)"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ model.rpar = [[Patm],[A],[ze1],[ze2],[zs1],[zs2],[z0],[T0],[p_rho]];
+ model.equations.parameters[2-1] = list(Patm,A,ze1,ze2,zs1,zs2,z0,T0,p_rho);
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/Hydraulics/Bache.pickle b/js/Hydraulics/Bache.pickle
index 154645d8..0d1dde24 100644
--- a/js/Hydraulics/Bache.pickle
+++ b/js/Hydraulics/Bache.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Hydraulics/Flowmeter.js b/js/Hydraulics/Flowmeter.js
index 6856b2fb..d236c8a7 100644
--- a/js/Hydraulics/Flowmeter.js
+++ b/js/Hydraulics/Flowmeter.js
@@ -11,24 +11,24 @@ function Flowmeter() {
MO = [];
P = [[50,105,-1,90],[0,10,2,0],[101,10,-2,0]];
PortName = [["Mesure"],["C1"],["C2"]];
-for (i=1;i<=size(P,"r");i+=1) {
- if (P[i-1][3-1]==1) {
- Typein = [[Typein],["E"]];
- MI = [[MI],[PortName[i-1]]];
-}
- if (P[i-1][3-1]==2) {
- Typein = [[Typein],["I"]];
- MI = [[MI],[PortName[i-1]]];
-}
- if (P[i-1][3-1]==-1) {
- Typeout = [[Typeout],["E"]];
- MO = [[MO],[PortName[i-1]]];
-}
- if (P[i-1][3-1]==-2) {
- Typeout = [[Typeout],["I"]];
- MO = [[MO],[PortName[i-1]]];
-}
-}
+ for (i=1;i<=size(P,"r");i+=1) {
+ if (P[i-1][3-1]==1) {
+ Typein = [[Typein],["E"]];
+ MI = [[MI],[PortName[i-1]]];
+ }
+ if (P[i-1][3-1]==2) {
+ Typein = [[Typein],["I"]];
+ MI = [[MI],[PortName[i-1]]];
+ }
+ if (P[i-1][3-1]==-1) {
+ Typeout = [[Typeout],["E"]];
+ MO = [[MO],[PortName[i-1]]];
+ }
+ if (P[i-1][3-1]==-2) {
+ Typeout = [[Typeout],["I"]];
+ MO = [[MO],[PortName[i-1]]];
+ }
+ }
model = scicos_model();
mo = modelica();
model.sim = ModelName;
@@ -44,29 +44,30 @@ for (i=1;i<=size(P,"r");i+=1) {
model.equations = mo;
model.in1 = ones(size(MI,"*"),1);
model.out = ones(size(MO,"*"),1);
- x = standard_define([2,2],model,exprs,list(gr_i,0));
- x.graphics.in_implicit = Typein;
- x.graphics.out_implicit = Typeout;
+ this.x = standard_define([2,2],model,exprs,list(gr_i,0));
+ this.x.graphics.in_implicit = Typein;
+ this.x.graphics.out_implicit = Typeout;
}
Flowmeter.prototype.details = function Flowmeter() {
+ return this.x;
}
Flowmeter.prototype.get = function Flowmeter() {
}
Flowmeter.prototype.set = function Flowmeter() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
- x = arg1;
- exprs = x.graphics.exprs;
+ this.x = arg1;
+ exprs = this.x.graphics.exprs;
while (false) {
- [ok,Qini,exprs] = scicos_getvalue([["Set Flowmeter block parameters:"],[""],["Qini: "]],"Qini",list("vec",1),exprs);
- if (!ok) {
-break;
-}
- x.model.equations.parameters[2-1] = list(Qini);
- x.graphics.exprs = exprs;
-break;
-}
+ [ok,Qini,exprs] = scicos_getvalue([["Set Flowmeter block parameters:"],[""],["Qini: "]],"Qini",list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ this.x.model.equations.parameters[2-1] = list(Qini);
+ this.x.graphics.exprs = exprs;
+ break;
+ }
}
}
diff --git a/js/Hydraulics/Flowmeter.pickle b/js/Hydraulics/Flowmeter.pickle
index 154645d8..0d1dde24 100644
--- a/js/Hydraulics/Flowmeter.pickle
+++ b/js/Hydraulics/Flowmeter.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Hydraulics/PerteDP.js b/js/Hydraulics/PerteDP.js
index b60df57f..f424272b 100644
--- a/js/Hydraulics/PerteDP.js
+++ b/js/Hydraulics/PerteDP.js
@@ -24,30 +24,31 @@ function PerteDP() {
model.out = ones(size(mo.outputs,"*"),1);
exprs = [[string(L)],[string(D)],[string(lambda)],[string(z1)],[string(z2)],[string(p_rho)]];
gr_i = [];
- x = standard_define([2,1],model,exprs,list(gr_i,0));
- x.graphics.in_implicit = ["I"];
- x.graphics.out_implicit = ["I"];
+ this.x = standard_define([2,1],model,exprs,list(gr_i,0));
+ this.x.graphics.in_implicit = ["I"];
+ this.x.graphics.out_implicit = ["I"];
}
PerteDP.prototype.details = function PerteDP() {
+ return this.x;
}
PerteDP.prototype.get = function PerteDP() {
}
PerteDP.prototype.set = function PerteDP() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,L,D,lambda,z1,z2,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 = [[L],[D],[lambda],[z1],[z2],[p_rho]];
- model.equations.parameters[2-1] = list(L,D,lambda,z1,z2,p_rho);
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,L,D,lambda,z1,z2,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 = [[L],[D],[lambda],[z1],[z2],[p_rho]];
+ model.equations.parameters[2-1] = list(L,D,lambda,z1,z2,p_rho);
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/Hydraulics/PerteDP.pickle b/js/Hydraulics/PerteDP.pickle
index 154645d8..0d1dde24 100644
--- a/js/Hydraulics/PerteDP.pickle
+++ b/js/Hydraulics/PerteDP.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Hydraulics/PuitsP.js b/js/Hydraulics/PuitsP.js
index 44b24efa..a6efc486 100644
--- a/js/Hydraulics/PuitsP.js
+++ b/js/Hydraulics/PuitsP.js
@@ -18,29 +18,30 @@ function PuitsP() {
model.in1 = ones(size(mo.inputs,"*"),1);
exprs = [[string(P0)],[string(T0)],[string(H0)],[string(option_temperature)]];
gr_i = [];
- x = standard_define([2.5,2],model,exprs,list(gr_i,0));
- x.graphics.in_implicit = ["I"];
+ this.x = standard_define([2.5,2],model,exprs,list(gr_i,0));
+ this.x.graphics.in_implicit = ["I"];
}
PuitsP.prototype.details = function PuitsP() {
+ return this.x;
}
PuitsP.prototype.get = function PuitsP() {
}
PuitsP.prototype.set = function PuitsP() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,P0,T0,H0,option_temperature,exprs] = scicos_getvalue("Paramètres du puits",[["Pression de la source : P0 (Pa)"],["Temperature de la source : T0 (K)"],["Enthalpie spécifique de la source : H0 (J/kg)"],["1:température fixée - 2:enthalpie fixée : option_temperature"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs);
- if (!ok) {
-break;
-}
- model.rpar = [[P0],[T0],[H0],[option_temperature]];
- model.equations.parameters[2-1] = list(P0,T0,H0,option_temperature);
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,P0,T0,H0,option_temperature,exprs] = scicos_getvalue("Paramètres du puits",[["Pression de la source : P0 (Pa)"],["Temperature de la source : T0 (K)"],["Enthalpie spécifique de la source : H0 (J/kg)"],["1:température fixée - 2:enthalpie fixée : option_temperature"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ model.rpar = [[P0],[T0],[H0],[option_temperature]];
+ model.equations.parameters[2-1] = list(P0,T0,H0,option_temperature);
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/Hydraulics/PuitsP.pickle b/js/Hydraulics/PuitsP.pickle
index 154645d8..0d1dde24 100644
--- a/js/Hydraulics/PuitsP.pickle
+++ b/js/Hydraulics/PuitsP.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Hydraulics/SourceP.js b/js/Hydraulics/SourceP.js
index c0f4a876..504f1e52 100644
--- a/js/Hydraulics/SourceP.js
+++ b/js/Hydraulics/SourceP.js
@@ -20,29 +20,30 @@ function SourceP() {
model.out = ones(size(mo.outputs,"*"),1);
exprs = [[string(P0)],[string(T0)],[string(H0)],[string(option_temperature)]];
gr_i = [];
- x = standard_define([2.5,2],model,exprs,list(gr_i,0));
- x.graphics.out_implicit = ["I"];
+ this.x = standard_define([2.5,2],model,exprs,list(gr_i,0));
+ this.x.graphics.out_implicit = ["I"];
}
SourceP.prototype.details = function SourceP() {
+ return this.x;
}
SourceP.prototype.get = function SourceP() {
}
SourceP.prototype.set = function SourceP() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,P0,T0,H0,option_temperature,exprs] = scicos_getvalue("Paramètres du puits",[["Pression de la source : P0 (Pa)"],["Temperature de la source : T0 (K)"],["Enthalpie spécifique de la source : H0 (J/kg)"],["1:température fixée - 2:enthalpie fixée : option_temperature"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs);
- if (!ok) {
-break;
-}
- model.rpar = [[P0],[T0],[H0],[option_temperature]];
- model.equations.parameters[2-1] = list(P0,T0,H0,option_temperature);
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,P0,T0,H0,option_temperature,exprs] = scicos_getvalue("Paramètres du puits",[["Pression de la source : P0 (Pa)"],["Temperature de la source : T0 (K)"],["Enthalpie spécifique de la source : H0 (J/kg)"],["1:température fixée - 2:enthalpie fixée : option_temperature"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ model.rpar = [[P0],[T0],[H0],[option_temperature]];
+ model.equations.parameters[2-1] = list(P0,T0,H0,option_temperature);
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/Hydraulics/SourceP.pickle b/js/Hydraulics/SourceP.pickle
index 154645d8..0d1dde24 100644
--- a/js/Hydraulics/SourceP.pickle
+++ b/js/Hydraulics/SourceP.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Hydraulics/VanneReglante.js b/js/Hydraulics/VanneReglante.js
index 52ef8478..e3f32a7f 100644
--- a/js/Hydraulics/VanneReglante.js
+++ b/js/Hydraulics/VanneReglante.js
@@ -20,30 +20,31 @@ function VanneReglante() {
model.out = ones(size(mo.outputs,"*"),1);
exprs = [[string(Cvmax)],[string(p_rho)]];
gr_i = [];
- x = standard_define([2,2],model,exprs,list(gr_i,0));
- x.graphics.in_implicit = [["I"],["E"]];
- x.graphics.out_implicit = ["I"];
+ this.x = standard_define([2,2],model,exprs,list(gr_i,0));
+ this.x.graphics.in_implicit = [["I"],["E"]];
+ this.x.graphics.out_implicit = ["I"];
}
VanneReglante.prototype.details = function VanneReglante() {
+ return this.x;
}
VanneReglante.prototype.get = function VanneReglante() {
}
VanneReglante.prototype.set = function VanneReglante() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,Cvmax,p_rho,exprs] = scicos_getvalue("Paramètres de la vanne reglante",[["Cvmax"],["p_rho"]],list("vec",-1,"vec",-1),exprs);
- if (!ok) {
-break;
-}
- model.rpar = [[Cvmax],[p_rho]];
- model.equations.parameters[2-1] = list(Cvmax,p_rho);
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,Cvmax,p_rho,exprs] = scicos_getvalue("Paramètres de la vanne reglante",[["Cvmax"],["p_rho"]],list("vec",-1,"vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ model.rpar = [[Cvmax],[p_rho]];
+ model.equations.parameters[2-1] = list(Cvmax,p_rho);
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/Hydraulics/VanneReglante.pickle b/js/Hydraulics/VanneReglante.pickle
index 154645d8..0d1dde24 100644
--- a/js/Hydraulics/VanneReglante.pickle
+++ b/js/Hydraulics/VanneReglante.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file