diff options
Diffstat (limited to 'js/Sources')
48 files changed, 492 insertions, 344 deletions
diff --git a/js/Sources/CLKINV_f.js b/js/Sources/CLKINV_f.js index 5d68df08..88b78d6e 100644 --- a/js/Sources/CLKINV_f.js +++ b/js/Sources/CLKINV_f.js @@ -1,18 +1,18 @@ /* autogenerated from "macros/Sources/CLKINV_f.sci" */ function CLKINV_f() { CLKINV_f.prototype.define = function CLKINV_f() { - prt = 1; + this.prt = 1; model = scicos_model(); model.sim = "input"; model.evtout = 1; - model.ipar = prt; + model.ipar = this.prt; model.blocktype = "d"; model.firing = -1; model.dep_ut = [false,false]; - exprs = string(prt); + exprs = string(this.prt); gr_i = []; this.x = standard_define([1,1],model,exprs,gr_i); - return new BasicBlock(this.x); + return new EventInBlock(this.x); } CLKINV_f.prototype.details = function CLKINV_f() { return this.x; @@ -26,15 +26,15 @@ function CLKINV_f() { exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { - [ok,prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLKINV_f")],[" "],[gettext("Event input port")],[" "]],"Port Number",list("vec",1),exprs); - prt = int(prt); + [ok,this.prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLKINV_f")],[" "],[gettext("Event input port")],[" "]],"Port Number",list("vec",1),exprs); + this.prt = int(this.prt); if (!ok) { break; } - if (prt<=0) { - block_parameter_error(msprintf(gettext("Wrong values for \'Port Number\' parameter: %d."),prt),gettext("Strictly positive integer expected.")); + if (this.prt<=0) { + block_parameter_error(msprintf(gettext("Wrong values for \'Port Number\' parameter: %d."),this.prt),gettext("Strictly positive integer expected.")); } else { - model.ipar = prt; + model.ipar = this.prt; model.evtout = 1; model.firing = -1; graphics.exprs = exprs; @@ -43,6 +43,6 @@ function CLKINV_f() { break; } } - return new BasicBlock(this.x); + return new EventInBlock(this.x); } } diff --git a/js/Sources/CLKINV_f.pickle b/js/Sources/CLKINV_f.pickle index 0d1dde24..48ee82e7 100644 --- a/js/Sources/CLKINV_f.pickle +++ b/js/Sources/CLKINV_f.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'prt' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/Sources/CLKIN_f.js b/js/Sources/CLKIN_f.js index 0e8f5f83..8f1f7db5 100644 --- a/js/Sources/CLKIN_f.js +++ b/js/Sources/CLKIN_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Sources/CLKIN_f.sci" */ function CLKIN_f() { CLKIN_f.prototype.define = function CLKIN_f() { - prt = 1; + this.prt = 1; model = scicos_model(); model.sim = "input"; model.evtout = 1; - model.ipar = prt; + model.ipar = this.prt; model.blocktype = "d"; model.firing = -1; model.dep_ut = [false,false]; - exprs = string(prt); + exprs = string(this.prt); this.x = standard_define([1,1],model,exprs," "); return new BasicBlock(this.x); } @@ -25,15 +25,15 @@ function CLKIN_f() { exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { - [ok,prt,exprs] = scicos_getvalue("Set Event Input block parameters","Port number",list("vec",1),exprs); - prt = int(prt); + [ok,this.prt,exprs] = scicos_getvalue("Set Event Input block parameters","Port number",list("vec",1),exprs); + this.prt = int(this.prt); if (!ok) { break; } - if (prt<=0) { + if (this.prt<=0) { message("Port number must be a positive integer"); } else { - model.ipar = prt; + model.ipar = this.prt; model.evtout = 1; model.firing = -1; graphics.exprs = exprs; diff --git a/js/Sources/CLKIN_f.pickle b/js/Sources/CLKIN_f.pickle index 0d1dde24..48ee82e7 100644 --- a/js/Sources/CLKIN_f.pickle +++ b/js/Sources/CLKIN_f.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'prt' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/Sources/CLOCK_c.js b/js/Sources/CLOCK_c.js index dde29deb..5dd8d867 100644 --- a/js/Sources/CLOCK_c.js +++ b/js/Sources/CLOCK_c.js @@ -63,27 +63,27 @@ function CLOCK_c() { dt_old = model.rpar[1-1]; model_n = model; while (true) { - [ok,dt,t0,exprs0] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLOCK_c")],[" "],[gettext("Event clock generator")],[" "],[gettext(" Do not start if \'Initialisation Time\' is negative")],[" "]],[[gettext("Period")],[gettext("Initialisation Time")]],list("vec",1,"vec",1),exprs); + [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLOCK_c")],[" "],[gettext("Event clock generator")],[" "],[gettext(" Do not start if \'Initialisation Time\' is negative")],[" "]],[[gettext("Period")],[gettext("Initialisation Time")]],list("vec",1,"vec",1),exprs); if (!ok) { break; } - if (dt<=0) { - block_parameter_error(msprintf(gettext("Wrong values for \'%s\' parameter: %5.1e."),gettext("Period"),dt),gettext("Strictly positive number expected.")); + if (this.dt<=0) { + block_parameter_error(msprintf(gettext("Wrong values for \'%s\' parameter: %5.1e."),gettext("Period"),this.dt),gettext("Strictly positive number expected.")); ok = false; } if (ok) { - xx.graphics.exprs = exprs0; - model.rpar = [[dt],[t0]]; - model.firing = t0; + xx.graphics.exprs = this.exprs0; + model.rpar = [[this.dt],[this.t0]]; + model.firing = this.t0; xx.model = model; arg1.model.rpar.objs[path-1] = xx; break; } } - if (!and([t0_old,dt_old]==[t0,dt])) { + if (!and([t0_old,dt_old]==[this.t0,this.dt])) { newpar[size(newpar)+1-1] = path; } - if (t0_old!=t0) { + if (t0_old!=this.t0) { needcompile = 2; } else { needcompile = 0; diff --git a/js/Sources/CLOCK_c.pickle b/js/Sources/CLOCK_c.pickle index 2287bb36..ecce30af 100644 --- a/js/Sources/CLOCK_c.pickle +++ b/js/Sources/CLOCK_c.pickle @@ -4,8 +4,14 @@ p0 ((lp1 S'x' p2 -aS'EVTDLY_c' +aS'dt' p3 -atp4 -Rp5 +aS'EVTDLY_c' +p4 +aS'exprs0' +p5 +aS't0' +p6 +atp7 +Rp8 .
\ No newline at end of file diff --git a/js/Sources/CLOCK_f.js b/js/Sources/CLOCK_f.js index 97b65820..ca2d5bd3 100644 --- a/js/Sources/CLOCK_f.js +++ b/js/Sources/CLOCK_f.js @@ -63,27 +63,27 @@ function CLOCK_f() { dt_old = model.rpar; model_n = model; while (true) { - [ok,dt,t0,exprs0] = scicos_getvalue("Set Clock block parameters",[["Period"],["Init time"]],list("vec",1,"vec",1),exprs); + [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue("Set Clock block parameters",[["Period"],["Init time"]],list("vec",1,"vec",1),exprs); if (!ok) { break; } - if (dt<=0) { + if (this.dt<=0) { message("period must be positive"); ok = false; } if (ok) { - xx.graphics.exprs = exprs0; - model.rpar = dt; - model.firing = t0; + xx.graphics.exprs = this.exprs0; + model.rpar = this.dt; + model.firing = this.t0; xx.model = model; arg1.model.rpar.objs[path-1] = xx; break; } } - if (!and([t0_old,dt_old]==[t0,dt])||!and(exprs0==exprs)) { + if (!and([t0_old,dt_old]==[this.t0,this.dt])||!and(this.exprs0==exprs)) { newpar[size(newpar)+1-1] = path; } - if (t0_old!=t0) { + if (t0_old!=this.t0) { needcompile = 2; } else { needcompile = 0; diff --git a/js/Sources/CLOCK_f.pickle b/js/Sources/CLOCK_f.pickle index 0d1dde24..5cf559c5 100644 --- a/js/Sources/CLOCK_f.pickle +++ b/js/Sources/CLOCK_f.pickle @@ -4,6 +4,12 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'dt' +p3 +aS'exprs0' +p4 +aS't0' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/Sources/CONST.js b/js/Sources/CONST.js index 35f02d3a..751ef000 100644 --- a/js/Sources/CONST.js +++ b/js/Sources/CONST.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Sources/CONST.sci" */ function CONST() { CONST.prototype.define = function CONST() { - C = 1; + this.C = 1; model = scicos_model(); model.sim = list("cstblk4",4); model.in1 = []; model.out = 1; - model.rpar = C; + model.rpar = this.C; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = strcat(sci2exp(C)); + exprs = strcat(sci2exp(this.C)); gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -25,18 +25,18 @@ function CONST() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); + [ok,this.C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); if (!ok) { break; } - sz = size(C); - nout = size(C,"*"); + sz = size(this.C); + nout = size(this.C,"*"); if (nout==0) { message("C must have at least one element"); } else if (and(sz>1)) { message("C matrix is not supported, use CONST_m instead"); } else { - model.rpar = C.slice(); + model.rpar = this.C.slice(); model.out = nout; graphics.exprs = exprs; this.x.graphics = graphics; diff --git a/js/Sources/CONST.pickle b/js/Sources/CONST.pickle index 0d1dde24..4ccc1da6 100644 --- a/js/Sources/CONST.pickle +++ b/js/Sources/CONST.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'C' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/Sources/CONST_f.js b/js/Sources/CONST_f.js index 0030dc8f..c5ed3881 100644 --- a/js/Sources/CONST_f.js +++ b/js/Sources/CONST_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Sources/CONST_f.sci" */ function CONST_f() { CONST_f.prototype.define = function CONST_f() { - C = 1; + this.C = 1; model = scicos_model(); model.sim = list("cstblk",1); model.in1 = []; model.out = 1; - model.rpar = C; + model.rpar = this.C; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = strcat(sci2exp(C)); + exprs = strcat(sci2exp(this.C)); gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -25,15 +25,15 @@ function CONST_f() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); + [ok,this.C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); if (!ok) { break; } - nout = size(C,"*"); + nout = size(this.C,"*"); if (nout==0) { message("C must have at least one element"); } else { - model.rpar = C.slice(); + model.rpar = this.C.slice(); model.out = nout; graphics.exprs = exprs; this.x.graphics = graphics; diff --git a/js/Sources/CONST_f.pickle b/js/Sources/CONST_f.pickle index 0d1dde24..4ccc1da6 100644 --- a/js/Sources/CONST_f.pickle +++ b/js/Sources/CONST_f.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'C' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/Sources/CONST_m.js b/js/Sources/CONST_m.js index 8a0bf6a1..37110709 100644 --- a/js/Sources/CONST_m.js +++ b/js/Sources/CONST_m.js @@ -1,18 +1,18 @@ /* autogenerated from "macros/Sources/CONST_m.sci" */ function CONST_m() { CONST_m.prototype.define = function CONST_m() { - C = [1]; + this.C = [1]; model = scicos_model(); model.sim = list("cstblk4",4); model.in1 = []; - model.out = size(C,1); + model.out = size(this.C,1); model.in2 = []; - model.out2 = size(C,2); - model.rpar = C; + model.out2 = size(this.C,2); + model.rpar = this.C; model.opar = list(); model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = sci2exp(C); + exprs = sci2exp(this.C); gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -28,33 +28,33 @@ function CONST_m() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,C,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CONST_m")],[" "],[gettext("Constant value generator")],[" "]],gettext("Constant Value"),list("vec",-1),exprs); + [ok,this.C,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CONST_m")],[" "],[gettext("Constant value generator")],[" "]],gettext("Constant Value"),list("vec",-1),exprs); if (!ok) { break; } - nout = size(C); + nout = size(this.C); if (find(nout==0)!=[]) { block_parameter_error(msprintf(gettext("Wrong size for \'%s\' parameter"),gettext("Constant Value")),gettext("Constant value must have at least one element.")); } else { model.sim = list("cstblk4_m",4); - model.opar = list(C); - if ((this.type[C-1]==1)) { - if (isreal(C)) { + model.opar = list(this.C); + if ((this.type[this.C-1]==1)) { + if (isreal(this.C)) { ot = 1; } else { ot = 2; } - } else if ((typeof(C)=="int32")) { + } else if ((typeof(this.C)=="int32")) { ot = 3; - } else if ((typeof(C)=="int16")) { + } else if ((typeof(this.C)=="int16")) { ot = 4; - } else if ((typeof(C)=="int8")) { + } else if ((typeof(this.C)=="int8")) { ot = 5; - } else if ((typeof(C)=="uint32")) { + } else if ((typeof(this.C)=="uint32")) { ot = 6; - } else if ((typeof(C)=="uint16")) { + } else if ((typeof(this.C)=="uint16")) { ot = 7; - } else if ((typeof(C)=="uint8")) { + } else if ((typeof(this.C)=="uint8")) { ot = 8; } else { block_parameter_error(msprintf(gettext("Wrong type for \'%s\' parameter"),gettext("Constant Value")),gettext("Value type must be a numeric type (double, complex, int, int8, ...).")); diff --git a/js/Sources/CONST_m.pickle b/js/Sources/CONST_m.pickle index 54a16ece..4ca64528 100644 --- a/js/Sources/CONST_m.pickle +++ b/js/Sources/CONST_m.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -aS'type' +aS'C' p3 -atp4 -Rp5 +aS'type' +p4 +atp5 +Rp6 .
\ No newline at end of file diff --git a/js/Sources/CURVE_c.pickle b/js/Sources/CURVE_c.pickle index b1c7cff9..83738a73 100644 --- a/js/Sources/CURVE_c.pickle +++ b/js/Sources/CURVE_c.pickle @@ -4,18 +4,28 @@ p0 ((lp1 S'rparin' p2 -aS'ixy' +aS'yy' p3 -aS'iparin' +aS'xx' p4 -aS'argn' +aS'ixy' p5 -aS'xy' +aS'PeriodicOption' p6 -aS'x' +aS'argn' p7 -aS'curwin' +aS'xy' p8 -atp9 -Rp10 +aS'x' +p9 +aS'curwin' +p10 +aS'Method' +p11 +aS'graf' +p12 +aS'iparin' +p13 +atp14 +Rp15 .
\ No newline at end of file diff --git a/js/Sources/Counter.js b/js/Sources/Counter.js index 3cd43ab3..88f6a593 100644 --- a/js/Sources/Counter.js +++ b/js/Sources/Counter.js @@ -1,19 +1,19 @@ /* autogenerated from "macros/Sources/Counter.sci" */ function Counter() { Counter.prototype.define = function Counter() { - minim = 0; - maxim = 2; - rule = 1; + this.minim = 0; + this.maxim = 2; + this.rule = 1; model = scicos_model(); model.sim = list("counter",4); model.evtin = 1; model.out = 1; model.out2 = 1; model.dstate = 0; - model.ipar = [[rule],[maxim],[minim]]; + model.ipar = [[this.rule],[this.maxim],[this.minim]]; model.blocktype = "c"; model.dep_ut = [false,false]; - exprs = [[string(minim)],[string(maxim)],[string(rule)]]; + exprs = [[string(this.minim)],[string(this.maxim)],[string(this.rule)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -29,20 +29,20 @@ function Counter() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,minim,maxim,rule,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"Counter")],[" "],[gettext("Integer counter generator")],[" "]],[[gettext("Minimum")],[gettext("Maximum")],[gettext("Rule (1:Increment, 2:Decrement)")]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.minim,this.maxim,this.rule,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"Counter")],[" "],[gettext("Integer counter generator")],[" "]],[[gettext("Minimum")],[gettext("Maximum")],[gettext("Rule (1:Increment, 2:Decrement)")]],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - maxim = int(maxim); - minim = int(minim); - if (maxim<minim) { - block_parameter_error(msprintf(gettext("Wrong values for \'Maximum\' and \'Minimum\' parameters: %d < %d"),minim,maxim),msprintf(gettext("\'Minimum\' must be less than \'Maximum\'."))); - } else if ((rule!=1&&rule!=2)) { - block_parameter_error(msprintf(gettext("Wrong value for \'Rule\' parameter: %d"),rule),msprintf(gettext("Must be in the interval %s."),"[1,2]")); + this.maxim = int(this.maxim); + this.minim = int(this.minim); + if (this.maxim<this.minim) { + block_parameter_error(msprintf(gettext("Wrong values for \'Maximum\' and \'Minimum\' parameters: %d < %d"),this.minim,this.maxim),msprintf(gettext("\'Minimum\' must be less than \'Maximum\'."))); + } else if ((this.rule!=1&&this.rule!=2)) { + block_parameter_error(msprintf(gettext("Wrong value for \'Rule\' parameter: %d"),this.rule),msprintf(gettext("Must be in the interval %s."),"[1,2]")); } else { graphics.exprs = exprs; model.dstate = 0; - model.ipar = [[rule],[maxim],[minim]]; + model.ipar = [[this.rule],[this.maxim],[this.minim]]; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/Sources/Counter.pickle b/js/Sources/Counter.pickle index 0d1dde24..585bf9da 100644 --- a/js/Sources/Counter.pickle +++ b/js/Sources/Counter.pickle @@ -4,6 +4,12 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'maxim' +p3 +aS'rule' +p4 +aS'minim' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/Sources/FROMWS_c.js b/js/Sources/FROMWS_c.js index 89e1212c..a76fc174 100644 --- a/js/Sources/FROMWS_c.js +++ b/js/Sources/FROMWS_c.js @@ -1,23 +1,23 @@ /* autogenerated from "macros/Sources/FROMWS_c.sci" */ function FROMWS_c() { FROMWS_c.prototype.define = function FROMWS_c() { - varnam = "V"; - Method = 1; - ZC = 1; - OutEnd = 0; + this.varnam = "V"; + this.Method = 1; + this.ZC = 1; + this.OutEnd = 0; model = scicos_model(); model.sim = list("fromws_c",4); model.out = -1; model.out2 = -2; model.outtyp = -1; - model.ipar = [[length(varnam)],[this._str2code[varnam-1]],[Method],[ZC],[OutEnd]]; + model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; model.evtin = [1]; model.evtout = [1]; model.firing = [0]; model.blocktype = "d"; model.dep_ut = [false,true]; gr_i = []; - exprs = [[string(varnam)],[string(Method)],[string(ZC)],[string(OutEnd)]]; + exprs = [[string(this.varnam)],[string(this.Method)],[string(this.ZC)],[string(this.OutEnd)]]; this.x = standard_define([3.5,2],model,exprs,gr_i); return new BasicBlock(this.x); } @@ -32,19 +32,19 @@ function FROMWS_c() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,varnam,Method,ZC,OutEnd,exprs] = scicos_getvalue("Set From_Workspace block parameters",[["Variable name"],["Interpolation Method"],["Enable zero crossing(0:No, 1:Yes)?"],["Output at end(0:Zero, 1:Hold, 2:Repeat)"]],list("str",1,"vec",1,"vec",1,"vec",1),exprs); + [ok,this.varnam,this.Method,this.ZC,this.OutEnd,exprs] = scicos_getvalue("Set From_Workspace block parameters",[["Variable name"],["Interpolation Method"],["Enable zero crossing(0:No, 1:Yes)?"],["Output at end(0:Zero, 1:Hold, 2:Repeat)"]],list("str",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - if (!(Method==0||Method==1||Method==2||Method==3)) { + if (!(this.Method==0||this.Method==1||this.Method==2||this.Method==3)) { message("Interpolation method should be chosen in [0,1,2,3]"); ok = false; } - if (!(ZC==0||ZC==1)) { + if (!(this.ZC==0||this.ZC==1)) { message("Zero crossing should be either 0 or 1"); ok = false; } - if (!(OutEnd==0||OutEnd==1||OutEnd==2)) { + if (!(this.OutEnd==0||this.OutEnd==1||this.OutEnd==2)) { message("Output at end option should be either 0 or 1"); ok = false; } @@ -55,7 +55,7 @@ function FROMWS_c() { ok = false; } if (ok) { - model.ipar = [[length(varnam)],[this._str2code[varnam-1]],[Method],[ZC],[OutEnd]]; + model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; [model,graphics,ok] = set_io(model,graphics,list(),list([-1,-2],-1),1,1); if (ok) { graphics.exprs = exprs; diff --git a/js/Sources/FROMWS_c.pickle b/js/Sources/FROMWS_c.pickle index bcacb8ca..eeb22102 100644 --- a/js/Sources/FROMWS_c.pickle +++ b/js/Sources/FROMWS_c.pickle @@ -4,8 +4,16 @@ p0 ((lp1 S'_str2code' p2 -aS'x' +aS'ZC' p3 -atp4 -Rp5 +aS'OutEnd' +p4 +aS'x' +p5 +aS'Method' +p6 +aS'varnam' +p7 +atp8 +Rp9 .
\ No newline at end of file diff --git a/js/Sources/GENSIN_f.js b/js/Sources/GENSIN_f.js index ff5f9ec4..c7722a4e 100644 --- a/js/Sources/GENSIN_f.js +++ b/js/Sources/GENSIN_f.js @@ -27,17 +27,17 @@ function GENSIN_f() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,M,F,P,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"GENSIN_f")],[" "],[gettext("Sine wave generator")],[" "]],[[gettext("Magnitude")],[gettext("Frequency (rad/s)")],[gettext("Phase (rad)")]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.M,this.F,this.P,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"GENSIN_f")],[" "],[gettext("Sine wave generator")],[" "]],[[gettext("Magnitude")],[gettext("Frequency (rad/s)")],[gettext("Phase (rad)")]],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - if (F<0) { - block_parameter_error(msprintf(gettext("Wrong value for \'Frequency\' parameter: %e."),F),gettext("Strictly positive integer expected.")); + if (this.F<0) { + block_parameter_error(msprintf(gettext("Wrong value for \'Frequency\' parameter: %e."),this.F),gettext("Strictly positive integer expected.")); ok = false; } if (ok) { [model,graphics,ok] = check_io(model,graphics,[],1,[],[]); - model.rpar = [[M],[F],[P]]; + model.rpar = [[this.M],[this.F],[this.P]]; model.out2 = 1; model.outtyp = 1; graphics.exprs = exprs; diff --git a/js/Sources/GENSIN_f.pickle b/js/Sources/GENSIN_f.pickle index 0d1dde24..553882df 100644 --- a/js/Sources/GENSIN_f.pickle +++ b/js/Sources/GENSIN_f.pickle @@ -4,6 +4,12 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'M' +p3 +aS'P' +p4 +aS'F' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/Sources/GENSQR_f.js b/js/Sources/GENSQR_f.js index 5c32c444..5f3895f8 100644 --- a/js/Sources/GENSQR_f.js +++ b/js/Sources/GENSQR_f.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/Sources/GENSQR_f.sci" */ function GENSQR_f() { GENSQR_f.prototype.define = function GENSQR_f() { - Amplitude = 1; + this.Amplitude = 1; model = scicos_model(); model.sim = "gensqr"; model.out = 1; model.out2 = 1; model.outtyp = 1; model.evtin = 1; - model.dstate = Amplitude; + model.dstate = this.Amplitude; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = string(Amplitude); + exprs = string(this.Amplitude); gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -30,12 +30,12 @@ function GENSQR_f() { exprs = exprs[2-1]; } while (true) { - [ok,Amplitude,exprs] = scicos_getvalue(["Set Square generator block parameters"],["Amplitude"],list("vec",1),exprs); + [ok,this.Amplitude,exprs] = scicos_getvalue(["Set Square generator block parameters"],["Amplitude"],list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - model.dstate = Amplitude; + model.dstate = this.Amplitude; model.out2 = 1; model.outtyp = 1; this.x.graphics = graphics; diff --git a/js/Sources/GENSQR_f.pickle b/js/Sources/GENSQR_f.pickle index 0d1dde24..87270454 100644 --- a/js/Sources/GENSQR_f.pickle +++ b/js/Sources/GENSQR_f.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'Amplitude' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/Sources/GEN_SQR.pickle b/js/Sources/GEN_SQR.pickle index 2a35c6de..0ff4a873 100644 --- a/js/Sources/GEN_SQR.pickle +++ b/js/Sources/GEN_SQR.pickle @@ -4,8 +4,16 @@ p0 ((lp1 S'needcompile' p2 -aS'x' +aS'scicos_context.Amax' p3 -atp4 -Rp5 +aS'scicos_context.rule' +p4 +aS'x' +p5 +aS'scicos_context.Amin' +p6 +aS'scicos_context.F' +p7 +atp8 +Rp9 .
\ No newline at end of file diff --git a/js/Sources/INIMPL_f.js b/js/Sources/INIMPL_f.js index 3b67b166..269e1c99 100644 --- a/js/Sources/INIMPL_f.js +++ b/js/Sources/INIMPL_f.js @@ -12,12 +12,12 @@ function INIMPL_f() { mo.model = "PORT"; mo.outputs = "n"; model.equations = mo; - prt = 1; + this.prt = 1; exprs = "1"; gr_i = []; this.x = standard_define([1,1],model,exprs,gr_i); this.x.graphics.out_implicit = ["I"]; - return new BasicBlock(this.x); + return new ImplicitInBlock(this.x); } INIMPL_f.prototype.details = function INIMPL_f() { return this.x; @@ -33,25 +33,25 @@ function INIMPL_f() { exprs = exprs[1-1]; } while (true) { - [ok,prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"INIMPL_f")],[" "],[gettext("Implicit input port")],[" "]],"Port Number",list("vec",1),exprs); + [ok,this.prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"INIMPL_f")],[" "],[gettext("Implicit input port")],[" "]],"Port Number",list("vec",1),exprs); if (!ok) { break; } - prt = int(prt); - if (prt<=0) { - block_parameter_error(msprintf(gettext("Wrong value for \'Port Number\' parameter: %d."),prt),gettext("Strictly positive integer expected.")); + this.prt = int(this.prt); + if (this.prt<=0) { + block_parameter_error(msprintf(gettext("Wrong value for \'Port Number\' parameter: %d."),this.prt),gettext("Strictly positive integer expected.")); } else { - if (model.ipar!=prt) { + if (model.ipar!=this.prt) { needcompile = 4; y = needcompile; } - model.ipar = prt; + model.ipar = this.prt; graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = model; break; } } - return new BasicBlock(this.x); + return new ImplicitInBlock(this.x); } } diff --git a/js/Sources/INIMPL_f.pickle b/js/Sources/INIMPL_f.pickle index 0d1dde24..48ee82e7 100644 --- a/js/Sources/INIMPL_f.pickle +++ b/js/Sources/INIMPL_f.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'prt' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/Sources/IN_f.js b/js/Sources/IN_f.js index d6ea593f..5c6512de 100644 --- a/js/Sources/IN_f.js +++ b/js/Sources/IN_f.js @@ -13,7 +13,7 @@ function IN_f() { exprs = sci2exp(prt); gr_i = []; this.x = standard_define([1,1],model,exprs,gr_i); - return new BasicBlock(this.x); + return new ExplicitInBlock(this.x); } IN_f.prototype.details = function IN_f() { return this.x; @@ -59,6 +59,6 @@ function IN_f() { break; } } - return new BasicBlock(this.x); + return new ExplicitInBlock(this.x); } } diff --git a/js/Sources/Modulo_Count.js b/js/Sources/Modulo_Count.js index 8fc07b39..7da94036 100644 --- a/js/Sources/Modulo_Count.js +++ b/js/Sources/Modulo_Count.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/Sources/Modulo_Count.sci" */ function Modulo_Count() { Modulo_Count.prototype.define = function Modulo_Count() { - ini_c = 0; - base = 3; + this.ini_c = 0; + this.base = 3; model = scicos_model(); model.sim = list("modulo_count",4); model.evtin = 1; model.out = 1; - model.dstate = ini_c; - model.ipar = base; + model.dstate = this.ini_c; + model.ipar = this.base; model.blocktype = "c"; model.dep_ut = [false,false]; - exprs = [[string(ini_c)],[string(base)]]; + exprs = [[string(this.ini_c)],[string(this.base)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -27,20 +27,20 @@ function Modulo_Count() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,ini_c,base,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"Modulo_Count")],[" "],[gettext("Modulo counter (0 to N counter)")],[" "]],[[gettext("Initial State (zero or positive number)")],[gettext("Upper Limit (positive number)")]],list("vec",1,"vec",1),exprs); - ini_c = int(ini_c); - base = int(base); + [ok,this.ini_c,this.base,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"Modulo_Count")],[" "],[gettext("Modulo counter (0 to N counter)")],[" "]],[[gettext("Initial State (zero or positive number)")],[gettext("Upper Limit (positive number)")]],list("vec",1,"vec",1),exprs); + this.ini_c = int(this.ini_c); + this.base = int(this.base); if (!ok) { break; } - if (ini_c<0) { - block_parameter_error(msprintf(gettext("Wrong value for \'Initial State\' parameter: %d."),ini_c),gettext("Null or positive integer expected.")); - } else if (base<=0) { - block_parameter_error(msprintf(gettext("Wrong values for \'Upper Limit\' parameter: %d."),base),gettext("Strictly positive integer expected.")); + if (this.ini_c<0) { + block_parameter_error(msprintf(gettext("Wrong value for \'Initial State\' parameter: %d."),this.ini_c),gettext("Null or positive integer expected.")); + } else if (this.base<=0) { + block_parameter_error(msprintf(gettext("Wrong values for \'Upper Limit\' parameter: %d."),this.base),gettext("Strictly positive integer expected.")); } else { graphics.exprs = exprs; - model.ipar = base; - model.dstate = ini_c; + model.ipar = this.base; + model.dstate = this.ini_c; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/Sources/Modulo_Count.pickle b/js/Sources/Modulo_Count.pickle index 0d1dde24..dab0d124 100644 --- a/js/Sources/Modulo_Count.pickle +++ b/js/Sources/Modulo_Count.pickle @@ -4,6 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'base' +p3 +aS'ini_c' +p4 +atp5 +Rp6 .
\ No newline at end of file diff --git a/js/Sources/PULSE_SC.pickle b/js/Sources/PULSE_SC.pickle index 2a35c6de..0fb8e63d 100644 --- a/js/Sources/PULSE_SC.pickle +++ b/js/Sources/PULSE_SC.pickle @@ -4,8 +4,16 @@ p0 ((lp1 S'needcompile' p2 -aS'x' +aS'scicos_context.W' p3 -atp4 -Rp5 +aS'x' +p4 +aS'scicos_context.A' +p5 +aS'scicos_context.F' +p6 +aS'scicos_context.E' +p7 +atp8 +Rp9 .
\ No newline at end of file diff --git a/js/Sources/RAMP.js b/js/Sources/RAMP.js index ef936b69..41a7654c 100644 --- a/js/Sources/RAMP.js +++ b/js/Sources/RAMP.js @@ -1,10 +1,10 @@ /* autogenerated from "macros/Sources/RAMP.sci" */ function RAMP() { RAMP.prototype.define = function RAMP() { - slope = 0; - iout = 0; - stt = 0; - rpar = [[slope],[stt],[iout]]; + this.slope = 0; + this.iout = 0; + this.stt = 0; + rpar = [[this.slope],[this.stt],[this.iout]]; model = scicos_model(); model.sim = list("ramp",4); model.in1 = []; @@ -30,14 +30,14 @@ function RAMP() { 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); + [ok,this.slope,this.stt,this.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) { - block_parameter_error(msprintf(gettext("Wrong value for \'Start Time\' parameter: %e."),stt),gettext("Null or positive integer expected.")); + if (this.stt<0) { + block_parameter_error(msprintf(gettext("Wrong value for \'Start Time\' parameter: %e."),this.stt),gettext("Null or positive integer expected.")); } else { - model.rpar = [[slope],[stt],[iout]]; + model.rpar = [[this.slope],[this.stt],[this.iout]]; graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = model; diff --git a/js/Sources/RAMP.pickle b/js/Sources/RAMP.pickle index 0d1dde24..56252057 100644 --- a/js/Sources/RAMP.pickle +++ b/js/Sources/RAMP.pickle @@ -2,8 +2,14 @@ c__builtin__ set p0 ((lp1 -S'x' +S'slope' p2 -atp3 -Rp4 +aS'x' +p3 +aS'stt' +p4 +aS'iout' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/Sources/RAND_f.js b/js/Sources/RAND_f.js index 9af2134d..5f29e7aa 100644 --- a/js/Sources/RAND_f.js +++ b/js/Sources/RAND_f.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Sources/RAND_f.sci" */ function RAND_f() { RAND_f.prototype.define = function RAND_f() { - a = 0; - b = 1; + this.a = 0; + this.b = 1; dt = 0; out = 1; - flag = 0; + this.flag = 0; model = scicos_model(); model.sim = "rndblk"; model.out = out; model.evtin = 1; - model.dstate = [[int(rand()*(10^7-1))],[0*a.slice()]]; - model.rpar = [[a.slice()],[b.slice()]]; - model.ipar = flag; + model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; + model.rpar = [[this.a.slice()],[this.b.slice()]]; + model.ipar = this.flag; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = [[string(flag)],[sci2exp(a.slice())],[sci2exp(b.slice())],[string(model.dstate[1-1])]]; + exprs = [[string(this.flag)],[sci2exp(this.a.slice())],[sci2exp(this.b.slice())],[string(model.dstate[1-1])]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -37,19 +37,19 @@ function RAND_f() { exprs = [[exprs],[string(model.dstate[1-1])]]; } while (true) { - [ok,flag,a,b,seed_c,exprs] = scicos_getvalue([["Set Random generator block parameters"],["flag = 0 : Uniform distribution A is min and A+B max"],["flag = 1 : Normal distribution A is mean and B deviation"],[" "],["A and B must be vector with equal sizes"],["seed is the seed of random number generator (integer<2**31)"]],[["flag"],["A"],["B"],["seed"]],list("vec",1,"vec",-1,"vec","size(%2,\'*\')","vec",1),exprs); + [ok,this.flag,this.a,this.b,this.seed_c,exprs] = scicos_getvalue([["Set Random generator block parameters"],["flag = 0 : Uniform distribution A is min and A+B max"],["flag = 1 : Normal distribution A is mean and B deviation"],[" "],["A and B must be vector with equal sizes"],["seed is the seed of random number generator (integer<2**31)"]],[["flag"],["A"],["B"],["seed"]],list("vec",1,"vec",-1,"vec","size(%2,\'*\')","vec",1),exprs); if (!ok) { break; } - if (flag!=0&&flag!=1) { + if (this.flag!=0&&this.flag!=1) { message("flag must be equal to 1 or 0"); } else { - nout = size(a,"*"); + nout = size(this.a,"*"); graphics.exprs = exprs; model.out = nout; - model.ipar = flag; - model.rpar = [[a.slice()],[b.slice()]]; - model.dstate = [[seed_c],[0*a.slice()]]; + model.ipar = this.flag; + model.rpar = [[this.a.slice()],[this.b.slice()]]; + model.dstate = [[this.seed_c],[0*this.a.slice()]]; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/Sources/RAND_f.pickle b/js/Sources/RAND_f.pickle index 0d1dde24..04c9c136 100644 --- a/js/Sources/RAND_f.pickle +++ b/js/Sources/RAND_f.pickle @@ -2,8 +2,16 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +aS'flag' +p4 +aS'b' +p5 +aS'seed_c' +p6 +atp7 +Rp8 .
\ No newline at end of file diff --git a/js/Sources/RAND_m.js b/js/Sources/RAND_m.js index d3c62d7e..cf5f934b 100644 --- a/js/Sources/RAND_m.js +++ b/js/Sources/RAND_m.js @@ -1,10 +1,10 @@ /* autogenerated from "macros/Sources/RAND_m.sci" */ function RAND_m() { RAND_m.prototype.define = function RAND_m() { - a = 0; - b = 1; + this.a = 0; + this.b = 1; dt = 0; - flag = 0; + this.flag = 0; function_name = "rndblk_m"; funtyp = 4; model = scicos_model(); @@ -18,13 +18,13 @@ function RAND_m() { model.evtin = 1; model.evtout = []; model.state = []; - model.dstate = [[int(rand()*(10^7-1))],[0*a.slice()]]; - model.rpar = [a.slice(),b.slice()]; - model.ipar = flag; + model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; + model.rpar = [this.a.slice(),this.b.slice()]; + model.ipar = this.flag; model.blocktype = "d"; model.firing = []; model.dep_ut = [false,false]; - exprs = [[sci2exp(1)],[string(flag)],[sci2exp([a])],[sci2exp([b])],[sci2exp([model.dstate[1-1],int(rand()*(10^7-1))])]]; + exprs = [[sci2exp(1)],[string(this.flag)],[sci2exp([this.a])],[sci2exp([this.b])],[sci2exp([model.dstate[1-1],int(rand()*(10^7-1))])]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -43,24 +43,24 @@ function RAND_m() { exprs[9-1] = []; } while (true) { - [ok,typ,flag,a,b,seed_c,exprs] = scicos_getvalue([["Set Random generator block parameters"],["flag = 0 : Uniform distribution A is min and A+B max"],["flag = 1 : Normal distribution A is mean and B deviation"],[" "],["A and B must be matrix with equal sizes"]],[["Datatype(1=real double 2=complex)"],["flag"],["A"],["B"],["SEED"]],list("vec",1,"vec",1,"mat",[-1,-2],"mat","[-1 -2]","mat",[1,2]),exprs); + [ok,this.typ,this.flag,this.a,this.b,this.seed_c,exprs] = scicos_getvalue([["Set Random generator block parameters"],["flag = 0 : Uniform distribution A is min and A+B max"],["flag = 1 : Normal distribution A is mean and B deviation"],[" "],["A and B must be matrix with equal sizes"]],[["Datatype(1=real double 2=complex)"],["flag"],["A"],["B"],["SEED"]],list("vec",1,"vec",1,"mat",[-1,-2],"mat","[-1 -2]","mat",[1,2]),exprs); if (!ok) { break; } - if (flag!=0&&flag!=1) { + if (this.flag!=0&&this.flag!=1) { message("flag must be equal to 1 or 0"); } else { - out = size(a); - if (typ==1) { + out = size(this.a); + if (this.typ==1) { function_name = "rndblk_m"; - model.rpar = [[real(a.slice())],[real(b.slice())]]; - model.dstate = [[seed_c[1-1]],[0*real(a.slice())]]; + model.rpar = [[real(this.a.slice())],[real(this.b.slice())]]; + model.dstate = [[this.seed_c[1-1]],[0*real(this.a.slice())]]; ot = 1; - } else if (typ==2) { + } else if (this.typ==2) { function_name = "rndblkz_m"; ot = 2; - model.rpar = [[real(a.slice())],[imag(a.slice())],[real(b.slice())],[imag(b.slice())]]; - model.dstate = [[seed_c.slice()],[0*[[real(a.slice())],[imag(a.slice())]]]]; + model.rpar = [[real(this.a.slice())],[imag(this.a.slice())],[real(this.b.slice())],[imag(this.b.slice())]]; + model.dstate = [[this.seed_c.slice()],[0*[[real(this.a.slice())],[imag(this.a.slice())]]]]; } else { message("Datatype is not supported"); ok = false; @@ -70,7 +70,7 @@ function RAND_m() { if (ok) { model.sim = list(function_name,4); graphics.exprs = exprs; - model.ipar = flag; + model.ipar = this.flag; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/Sources/RAND_m.pickle b/js/Sources/RAND_m.pickle index 0d1dde24..b75e87b8 100644 --- a/js/Sources/RAND_m.pickle +++ b/js/Sources/RAND_m.pickle @@ -2,8 +2,18 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'b' +p3 +aS'seed_c' +p4 +aS'flag' +p5 +aS'x' +p6 +aS'typ' +p7 +atp8 +Rp9 .
\ No newline at end of file diff --git a/js/Sources/READAU_f.js b/js/Sources/READAU_f.js index e7f87a08..27f1bc2c 100644 --- a/js/Sources/READAU_f.js +++ b/js/Sources/READAU_f.js @@ -4,10 +4,10 @@ function READAU_f() { frmt = "uc "; fname = "test.au"; lunit = 0; - N = 20; + this.N = 20; M = 1; tmask = []; - swap = 0; + this.swap = 0; offset = 1; outmask = 1; ievt = 0; @@ -16,11 +16,11 @@ function READAU_f() { model.sim = list("readau",2); model.out = nout; model.evtin = 1; - model.dstate = [[1],[1],[lunit],[zeros(N*M,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; + model.dstate = [[1],[1],[lunit],[zeros(this.N*M,1)]]; + model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[M],[this.swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = [[fname],[string(N)],[string(swap)]]; + exprs = [[fname],[string(this.N)],[string(this.swap)]]; gr_i = []; this.x = standard_define([5,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -43,7 +43,7 @@ function READAU_f() { lunit = dstate[3-1]; fname = exprs[1-1]; while (true) { - [ok,fname1,N,swap,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"READAU_f")],[" "],[gettext("(Read Audio File)")],[" "],[gettext("Read is done on a binary \'.au\' file")]],[[gettext("Input File Name")],[gettext("Buffer size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("str",1,"vec",1,"vec",1),exprs); + [ok,this.fname1,this.N,this.swap,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"READAU_f")],[" "],[gettext("(Read Audio File)")],[" "],[gettext("Read is done on a binary \'.au\' file")]],[[gettext("Input File Name")],[gettext("Buffer size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("str",1,"vec",1,"vec",1),exprs); tmask1 = []; outmask = 1; frmt1 = "uc"; @@ -52,25 +52,25 @@ function READAU_f() { if (!ok) { break; } - fname1 = stripblanks(fname1); + this.fname1 = stripblanks(this.fname1); frmt1 = stripblanks(frmt1); - if (this.alreadyran&&fname1!=fname) { + if (this.alreadyran&&this.fname1!=fname) { block_parameter_error(gettext("Simulation running !!! You cannot modify Input file name"),gettext("End current simulation first.")); - } else if (fname1=="") { + } else if (this.fname1=="") { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Input File Name")),gettext("You must provide a filename.")); - } else if (N<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer size"),N),msprintf(gettext("Must be greater than %d."),1)); - } else if (this.alreadyran&&(N!=ipar[6-1])) { + } else if (this.N<1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer size"),this.N),msprintf(gettext("Must be greater than %d."),1)); + } else if (this.alreadyran&&(this.N!=ipar[6-1])) { block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Buffer Size")),gettext("End current simulation first.")); - } else if (swap!=0&&swap!=1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]")); + } else if (this.swap!=0&&this.swap!=1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),this.swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]")); } else { [model,graphics,ok] = check_io(model,graphics,[],1,1,[]); frmt1 = part(frmt1,1,3); if (ok) { - ipar = [[length(fname1)],[this._str2code[frmt1-1]],[0],[N],[M],[swap],[offset,this._str2code[fname1-1]],[tmask1,outmask.slice()]]; - if (prod(size(dstate))!=(N*M)+3) { - dstate = [[-1],[-1],[lunit],[zeros(N*M,1)]]; + ipar = [[length(this.fname1)],[this._str2code[frmt1-1]],[0],[this.N],[M],[this.swap],[offset,this._str2code[this.fname1-1]],[tmask1,outmask.slice()]]; + if (prod(size(dstate))!=(this.N*M)+3) { + dstate = [[-1],[-1],[lunit],[zeros(this.N*M,1)]]; } model.dstate = dstate; model.ipar = ipar; diff --git a/js/Sources/READAU_f.pickle b/js/Sources/READAU_f.pickle index 8a32035f..7f5b1f0c 100644 --- a/js/Sources/READAU_f.pickle +++ b/js/Sources/READAU_f.pickle @@ -4,10 +4,16 @@ p0 ((lp1 S'_str2code' p2 -aS'x' +aS'fname1' p3 -aS'alreadyran' +aS'N' p4 -atp5 -Rp6 +aS'alreadyran' +p5 +aS'x' +p6 +aS'swap' +p7 +atp8 +Rp9 .
\ No newline at end of file diff --git a/js/Sources/READC_f.js b/js/Sources/READC_f.js index 74589dfa..121a999d 100644 --- a/js/Sources/READC_f.js +++ b/js/Sources/READC_f.js @@ -4,27 +4,27 @@ function READC_f() { frmt = "d "; fname = "foo"; lunit = 0; - N = 20; - M = 1; + this.N = 20; + this.M = 1; rpar = []; tmask = 0; - swap = 0; - offset = 1; - outmask = 1; + this.swap = 0; + this.offset = 1; + this.outmask = 1; ievt = 0; - nout = size(outmask,"*"); - ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; + nout = size(this.outmask,"*"); + ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; model = scicos_model(); model.sim = list("readc",2); model.out = nout; model.evtin = 1; model.evtout = []; - model.dstate = [[1],[1],[lunit],[zeros(N*M,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; + model.dstate = [[1],[1],[lunit],[zeros(this.N*this.M,1)]]; + model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; model.blocktype = "d"; model.firing = -1; model.dep_ut = [false,false]; - exprs = [["[]"],[sci2exp(outmask)],[fname],[frmt],[string(M)],[string(N)],[string(offset)],[string(swap)]]; + exprs = [["[]"],[sci2exp(this.outmask)],[fname],[frmt],[string(this.M)],[string(this.N)],[string(this.offset)],[string(this.swap)]]; gr_i = []; this.x = standard_define([4,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -48,63 +48,63 @@ function READC_f() { fname = exprs[3-1]; frmt = exprs[4-1]; while (true) { - [ok,tmask1,outmask,fname1,frmt1,M,N,offset,swap,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"READC_f")],[" "],[gettext("Read from C binary file")]],[[gettext("Time Record Selection")],[gettext("Outputs Record Selection")],[gettext("Input File Name")],[gettext("Input Format")],[gettext("Record Size")],[gettext("Buffer Size")],[gettext("Initial Record Index")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); + [ok,this.tmask1,this.outmask,this.fname1,this.frmt1,this.M,this.N,this.offset,this.swap,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"READC_f")],[" "],[gettext("Read from C binary file")]],[[gettext("Time Record Selection")],[gettext("Outputs Record Selection")],[gettext("Input File Name")],[gettext("Input Format")],[gettext("Record Size")],[gettext("Buffer Size")],[gettext("Initial Record Index")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - fname1 = pathconvert(stripblanks(fname1),false,true); - frmt1 = stripblanks(frmt1); + this.fname1 = pathconvert(stripblanks(this.fname1),false,true); + this.frmt1 = stripblanks(this.frmt1); fmts = ["s","l","d","f","c","us","ul","uc","ull","uls","ubl","ubs","dl","fl","ll","sl","db","fb","lb","sb"]; - nout = size(outmask,"*"); - if (prod(size(tmask1))>1) { + nout = size(this.outmask,"*"); + if (prod(size(this.tmask1))>1) { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Time Record Selection")),gettext("Must be a scalar or an empty matrix.")); - } else if (and(frmt1!=fmts)) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Input Format"),frmt1),gettext("Valid formats are: "+strcat(fmts,", "))); - } else if (this.alreadyran&&fname1!=fname) { + } else if (and(this.frmt1!=fmts)) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Input Format"),this.frmt1),gettext("Valid formats are: "+strcat(fmts,", "))); + } else if (this.alreadyran&&this.fname1!=fname) { block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running"),gettext("Input File Name")),gettext("End current simulation first.")); - } else if (N!=ipar[6-1]&&this.alreadyran) { + } else if (this.N!=ipar[6-1]&&this.alreadyran) { block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Buffer Size")),gettext("End current simulation first")); - } else if (this.alreadyran&&size(tmask1)!=size(tmask)) { + } else if (this.alreadyran&&size(this.tmask1)!=size(tmask)) { block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Time Record Selection")),gettext("End current simulation first.")); - } else if (fname1=="") { + } else if (this.fname1=="") { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Input File Name")),gettext("You must provide a file name.")); - } else if (M<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Record Size"),M),gettext("Strictly positive integer expected.")); - } else if (tmask1!=[]&&(tmask1<1||tmask1>M)) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Time Record Selection"),tmask1),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(M)+"]")); + } else if (this.M<1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Record Size"),this.M),gettext("Strictly positive integer expected.")); + } else if (this.tmask1!=[]&&(this.tmask1<1||this.tmask1>this.M)) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Time Record Selection"),this.tmask1),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(this.M)+"]")); } else if (nout==0) { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Outputs Record Selection"),nout),gettext("Strictly positive integer expected.")); - } else if (nout>M) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Outputs Record Selection"),nout),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(M)+"]")); - } else if (max(outmask)>M||min(outmask)<1) { - block_parameter_error(msprintf(gettext("Wrong value for indexes in \'%s\' parameter: %s."),gettext("Outputs Record Selection"),strcat(string(outmask.slice())," ")),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(M)+"]")); - } else if (N<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),N),gettext("Strictly positive integer expected.")); - } else if (swap!=0&&swap!=1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]")); - } else if (offset<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Initial Record Index"),offset),gettext("Strictly positive integer expected.")); + } else if (nout>this.M) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Outputs Record Selection"),nout),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(this.M)+"]")); + } else if (max(this.outmask)>this.M||min(this.outmask)<1) { + block_parameter_error(msprintf(gettext("Wrong value for indexes in \'%s\' parameter: %s."),gettext("Outputs Record Selection"),strcat(string(this.outmask.slice())," ")),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(this.M)+"]")); + } else if (this.N<1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),this.N),gettext("Strictly positive integer expected.")); + } else if (this.swap!=0&&this.swap!=1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),this.swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]")); + } else if (this.offset<1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Initial Record Index"),this.offset),gettext("Strictly positive integer expected.")); } else { - if (tmask1==[]) { + if (this.tmask1==[]) { ievt = 0; - tmask1 = 0; + this.tmask1 = 0; outpt = []; } else { ievt = 1; outpt = 1; } - out = size(outmask,"*"); + out = size(this.outmask,"*"); [model,graphics,ok] = check_io(model,graphics,[],out,1,outpt); - frmt1 = part(frmt1,1,3); + this.frmt1 = part(this.frmt1,1,3); if (ok) { if (ievt==0) { model.firing = -1; } else { model.firing = 0; } - ipar = [[length(fname1)],[this._str2code[frmt1-1]],[ievt],[N],[M],[swap],[offset],[this._str2code[fname1-1]],[tmask1],[outmask.slice()]]; - if (prod(size(dstate))!=(N*M)+3) { - dstate = [[-1],[-1],[lunit],[zeros(N*M,1)]]; + ipar = [[length(this.fname1)],[this._str2code[this.frmt1-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[this.fname1-1]],[this.tmask1],[this.outmask.slice()]]; + if (prod(size(dstate))!=(this.N*this.M)+3) { + dstate = [[-1],[-1],[lunit],[zeros(this.N*this.M,1)]]; } model.dstate = dstate; model.ipar = ipar; diff --git a/js/Sources/READC_f.pickle b/js/Sources/READC_f.pickle index 8a32035f..00927330 100644 --- a/js/Sources/READC_f.pickle +++ b/js/Sources/READC_f.pickle @@ -4,10 +4,26 @@ p0 ((lp1 S'_str2code' p2 -aS'x' +aS'outmask' p3 -aS'alreadyran' +aS'M' p4 -atp5 -Rp6 +aS'frmt1' +p5 +aS'fname1' +p6 +aS'N' +p7 +aS'swap' +p8 +aS'offset' +p9 +aS'x' +p10 +aS'tmask1' +p11 +aS'alreadyran' +p12 +atp13 +Rp14 .
\ No newline at end of file diff --git a/js/Sources/RFILE_f.js b/js/Sources/RFILE_f.js index dc0b6a87..399eac41 100644 --- a/js/Sources/RFILE_f.js +++ b/js/Sources/RFILE_f.js @@ -6,21 +6,21 @@ function RFILE_f() { frmt = "(7(e10.3,1x))"; fname = "foo"; lunit = 0; - N = 2; + this.N = 2; rpar = []; tmask = 0; - outmask = 1; - ipar = [[length(fname)],[length(frmt)],[0],[N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[outmask]]; - dstate = [[1],[1],[lunit],[zeros((nout)*N,1)]]; + this.outmask = 1; + ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; + dstate = [[1],[1],[lunit],[zeros((nout)*this.N,1)]]; model = scicos_model(); model.sim = "readf"; model.out = nout; model.evtin = 1; model.dstate = dstate; - model.ipar = [[length(fname)],[length(frmt)],[0],[N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[outmask]]; + model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = [[sci2exp([])],[sci2exp(outmask)],[fname],[frmt],[string(N)],[sci2exp(out)]]; + exprs = [[sci2exp([])],[sci2exp(this.outmask)],[fname],[frmt],[string(this.N)],[sci2exp(out)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -38,7 +38,7 @@ function RFILE_f() { dstate = model.dstate; ipar = model.ipar; ievt = ipar[3-1]; - N = ipar[4-1]; + this.N = ipar[4-1]; imask = 5+ipar[1-1]+ipar[2-1]; tmask = ipar[imask-1]; lunit = dstate[3-1]; @@ -48,38 +48,38 @@ function RFILE_f() { exprs[6-1] = []; } while (true) { - [ok,tmask1,outmask,fname1,frmt1,N,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"RFILE_f")],[" "],[gettext("Read from an input file")],[" "],[gettext("Read is done on:")],[gettext(" - A binary file if no format given")],[gettext(" - A formatted text file if a format (fortran type) is given")]],[[gettext("Time Record Selection")],[gettext("Outputs Record Selection")],[gettext("Input File Name")],[gettext("Input Format")],[gettext("Buffer Size")]],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1),exprs); + [ok,this.tmask1,this.outmask,this.fname1,this.frmt1,this.N,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"RFILE_f")],[" "],[gettext("Read from an input file")],[" "],[gettext("Read is done on:")],[gettext(" - A binary file if no format given")],[gettext(" - A formatted text file if a format (fortran type) is given")]],[[gettext("Time Record Selection")],[gettext("Outputs Record Selection")],[gettext("Input File Name")],[gettext("Input Format")],[gettext("Buffer Size")]],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1),exprs); if (!ok) { break; } - fname1 = pathconvert(stripblanks(fname1),false,true); - frmt1 = stripblanks(frmt1); - nout = size(outmask,"*"); - if (prod(size(tmask1))>1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Time Record Selection"),strcat(string(tmask1.slice())," ")),gettext("Empty matrix or scalar expected.")); - } else if (tmask1!=[]&&tmask1<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d"),gettext("Time Record Selection"),tmask1),gettext("Strictly positive integer expected.")); - } else if (lunit>0&&min(length(frmt),1)!=min(length(frmt1),1)) { + this.fname1 = pathconvert(stripblanks(this.fname1),false,true); + this.frmt1 = stripblanks(this.frmt1); + nout = size(this.outmask,"*"); + if (prod(size(this.tmask1))>1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Time Record Selection"),strcat(string(this.tmask1.slice())," ")),gettext("Empty matrix or scalar expected.")); + } else if (this.tmask1!=[]&&this.tmask1<1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d"),gettext("Time Record Selection"),this.tmask1),gettext("Strictly positive integer expected.")); + } else if (lunit>0&&min(length(frmt),1)!=min(length(this.frmt1),1)) { block_parameter_error([gettext("Simulation running !!! You cannot switch <br />between formatted and unformatted")],gettext("End current simulation first.")); - } else if (lunit>0&&fname1!=fname) { + } else if (lunit>0&&this.fname1!=fname) { block_parameter_error(gettext("Simulation running !!! You cannot modify \'Input File Name\'"),gettext("End current simulation first.")); - } else if (lunit>0&&size(tmask1)!=size(tmask)) { + } else if (lunit>0&&size(this.tmask1)!=size(tmask)) { block_parameter_error(gettext("Simulation running !!! You cannot modify \'Time Record Selection\'"),gettext("End current simulation first.")); - } else if (fname1=="") { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s"),gettext("Input File Name"),fname1),gettext("You must provide a filename.")); - } else if (frmt1!=""&&(part(frmt1,1)!="("||part(frmt1,length(frmt1))!=")")) { - block_parameter_error(msprintf(gettext("Wrong format for \'%s\' parameter: %s."),gettext("Input Format"),frmt1),gettext("You must enclose the format\'s string between parentheses.")); - } else if (N<2) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),N),gettext("Buffer size must be at least 2.")); + } else if (this.fname1=="") { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s"),gettext("Input File Name"),this.fname1),gettext("You must provide a filename.")); + } else if (this.frmt1!=""&&(part(this.frmt1,1)!="("||part(this.frmt1,length(this.frmt1))!=")")) { + block_parameter_error(msprintf(gettext("Wrong format for \'%s\' parameter: %s."),gettext("Input Format"),this.frmt1),gettext("You must enclose the format\'s string between parentheses.")); + } else if (this.N<2) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),this.N),gettext("Buffer size must be at least 2.")); } else if (nout==0) { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Outputs Record Selection"),nout),gettext("You must read at least one field in record.")); - } else if (min(outmask)<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s"),gettext("Outputs Record Selection"),strcat(string(outmask.slice())," ")),gettext("Strictly positive indexes expected.")); + } else if (min(this.outmask)<1) { + block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s"),gettext("Outputs Record Selection"),strcat(string(this.outmask.slice())," ")),gettext("Strictly positive indexes expected.")); } else { - if (tmask1==[]) { + if (this.tmask1==[]) { ievt = 0; cout = []; - tmask1 = 0; + this.tmask1 = 0; } else { ievt = 1; cout = 1; @@ -91,9 +91,9 @@ function RFILE_f() { } else { model.firing = 0; } - ipar = [[length(fname1)],[length(frmt1)],[ievt],[N],[this._str2code[fname1-1]],[this._str2code[frmt1-1]],[tmask1],[outmask.slice()]]; - if (prod(size(dstate))!=(nout+ievt)*N+3) { - dstate = [[-1],[-1],[lunit],[zeros((nout+ievt)*N,1)]]; + ipar = [[length(this.fname1)],[length(this.frmt1)],[ievt],[this.N],[this._str2code[this.fname1-1]],[this._str2code[this.frmt1-1]],[this.tmask1],[this.outmask.slice()]]; + if (prod(size(dstate))!=(nout+ievt)*this.N+3) { + dstate = [[-1],[-1],[lunit],[zeros((nout+ievt)*this.N,1)]]; } model.dstate = dstate; model.ipar = ipar; diff --git a/js/Sources/RFILE_f.pickle b/js/Sources/RFILE_f.pickle index bcacb8ca..09ca1693 100644 --- a/js/Sources/RFILE_f.pickle +++ b/js/Sources/RFILE_f.pickle @@ -4,8 +4,18 @@ p0 ((lp1 S'_str2code' p2 -aS'x' +aS'outmask' p3 -atp4 -Rp5 +aS'frmt1' +p4 +aS'fname1' +p5 +aS'N' +p6 +aS'x' +p7 +aS'tmask1' +p8 +atp9 +Rp10 .
\ No newline at end of file diff --git a/js/Sources/STEP.js b/js/Sources/STEP.js index 997ee61e..cb0252ce 100644 --- a/js/Sources/STEP.js +++ b/js/Sources/STEP.js @@ -29,33 +29,33 @@ function STEP() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,temps,in1,fi,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"STEP_FUNCTION")],[" "],[gettext("Step Function")],[" "]],[[gettext("Step Time")],[gettext("Initial Value")],[gettext("Final Value")]],list("vec",1,"vec",-1,"vec",-1),exprs); + [ok,this.temps,this.in1,this.fi,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"STEP_FUNCTION")],[" "],[gettext("Step Function")],[" "]],[[gettext("Step Time")],[gettext("Initial Value")],[gettext("Final Value")]],list("vec",1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - in1 = in1.slice(); - fi = fi.slice(); - if (size(in1,"*")!=size(fi,"*")) { - if (size(in1,"*")==1) { - in1 = in1*ones(fi); - } else if (size(fi,"*")==1) { - fi = fi*ones(in1); + this.in1 = this.in1.slice(); + this.fi = this.fi.slice(); + if (size(this.in1,"*")!=size(this.fi,"*")) { + if (size(this.in1,"*")==1) { + this.in1 = this.in1*ones(this.fi); + } else if (size(this.fi,"*")==1) { + this.fi = this.fi*ones(this.in1); } else { - block_parameter_error(msprintf(gettext("\'Initial Value\' and \'Final Value\': incompatible sizes: %d and %d."),size(in1,"*"),size(fi,"*")),gettext("Same sizes expected.")); + block_parameter_error(msprintf(gettext("\'Initial Value\' and \'Final Value\': incompatible sizes: %d and %d."),size(this.in1,"*"),size(this.fi,"*")),gettext("Same sizes expected.")); ok = false; } } if (ok) { model.out2 = 1; model.outtyp = 1; - [model,graphics,ok] = check_io(model,graphics,[],size(fi,"*"),1,1); + [model,graphics,ok] = check_io(model,graphics,[],size(this.fi,"*"),1,1); } if (ok) { - model.firing = temps; - if (temps==0) { - rpar = [[fi],[fi]]; + model.firing = this.temps; + if (this.temps==0) { + rpar = [[this.fi],[this.fi]]; } else { - rpar = [[in1],[fi]]; + rpar = [[this.in1],[this.fi]]; } model.rpar = rpar; graphics.exprs = exprs; diff --git a/js/Sources/STEP.pickle b/js/Sources/STEP.pickle index 0d1dde24..e7d16d1f 100644 --- a/js/Sources/STEP.pickle +++ b/js/Sources/STEP.pickle @@ -2,8 +2,14 @@ c__builtin__ set p0 ((lp1 -S'x' +S'temps' p2 -atp3 -Rp4 +aS'x' +p3 +aS'in1' +p4 +aS'fi' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/Sources/SampleCLK.js b/js/Sources/SampleCLK.js index 672acc54..741b0d59 100644 --- a/js/Sources/SampleCLK.js +++ b/js/Sources/SampleCLK.js @@ -23,24 +23,24 @@ function SampleCLK() { model = arg1.model; exprs = graphics.exprs; while (true) { - [ok,frequ,offset,exprs] = scicos_getvalue("Set block parameters",[["Sample time"],["Offset"]],list("vec",1,"vec",1),exprs); + [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",[["Sample time"],["Offset"]],list("vec",1,"vec",1),exprs); if (!ok) { break; } - if (frequ<0) { + if (this.frequ<0) { message("Frequency must be a positif number"); ok = false; } - if (abs(offset)>frequ) { + if (abs(this.offset)>this.frequ) { message("The |Offset| must be less than the Frequency"); ok = false; } if (ok) { - if (or(model.rpar.slice()!=[[frequ],[offset]])) { + if (or(model.rpar.slice()!=[[this.frequ],[this.offset]])) { needcompile = 4; y = needcompile; } - model.rpar = [[frequ],[offset]]; + model.rpar = [[this.frequ],[this.offset]]; model.evtout = 1; model.firing = -1; graphics.exprs = exprs; diff --git a/js/Sources/SampleCLK.pickle b/js/Sources/SampleCLK.pickle index 0d1dde24..ab6422e9 100644 --- a/js/Sources/SampleCLK.pickle +++ b/js/Sources/SampleCLK.pickle @@ -4,6 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'frequ' +p3 +aS'offset' +p4 +atp5 +Rp6 .
\ No newline at end of file diff --git a/js/Sources/TKSCALE.js b/js/Sources/TKSCALE.js index 00866c29..ff0f2918 100644 --- a/js/Sources/TKSCALE.js +++ b/js/Sources/TKSCALE.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/Sources/TKSCALE.sci" */ function TKSCALE() { TKSCALE.prototype.define = function TKSCALE() { - a = -10; - b = 10; - f = 1; + this.a = -10; + this.b = 10; + this.f = 1; model = scicos_model(); model.sim = list("tkscaleblk",5); model.out = 1; model.evtin = 1; - model.rpar = [[a],[b],[f]]; + model.rpar = [[this.a],[this.b],[this.f]]; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = [[sci2exp(a)],[sci2exp(b)],[sci2exp(f)]]; + exprs = [[sci2exp(this.a)],[sci2exp(this.b)],[sci2exp(this.f)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -26,10 +26,10 @@ function TKSCALE() { graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; - [ok,a,b,f,exprs] = scicos_getvalue("Set scale block parameters",[["Min value"],["Max value"],["Normalization"]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.a,this.b,this.f,exprs] = scicos_getvalue("Set scale block parameters",[["Min value"],["Max value"],["Normalization"]],list("vec",1,"vec",1,"vec",1),exprs); if (ok) { graphics.exprs = exprs; - model.rpar = [[a],[b],[f]]; + model.rpar = [[this.a],[this.b],[this.f]]; this.x.graphics = graphics; this.x.model = model; } diff --git a/js/Sources/TKSCALE.pickle b/js/Sources/TKSCALE.pickle index 0d1dde24..0fdb828e 100644 --- a/js/Sources/TKSCALE.pickle +++ b/js/Sources/TKSCALE.pickle @@ -2,8 +2,14 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +aS'b' +p4 +aS'f' +p5 +atp6 +Rp7 .
\ No newline at end of file |