diff options
author | Sunil Shetye | 2018-06-25 12:08:56 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-25 12:45:27 +0530 |
commit | 7c70459c10aed0d74ee03896abaf47fefdbf7c8f (patch) | |
tree | 6f6acc6a5087295c6e59f0f94bfda5025049d5fa /js/Electrical/ConstantVoltage.js | |
parent | 870479a2e4b932426a904b2ebae7e4ee72037326 (diff) | |
download | sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.gz sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.bz2 sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.zip |
separate out code for getvalue
Diffstat (limited to 'js/Electrical/ConstantVoltage.js')
-rw-r--r-- | js/Electrical/ConstantVoltage.js | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/js/Electrical/ConstantVoltage.js b/js/Electrical/ConstantVoltage.js index a1b5e336..2f831d32 100644 --- a/js/Electrical/ConstantVoltage.js +++ b/js/Electrical/ConstantVoltage.js @@ -1,45 +1,45 @@ /* autogenerated from "macros/Electrical/ConstantVoltage.sci" */ function ConstantVoltage() { ConstantVoltage.prototype.define = function ConstantVoltage() { -V=0.01; -model=scicos_model(); -model.rpar=V; -model.in1=1; -model.out=1; -model.sim="ConstantVoltage"; -model.blocktype="c"; -model.dep_ut=[false,false]; -mo=modelica(); -mo.model="ConstantVoltage"; -mo.inputs="p"; -mo.outputs="n"; -mo.parameters=list("V",list(V)); -model.equations=mo; -exprs=string(V); -gr_i=[]; -x=standard_define([1.5,1.1],model,exprs,list(gr_i,0)); -x.graphics.in_implicit=["I"]; -x.graphics.out_implicit=["I"]; + V = 0.01; + model = scicos_model(); + model.rpar = V; + model.in1 = 1; + model.out = 1; + model.sim = "ConstantVoltage"; + model.blocktype = "c"; + model.dep_ut = [false,false]; + mo = modelica(); + mo.model = "ConstantVoltage"; + mo.inputs = "p"; + mo.outputs = "n"; + mo.parameters = list("V",list(V)); + model.equations = mo; + exprs = string(V); + gr_i = []; + x = standard_define([1.5,1.1],model,exprs,list(gr_i,0)); + x.graphics.in_implicit = ["I"]; + x.graphics.out_implicit = ["I"]; } ConstantVoltage.prototype.details = function ConstantVoltage() { } ConstantVoltage.prototype.get = function ConstantVoltage() { } ConstantVoltage.prototype.set = function ConstantVoltage() { -x=arg1; -graphics=arg1.graphics; -exprs=graphics.exprs; -model=arg1.model; -while (true) { -[ok,V,exprs]=scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs); -if (!ok) { + x = arg1; + graphics = arg1.graphics; + exprs = graphics.exprs; + model = arg1.model; + while (true) { + [ok,V,exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs); + if (!ok) { break; } -model.rpar=V; -model.equations.parameters[2-1]=list(V); -graphics.exprs=exprs; -x.graphics=graphics; -x.model=model; + model.rpar = V; + model.equations.parameters[2-1] = list(V); + graphics.exprs = exprs; + x.graphics = graphics; + x.model = model; break; } } |