summaryrefslogtreecommitdiff
path: root/js/Hydraulics/SourceP.js
diff options
context:
space:
mode:
authorSunil Shetye2018-06-25 12:08:56 +0530
committerSunil Shetye2018-06-25 12:45:27 +0530
commit7c70459c10aed0d74ee03896abaf47fefdbf7c8f (patch)
tree6f6acc6a5087295c6e59f0f94bfda5025049d5fa /js/Hydraulics/SourceP.js
parent870479a2e4b932426a904b2ebae7e4ee72037326 (diff)
downloadsci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.gz
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.bz2
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.zip
separate out code for getvalue
Diffstat (limited to 'js/Hydraulics/SourceP.js')
-rw-r--r--js/Hydraulics/SourceP.js66
1 files changed, 33 insertions, 33 deletions
diff --git a/js/Hydraulics/SourceP.js b/js/Hydraulics/SourceP.js
index 877e4856..c0f4a876 100644
--- a/js/Hydraulics/SourceP.js
+++ b/js/Hydraulics/SourceP.js
@@ -1,47 +1,47 @@
/* autogenerated from "macros/Hydraulics/SourceP.sci" */
function SourceP() {
SourceP.prototype.define = function SourceP() {
-model=scicos_model();
-P0=300000;
-T0=290;
-H0=100000;
-option_temperature=1;
-model.rpar=[[P0],[T0],[H0],[option_temperature]];
-model.sim="Source";
-model.blocktype="c";
-model.dep_ut=[true,false];
-mo=modelica();
-mo.model="Source";
-mo.inputs=[];
-mo.outputs=["C"];
-mo.parameters=list([["P0"],["T0"],["H0"],["option_temperature"]],[[P0],[T0],[H0],[option_temperature]]);
-model.equations=mo;
-model.in1=ones(size(mo.inputs,"*"),1);
-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"];
+ model = scicos_model();
+ P0 = 300000;
+ T0 = 290;
+ H0 = 100000;
+ option_temperature = 1;
+ model.rpar = [[P0],[T0],[H0],[option_temperature]];
+ model.sim = "Source";
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ mo = modelica();
+ mo.model = "Source";
+ mo.inputs = [];
+ mo.outputs = ["C"];
+ mo.parameters = list([["P0"],["T0"],["H0"],["option_temperature"]],[[P0],[T0],[H0],[option_temperature]]);
+ model.equations = mo;
+ model.in1 = ones(size(mo.inputs,"*"),1);
+ 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"];
}
SourceP.prototype.details = function SourceP() {
}
SourceP.prototype.get = function SourceP() {
}
SourceP.prototype.set = function SourceP() {
-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) {
+ 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;
+ 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;
}
}