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/Sources/RAMP.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/Sources/RAMP.js')
-rw-r--r-- | js/Sources/RAMP.js | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/js/Sources/RAMP.js b/js/Sources/RAMP.js index 2868c2f9..add6822e 100644 --- a/js/Sources/RAMP.js +++ b/js/Sources/RAMP.js @@ -1,44 +1,44 @@ /* autogenerated from "macros/Sources/RAMP.sci" */ function RAMP() { RAMP.prototype.define = function RAMP() { -slope=0; -iout=0; -stt=0; -rpar=[[slope],[stt],[iout]]; -model=scicos_model(); -model.sim=list("ramp",4); -model.in1=[]; -model.out=1; -model.rpar=rpar; -model.blocktype="c"; -model.nmode=1; -model.nzcross=1; -model.dep_ut=[false,true]; -exprs=[string(rpar)]; -gr_i=[]; -x=standard_define([2,2],model,exprs,gr_i); + slope = 0; + iout = 0; + stt = 0; + rpar = [[slope],[stt],[iout]]; + model = scicos_model(); + model.sim = list("ramp",4); + model.in1 = []; + model.out = 1; + model.rpar = rpar; + model.blocktype = "c"; + model.nmode = 1; + model.nzcross = 1; + model.dep_ut = [false,true]; + exprs = [string(rpar)]; + gr_i = []; + x = standard_define([2,2],model,exprs,gr_i); } RAMP.prototype.details = function RAMP() { } RAMP.prototype.get = function RAMP() { } RAMP.prototype.set = function RAMP() { -x=arg1; -graphics=arg1.graphics; -exprs=graphics.exprs; -model=arg1.model; -while (true) { -[ok,slope,stt,iout,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"RAMP")],[" "],[gettext("Ramp function")],[" "]],[[gettext("Slope")],[gettext("Start Time")],[gettext("Initial Value")]],list("vec",1,"vec",1,"vec",1),exprs); -if (!ok) { + x = arg1; + graphics = arg1.graphics; + exprs = graphics.exprs; + model = arg1.model; + while (true) { + [ok,slope,stt,iout,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"RAMP")],[" "],[gettext("Ramp function")],[" "]],[[gettext("Slope")],[gettext("Start Time")],[gettext("Initial Value")]],list("vec",1,"vec",1,"vec",1),exprs); + if (!ok) { break; } -if (stt<0) { + if (stt<0) { block_parameter_error(msprintf(gettext("Wrong value for \'Start Time\' parameter: %e."),stt),gettext("Null or positive integer expected.")); -} else { -model.rpar=[[slope],[stt],[iout]]; -graphics.exprs=exprs; -x.graphics=graphics; -x.model=model; + } else { + model.rpar = [[slope],[stt],[iout]]; + graphics.exprs = exprs; + x.graphics = graphics; + x.model = model; break; } } |