diff options
author | Sunil Shetye | 2018-07-11 13:05:13 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-11 15:21:08 +0530 |
commit | 079d0b4a3ec15a4d7d2644484d116df9d1c694bb (patch) | |
tree | 785ed59b5b238203a9e91f3e323da59d1083d86e /js/Sinks | |
parent | 0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff) | |
download | sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2 sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip |
fix assignment to list
Diffstat (limited to 'js/Sinks')
35 files changed, 836 insertions, 843 deletions
diff --git a/js/Sinks/AFFICH_m.js b/js/Sinks/AFFICH_m.js index 35e05e03..015e00f8 100644 --- a/js/Sinks/AFFICH_m.js +++ b/js/Sinks/AFFICH_m.js @@ -18,8 +18,8 @@ function AFFICH_m() { this.model.firing = []; this.model.dep_ut = [true,false]; this.model.label = new ScilabString([""]); - exprs = [[sci2exp([this.model.in1,this.model.in2])],[string(this.font)],[string(this.fontsize)],[string(this.colr)],[string(this.nt)],[string(this.nd)],[string(0)]]; - gr_i = []; + var exprs = [[sci2exp([this.model.in1,this.model.in2])],[string(this.font)],[string(this.fontsize)],[string(this.colr)],[string(this.nt)],[string(this.nd)],[string(0)]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new AfficheBlock(this.x); } @@ -47,43 +47,46 @@ function AFFICH_m() { this.nd = parseFloat(arguments[0]["nd"]) this.herit = arguments[0]["herit"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.in1,this.font,this.fontsize,this.colr,this.nt,this.nd,this.herit,exprs] = scicos_getvalue("Set parameters",["Input Size","Font number","Font size","Color","Total number of digits","Number of rational part digits","Block inherits (1) or not (0)"],list("mat",[1,2],"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (this.font<=0) { - mess = [[mess],["Font number must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Font number must be positive"],[" "]]; + var ok = false; } if (this.fontsize<=0) { - mess = [[mess],["Font size must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Font size must be positive"],[" "]]; + var ok = false; } if (this.nt<=3) { - mess = [[mess],["Total number of digits must be greater than 3"],[" "]]; - ok = false; + var mess = [[mess],["Total number of digits must be greater than 3"],[" "]]; + var ok = false; } if (this.nd<0) { - mess = [[mess],["Number of rational part digits must be ","greater or equal 0"],[" "]]; - ok = false; + var mess = [[mess],["Number of rational part digits must be ","greater or equal 0"],[" "]]; + var ok = false; } if (!ok) { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (!or(this.herit==[0,1])) { - mess = [[mess],["Accept inherited values are 0 and 1"],[" "]]; - ok = false; + var mess = [[mess],["Accept inherited values are 0 and 1"],[" "]]; + var ok = false; } if (!ok) { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list(this.in1,1),list(),ones(1-this.herit,1),[]); + var tmpvar0 = set_io(this.model,graphics,list(this.in1,1),list(),ones(1-this.herit,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { this.model.ipar = new ScilabDouble([this.font],[this.fontsize],[this.colr],[this.nt],[this.nd],[this.in1[1-1][1-1]]); diff --git a/js/Sinks/AFFICH_m.pickle b/js/Sinks/AFFICH_m.pickle index c9b00e5d..17d10152 100644 --- a/js/Sinks/AFFICH_m.pickle +++ b/js/Sinks/AFFICH_m.pickle @@ -76,46 +76,43 @@ p21 sS'mess' p22 g2 -sS'[this.model,graphics,ok]' -p23 -g7 sS'in1' -p24 +p23 g17 sS'fontsize' -p25 +p24 g7 sS'graphics.exprs' -p26 +p25 NsS'model.ipar' -p27 +p26 g2 sS'typ' -p28 +p27 g17 sS'ok' -p29 +p28 S'boolean' -p30 +p29 sS'model.blocktype' -p31 +p30 g19 sS'model.dep_ut' -p32 +p31 g17 sS'exprs' -p33 +p32 g2 sS'gr_i' -p34 +p33 g17 sS'y' -p35 +p34 g17 sS'x' -p36 +p35 g7 sS'model' -p37 +p36 g4 s.
\ No newline at end of file diff --git a/js/Sinks/BARXY.js b/js/Sinks/BARXY.js index ab795976..e4d9be7c 100644 --- a/js/Sinks/BARXY.js +++ b/js/Sinks/BARXY.js @@ -41,26 +41,26 @@ function BARXY() { this.ymax = parseFloat(arguments[0]["ymax"]) this.thickness = arguments[0]["thickness"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.xmin,this.xmax,this.ymin,this.ymax,this.thickness,exprs] = scicos_getvalue("Set Scope parameters",["Xmin","Xmax","Ymin","Ymax","Segs Thickness"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (this.xmin>=this.xmax) { - mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; + var ok = false; } if (this.thickness<=0) { - mess = [[mess],["Thickness must be strictly positive."]]; - ok = false; + var mess = [[mess],["Thickness must be strictly positive."]]; + var ok = false; } if (!ok) { message(mess); diff --git a/js/Sinks/CANIMXY.js b/js/Sinks/CANIMXY.js index abf2ddcc..9e16f480 100644 --- a/js/Sinks/CANIMXY.js +++ b/js/Sinks/CANIMXY.js @@ -23,8 +23,8 @@ function CANIMXY() { this.model.blocktype = new ScilabString(["d"]); this.model.firing = []; this.model.dep_ut = [false,false]; - exprs = [[string(this.nbr_curves)],[string(this.clrs)],[string(this.siz)],[string(this.win)],["[]"],["[]"],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; - gr_i = []; + var exprs = [[string(this.nbr_curves)],[string(this.clrs)],[string(this.siz)],[string(this.win)],["[]"],["[]"],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -60,61 +60,64 @@ function CANIMXY() { this.ymax = parseFloat(arguments[0]["ymax"]) this.N = parseFloat(arguments[0]["N"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.xmin,this.xmax,this.ymin,this.ymax,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of Curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin","Xmax","Ymin","Ymax","Buffer size"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; + var ok = false; } if (this.nbr_curves<=0) { - mess = [[mess],["Number of curves cannot be negative or null"],[" "]]; - ok = false; + var mess = [[mess],["Number of curves cannot be negative or null"],[" "]]; + var ok = false; } if (this.N<1) { - mess = [[mess],["Buffer size must be at least 1"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 1"],[" "]]; + var ok = false; } if (this.N==1&&this.clrs>0) { - mess = [[mess],["Buffer size must be at least 2"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 2"],[" "]]; + var ok = false; } if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (this.xmin>=this.xmax) { - mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; + var ok = false; } if (!ok) { message(mess); } else { - in1 = this.nbr_curves*ones(2,1); - in2 = ones(2,1); - [this.model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); + var in1 = this.nbr_curves*ones(2,1); + var in2 = ones(2,1); + var tmpvar0 = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } - rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + var rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + var ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; this.model.rpar = new ScilabDouble(rpar); this.model.ipar = new ScilabDouble(ipar); graphics.exprs = exprs; diff --git a/js/Sinks/CANIMXY.pickle b/js/Sinks/CANIMXY.pickle index 75a79f02..806d781e 100644 --- a/js/Sinks/CANIMXY.pickle +++ b/js/Sinks/CANIMXY.pickle @@ -98,59 +98,56 @@ g2 sS'mess' p26 g4 -sS'[this.model,graphics,ok]' -p27 -g2 sS'in1' -p28 +p27 S'string' -p29 +p28 sS'in2' -p30 +p29 g2 sS'N' -p31 +p30 g2 sS'model.rpar' -p32 +p31 g4 sS'graphics.exprs' -p33 +p32 NsS'model.ipar' -p34 +p33 g4 sS'typ' -p35 +p34 g22 sS'ok' -p36 +p35 S'boolean' -p37 +p36 sS'model.blocktype' -p38 -g29 +p37 +g28 sS'model.dep_ut' -p39 +p38 g22 sS'exprs' -p40 +p39 g4 sS'gr_i' -p41 +p40 g22 sS'ipar' -p42 +p41 g4 sS'y' -p43 +p42 g22 sS'x' -p44 +p43 g2 sS'model' -p45 +p44 g15 sS'nbr_curves' -p46 +p45 g2 s.
\ No newline at end of file diff --git a/js/Sinks/CANIMXY3D.js b/js/Sinks/CANIMXY3D.js index 7b134fdb..88ddb6db 100644 --- a/js/Sinks/CANIMXY3D.js +++ b/js/Sinks/CANIMXY3D.js @@ -23,8 +23,8 @@ function CANIMXY3D() { this.model.blocktype = new ScilabString(["d"]); this.model.firing = []; this.model.dep_ut = [false,false]; - exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],["[]"],["[]"],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; - gr_i = []; + var exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],["[]"],["[]"],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -60,78 +60,81 @@ function CANIMXY3D() { this.param3ds = inverse(arguments[0]["param3ds"]) this.N = parseFloat(arguments[0]["N"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.vec_x,this.vec_y,this.vec_z,this.param3ds,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin and Xmax","Ymin and Ymax","Zmin and Zmax","Alpha and Theta","Buffer size"],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; + var ok = false; } if (size(this.clrs,"*")!=size(this.siz,"*")) { - mess = [[mess],["Colors and Size must have same size"],[" "]]; - ok = false; + var mess = [[mess],["Colors and Size must have same size"],[" "]]; + var ok = false; } if (this.nbr_curves<=0) { - mess = [[mess],["Number of curves cannot be negative or null"],[" "]]; - ok = false; + var mess = [[mess],["Number of curves cannot be negative or null"],[" "]]; + var ok = false; } if (size(this.clrs,"*")<this.nbr_curves) { - mess = [[mess],["You must have at least same size for clrs and the number of curves"],[" "]]; - ok = false; + var mess = [[mess],["You must have at least same size for clrs and the number of curves"],[" "]]; + var ok = false; } if (this.N<1) { - mess = [[mess],["Buffer size must be at least 1"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 1"],[" "]]; + var ok = false; } if (this.N<2) { for (i=1;i<=this.nbr_curves;i+=1) { if (this.clrs[i-1]>0) { - mess = [[mess],["Buffer size must be at least 2 or Change a color (must be <0)"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 2 or Change a color (must be <0)"],[" "]]; + var ok = false; } } } if (this.vec_y[1-1]>=this.vec_y[2-1]) { - mess = [[mess],["Ymax must be higher than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be higher than Ymin"],[" "]]; + var ok = false; } if (this.vec_x[1-1]>=this.vec_x[2-1]) { - mess = [[mess],["Xmax must be higher than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be higher than Xmin"],[" "]]; + var ok = false; } if (this.vec_z[1-1]>=this.vec_z[2-1]) { - mess = [[mess],["Zmax must be higher than Zmin"],[" "]]; - ok = false; + var mess = [[mess],["Zmax must be higher than Zmin"],[" "]]; + var ok = false; } if (!ok) { message(mess); } else { - in1 = this.nbr_curves*ones(3,1); - in2 = ones(3,1); - [this.model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); + var in1 = this.nbr_curves*ones(3,1); + var in2 = ones(3,1); + var tmpvar0 = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } - rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; - size_siz = size(this.siz,"*"); - ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + var rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; + var size_siz = size(this.siz,"*"); + var ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; this.model.rpar = new ScilabDouble(rpar); this.model.ipar = new ScilabDouble(ipar); graphics.exprs = exprs; diff --git a/js/Sinks/CANIMXY3D.pickle b/js/Sinks/CANIMXY3D.pickle index f5875b67..5f1b4c40 100644 --- a/js/Sinks/CANIMXY3D.pickle +++ b/js/Sinks/CANIMXY3D.pickle @@ -38,9 +38,9 @@ p2 sS'wpos' p3 g2 -sS'arg1' +sS'win' p4 -S'object' +S'double' p5 sS'wdim' p6 @@ -61,99 +61,96 @@ p11 g2 sS'graphics' p12 -g5 -sS'x.graphics' +S'object' p13 -g5 -sS'siz' +sS'x.graphics' p14 -g2 -sS'vec_z' +g13 +sS'siz' p15 g2 -sS'win' +sS'vec_z' p16 -S'double' +g2 +sS'arg1' p17 +g13 sS'model.evtin' p18 -g17 -sS'vec_x' -p19 -g2 +g5 sS'model.firing' -p20 +p19 S'vector' -p21 +p20 sS'model.sim' -p22 +p21 S'list' -p23 +p22 sS'mess' +p23 +g2 +sS'vec_x' p24 g2 -sS'[this.model,graphics,ok]' -p25 -g17 sS'vec_y' -p26 +p25 g2 sS'in1' -p27 +p26 S'string' -p28 +p27 sS'in2' -p29 -g17 +p28 +g5 sS'N' -p30 -g17 +p29 +g5 sS'size_siz' -p31 -g17 +p30 +g5 sS'model.rpar' -p32 +p31 g2 sS'graphics.exprs' -p33 +p32 NsS'model.ipar' -p34 +p33 g2 sS'typ' -p35 -g21 +p34 +g20 sS'ok' -p36 +p35 S'boolean' -p37 +p36 sS'model.blocktype' -p38 -g28 +p37 +g27 sS'param3ds' -p39 +p38 g2 sS'model.dep_ut' -p40 -g21 +p39 +g20 sS'exprs' -p41 +p40 g2 sS'gr_i' -p42 -g21 +p41 +g20 sS'ipar' -p43 +p42 g2 sS'y' -p44 -g21 +p43 +g20 sS'x' -p45 -g17 +p44 +g5 sS'model' +p45 +g13 +sS'nbr_curves' p46 g5 -sS'nbr_curves' -p47 -g17 s.
\ No newline at end of file diff --git a/js/Sinks/CEVENTSCOPE.js b/js/Sinks/CEVENTSCOPE.js index d58baea6..204e1ce0 100644 --- a/js/Sinks/CEVENTSCOPE.js +++ b/js/Sinks/CEVENTSCOPE.js @@ -14,8 +14,8 @@ function CEVENTSCOPE() { this.model.ipar = new ScilabDouble([this.win],[1],[this.clrs[this.nclock-1]],[this.wpos.slice()],[this.wdim.slice()]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = [[sci2exp(this.nclock)],[strcat(sci2exp(this.clrs[this.nclock-1])," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.per)]]; - gr_i = []; + var exprs = [[sci2exp(this.nclock)],[strcat(sci2exp(this.clrs[this.nclock-1])," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.per)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -41,8 +41,8 @@ function CEVENTSCOPE() { this.wdim = inverse(arguments[0]["wdim"]) this.per = parseFloat(arguments[0]["per"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.nclock,this.clrs,this.win,this.wpos,this.wdim,this.per,exprs] = scicos_getvalue("Set Scope parameters",["Number of event inputs","colors c (>0) or mark (<0)","Output window number (-1 for automatic)","Output window position","Output window sizes","Refresh period"],list("vec",1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",1),exprs); @@ -52,33 +52,36 @@ function CEVENTSCOPE() { if (!ok) { break; } - mess = []; + var mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (this.nclock<=0) { - mess = [[mess],["Block must have at least one input event"],[" "]]; - ok = false; + var mess = [[mess],["Block must have at least one input event"],[" "]]; + var ok = false; } if (size(this.clrs,"*")!=this.nclock) { - mess = [[mess],["Inputs color c size must be equal to Number of inputs"],[" "]]; - ok = false; + var mess = [[mess],["Inputs color c size must be equal to Number of inputs"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; + var ok = false; } if (this.per<=0) { - mess = [[mess],["Refresh period must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Refresh period must be positive"],[" "]]; + var ok = false; } if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list(),list(),ones(this.nclock,1),[]); + var tmpvar0 = set_io(this.model,graphics,list(),list(),ones(this.nclock,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } else { message([["Some specified values are inconsistent:"],[" "],[mess]]); } @@ -89,8 +92,8 @@ function CEVENTSCOPE() { if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } - rpar = this.per; - ipar = [[this.win],[1],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; + var rpar = this.per; + var ipar = [[this.win],[1],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; this.model.rpar = new ScilabDouble([rpar]); this.model.ipar = new ScilabDouble(ipar); graphics.exprs = exprs; diff --git a/js/Sinks/CEVENTSCOPE.pickle b/js/Sinks/CEVENTSCOPE.pickle index 972e83a8..cbf1eae9 100644 --- a/js/Sinks/CEVENTSCOPE.pickle +++ b/js/Sinks/CEVENTSCOPE.pickle @@ -61,52 +61,49 @@ p16 sS'mess' p17 g2 -sS'[this.model,graphics,ok]' -p18 -g12 sS'model.rpar' -p19 +p18 g12 sS'wdim' -p20 +p19 g2 sS'model.ipar' -p21 +p20 g2 sS'typ' -p22 +p21 S'vector' -p23 +p22 sS'nclock' -p24 +p23 g12 sS'ok' -p25 +p24 S'boolean' -p26 +p25 sS'model.blocktype' -p27 +p26 S'string' -p28 +p27 sS'model.dep_ut' -p29 -g23 +p28 +g22 sS'exprs' -p30 +p29 g2 sS'gr_i' -p31 -g23 +p30 +g22 sS'ipar' -p32 +p31 g2 sS'y' -p33 -g23 +p32 +g22 sS'x' -p34 +p33 g12 sS'model' -p35 +p34 g5 s.
\ No newline at end of file diff --git a/js/Sinks/CFSCOPE.js b/js/Sinks/CFSCOPE.js index 35cba386..c01a6804 100644 --- a/js/Sinks/CFSCOPE.js +++ b/js/Sinks/CFSCOPE.js @@ -16,8 +16,8 @@ function CFSCOPE() { this.model.ipar = new ScilabDouble([this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim],[1],[1]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[string([1])]]; - gr_i = []; + var exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[string([1])]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -49,42 +49,42 @@ function CFSCOPE() { this.N = parseFloat(arguments[0]["N"]) this.wu = arguments[0]["wu"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.wu,exprs] = scicos_getvalue("Set Scope parameters",["Color (>0) or mark (<0) vector (8 entries)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin","Ymax","Refresh period","Buffer size","Links to view"],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",-1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; + var ok = false; } if (this.per<=0) { - mess = [[mess],["Refresh period must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Refresh period must be positive"],[" "]]; + var ok = false; } if (this.N<2) { - mess = [[mess],["Buffer size must be at least 2"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 2"],[" "]]; + var ok = false; } if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (this.wu<0) { - mess = [[mess],["Link to view must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Link to view must be positive"],[" "]]; + var ok = false; } if (!ok) { message([["Some specified values are inconsistent:"],[" "],[mess]]); @@ -96,14 +96,14 @@ function CFSCOPE() { if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } - rpar = [[0],[this.ymin],[this.ymax],[this.per]]; + var rpar = [[0],[this.ymin],[this.ymax],[this.per]]; if (size(this.clrs,"*")>8) { this.clrs = this.clrs.slice(1-1,8); } if (size(this.clrs,"*")<8) { this.clrs[8-1] = 0; } - ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()],[size(this.wu,"*")],[this.wu.slice()]]; + var ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()],[size(this.wu,"*")],[this.wu.slice()]]; this.model.rpar = new ScilabDouble(rpar); this.model.ipar = new ScilabDouble(ipar); this.model.firing = []; diff --git a/js/Sinks/CLKOUTV_f.js b/js/Sinks/CLKOUTV_f.js index c55bed30..fc2b84f4 100644 --- a/js/Sinks/CLKOUTV_f.js +++ b/js/Sinks/CLKOUTV_f.js @@ -9,7 +9,7 @@ function CLKOUTV_f() { this.model.blocktype = new ScilabString(["d"]); this.model.firing = []; this.model.dep_ut = [false,false]; - exprs = string(this.prt); + var exprs = string(this.prt); this.x = standard_define([1,1],this.model,exprs," "); return new EventOutBlock(this.x); } @@ -24,9 +24,9 @@ function CLKOUTV_f() { CLKOUTV_f.prototype.set = function CLKOUTV_f() { this.prt = arguments[0]["prt"] this.x = arg1; - graphics = arg1.graphics; + var graphics = arg1.graphics; this.model = arg1.model; - exprs = graphics.exprs; + var exprs = graphics.exprs; while (true) { [ok,this.prt,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CLKOUTV_f")],[" "],["Event output port"]],"Port number",list("vec",1),exprs); if (!ok) { @@ -47,39 +47,41 @@ function CLKOUTV_f() { return new EventOutBlock(this.x); } CLKOUTV_f.prototype.getinputs = function CLKOUTV_f() { - orig = arg1.graphics.orig; - sz = arg1.graphics.sz; + var orig = arg1.graphics.orig; + var sz = arg1.graphics.sz; this.x = orig[1-1]+sz[1-1]/2; - y = orig[2-1]+sz[2-1]; - typ = -ones(this.x); + var y = orig[2-1]+sz[2-1]; + var typ = -ones(this.x); } CLKOUTV_f.prototype.getorigin = function CLKOUTV_f() { - [this.x,y] = this.standard_origin[arg1-1]; + var tmpvar0 = standard_origin(arg1) + this.x = tmpvar0[0] + var y = tmpvar0[1]; } CLKOUTV_f.prototype.getoutputs = function CLKOUTV_f() { this.x = []; - y = []; - typ = []; + var y = []; + var typ = []; } CLKOUTV_f.prototype.plot = function CLKOUTV_f() { - xf = 60; - yf = 40; - orig = arg1.graphics.orig; - sz = arg1.graphics.sz; - orient = arg1.graphics.flip; + var xf = 60; + var yf = 40; + var orig = arg1.graphics.orig; + var sz = arg1.graphics.sz; + var orient = arg1.graphics.flip; this.prt = arg1.model.ipar; - pat = xget("pattern"); + var pat = xget("pattern"); xset("pattern",this.default_color[-1-1]); - thick = xget("thickness"); + var thick = xget("thickness"); xset("thickness",2); this.x = orig[1-1]+sz[1-1]*[[1/2],[1],[1],[0],[0]]; - y = orig[2-1]+sz[2-1]*[[0],[1/3],[1],[1],[1/3]]; - xo = orig[1-1]; - yo = orig[2-1]+sz[2-1]/3; - gr_i = arg1.graphics.gr_i; + var y = orig[2-1]+sz[2-1]*[[0],[1/3],[1],[1],[1/3]]; + var xo = orig[1-1]; + var yo = orig[2-1]+sz[2-1]/3; + var gr_i = arg1.graphics.gr_i; if (this.type[gr_i-1]==15) { - coli = gr_i[2-1]; - pcoli = xget("pattern"); + var coli = gr_i[2-1]; + var pcoli = xget("pattern"); xfpolys(this.x,y,coli); xset("pattern",coli); xstringb(xo,yo,string(this.prt),sz[1-1],sz[2-1]/1.5); @@ -89,21 +91,21 @@ function CLKOUTV_f() { xstringb(xo,yo,string(this.prt),sz[1-1],sz[2-1]/1.5); xpoly(this.x,y,"lines",1); } - in1 = [-1/14,1/7,0,0,1/14,1/7,-1/14,1/7]*this.diag[[xf,yf]-1]; + var in1 = [-1/14,1/7,0,0,1/14,1/7,-1/14,1/7]*this.diag[[xf,yf]-1]; xfpoly(in1.slice()[1-1]+ones(4,1)*(orig[1-1]+sz[1-1]/2),in1.slice()[2-1]+ones(4,1)*(orig[2-1]+sz[2-1]),1); xset("thickness",thick); xset("pattern",pat); - ident = arg1.graphics.id; + var ident = arg1.graphics.id; if (ident!=[]&&ident!="") { - font = xget("font"); + var font = xget("font"); xset("font",this.options.ID[1-1][1-1],this.options.ID[1-1][2-1]); - rectangle = xstringl(orig[1-1],orig[2-1],ident); - w = rectangle[3-1]; - h = rectangle[4-1]; + var rectangle = xstringl(orig[1-1],orig[2-1],ident); + var w = rectangle[3-1]; + var h = rectangle[4-1]; xstringb(orig[1-1]+sz[1-1]/2-w/2,orig[2-1]-3*h/2,ident,w,h); xset("font",font[1-1],font[2-1]); } this.x = []; - y = []; + var y = []; } } diff --git a/js/Sinks/CLKOUTV_f.pickle b/js/Sinks/CLKOUTV_f.pickle index ff26649c..7cb2ea99 100644 --- a/js/Sinks/CLKOUTV_f.pickle +++ b/js/Sinks/CLKOUTV_f.pickle @@ -2,138 +2,133 @@ c__builtin__ set p0 ((lp1 -S'standard_origin' +S'diag' p2 -aS'diag' -p3 aS'default_color' -p4 +p3 aS'prt' -p5 +p4 aS'x' -p6 +p5 aS'model' -p7 +p6 aS'type' -p8 +p7 aS'options' -p9 -atp10 -Rp11 +p8 +atp9 +Rp10 .(dp0 -S'[this.x,y]' +S'xo' p1 S'double' p2 -sS'xo' -p3 -g2 sS'pcoli' -p4 +p3 g2 sS'arg1' -p5 +p4 S'object' -p6 +p5 sS'graphics.exprs' -p7 +p6 NsS'xf' -p8 +p7 g2 sS'prt' -p9 +p8 g2 sS'x.model' -p10 -g6 +p9 +g5 sS'coli' -p11 +p10 g2 sS'thick' -p12 +p11 g2 sS'font' -p13 +p12 g2 sS'orient' -p14 +p13 NsS'orig' -p15 +p14 NsS'pat' -p16 +p15 g2 sS'x.graphics' -p17 -g6 +p16 +g5 sS'model.evtin' -p18 +p17 g2 sS'rectangle' -p19 +p18 g2 sS'model.sim' -p20 +p19 S'string' -p21 +p20 sS'yo' -p22 +p21 g2 sS'arg1.graphics' -p23 -g6 +p22 +g5 sS'in1' -p24 -g21 +p23 +g20 sS'yf' -p25 +p24 g2 sS'graphics' -p26 -g6 +p25 +g5 sS'model.ipar' -p27 +p26 g2 sS'typ' -p28 +p27 S'vector' -p29 +p28 sS'sz' -p30 +p29 NsS'arg1.model' -p31 -g6 +p30 +g5 sS'ident' -p32 +p31 NsS'model.blocktype' -p33 -g21 +p32 +g20 sS'h' -p34 +p33 g2 sS'model.dep_ut' -p35 -g29 +p34 +g28 sS'exprs' -p36 -g21 +p35 +g20 sS'gr_i' -p37 +p36 NsS'model.firing' -p38 -g29 +p37 +g28 sS'w' -p39 +p38 g2 sS'y' -p40 -g29 +p39 +g28 sS'x' -p41 +p40 g2 sS'model' -p42 -g6 +p41 +g5 sS'options' -p43 -g6 +p42 +g5 s.
\ No newline at end of file diff --git a/js/Sinks/CLKOUT_f.js b/js/Sinks/CLKOUT_f.js index 3cd1bbd8..4698544d 100644 --- a/js/Sinks/CLKOUT_f.js +++ b/js/Sinks/CLKOUT_f.js @@ -9,7 +9,7 @@ function CLKOUT_f() { this.model.blocktype = new ScilabString(["d"]); this.model.firing = []; this.model.dep_ut = [false,false]; - exprs = string(this.prt); + var exprs = string(this.prt); this.x = standard_define([1,1],this.model,exprs," "); return new BasicBlock(this.x); } @@ -24,10 +24,10 @@ function CLKOUT_f() { CLKOUT_f.prototype.set = function CLKOUT_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; - graphics = arg1.graphics; + var graphics = arg1.graphics; this.model = arg1.model; - exprs = graphics.exprs; - exprs = exprs[1-1]; + var exprs = graphics.exprs; + var exprs = exprs[1-1]; while (true) { [ok,this.prt,exprs] = scicos_getvalue("Set Event Output block parameters","Port number",list("vec",1),exprs); if (!ok) { diff --git a/js/Sinks/CMAT3D.js b/js/Sinks/CMAT3D.js index b8675a0b..d42b45dc 100644 --- a/js/Sinks/CMAT3D.js +++ b/js/Sinks/CMAT3D.js @@ -3,12 +3,12 @@ function CMAT3D() { CMAT3D.prototype.define = function CMAT3D() { this.cmin = 0; this.cmax = 100; - this.colormap = this.jetcolormap[25-1]; - size_c = 25; + this.colormap = jetcolormap(25); + var size_c = 25; this.x = -1; - y = -1; - size_x = 1; - size_y = 1; + var y = -1; + var size_x = 1; + var size_y = 1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["cmat3d"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([-1]); @@ -19,8 +19,8 @@ function CMAT3D() { this.model.rpar = new ScilabDouble([this.colormap.slice()],[this.x],[y]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[strcat(string(this.x)," ")],[strcat(string(y)," ")],[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; - gr_i = []; + var exprs = [[strcat(string(this.x)," ")],[strcat(string(y)," ")],[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -44,31 +44,31 @@ function CMAT3D() { this.cmin = parseFloat(arguments[0]["cmin"]) this.cmax = parseFloat(arguments[0]["cmax"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.vec_x,this.vec_y,this.colormap,this.cmin,this.cmax,exprs] = scicos_getvalue("Set Scope parameters",["Bounds Vector X (-1 for standard)","Bounds Vector Y (-1 for standard)","ColorMap","Zmin","Zmax"],list("vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.vec_x,"*")!=size(this.vec_y,"*")) { - mess = [[mess],["Vector X and Vector Y must have the same size"],[" "]]; - ok = false; + var mess = [[mess],["Vector X and Vector Y must have the same size"],[" "]]; + var ok = false; } if (this.cmax<=this.cmin) { - mess = [[mess],["Error with minimum and maximum value"],[" "]]; - ok = false; + var mess = [[mess],["Error with minimum and maximum value"],[" "]]; + var ok = false; } if (!ok) { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - size_x = size(this.vec_x,"*"); - size_c = size(this.colormap.slice(),1); - ipar = [[this.cmin],[this.cmax],[size_c],[size_x]]; - rpar = [[this.colormap.slice()],[this.vec_x.slice()],[this.vec_y.slice()]]; + var size_x = size(this.vec_x,"*"); + var size_c = size(this.colormap.slice(),1); + var ipar = [[this.cmin],[this.cmax],[size_c],[size_x]]; + var rpar = [[this.colormap.slice()],[this.vec_x.slice()],[this.vec_y.slice()]]; this.model.ipar = new ScilabDouble(ipar); this.model.rpar = new ScilabDouble(rpar); graphics.exprs = exprs; diff --git a/js/Sinks/CMAT3D.pickle b/js/Sinks/CMAT3D.pickle index b02d0603..6035c95c 100644 --- a/js/Sinks/CMAT3D.pickle +++ b/js/Sinks/CMAT3D.pickle @@ -8,18 +8,16 @@ aS'vec_x' p3 aS'vec_y' p4 -aS'jetcolormap' -p5 aS'x' -p6 +p5 aS'model' -p7 +p6 aS'cmax' -p8 +p7 aS'colormap' -p9 -atp10 -Rp11 +p8 +atp9 +Rp10 .(dp0 S'cmin' p1 diff --git a/js/Sinks/CMATVIEW.js b/js/Sinks/CMATVIEW.js index d9c415f5..cc79f1f3 100644 --- a/js/Sinks/CMATVIEW.js +++ b/js/Sinks/CMATVIEW.js @@ -3,10 +3,10 @@ function CMATVIEW() { CMATVIEW.prototype.define = function CMATVIEW() { this.cmin = 0; this.cmax = 100; - size_c = 25; - this.colormap = this.jetcolormap[size_c-1]; - alpha_c = 0.24; - beta_c = 1; + var size_c = 25; + this.colormap = jetcolormap(size_c); + var alpha_c = 0.24; + var beta_c = 1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["cmatview"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([-1]); @@ -17,8 +17,8 @@ function CMATVIEW() { this.model.rpar = new ScilabDouble([alpha_c],[beta_c],[this.colormap.slice()]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; - gr_i = []; + var exprs = [[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -38,29 +38,29 @@ function CMATVIEW() { this.cmin = parseFloat(arguments[0]["cmin"]) this.cmax = parseFloat(arguments[0]["cmax"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.colormap,this.cmin,this.cmax,exprs] = scicos_getvalue("Set Scope parameters",["ColorMap","Minimum level range","Maximum level range"],list("vec",-1,"vec",1,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (this.cmax<=this.cmin) { - mess = [[mess],["Error with minimum and maximum value"],[" "]]; - ok = false; + var mess = [[mess],["Error with minimum and maximum value"],[" "]]; + var ok = false; } if (!ok) { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - size_c = size(this.colormap.slice(),1); - sol = inv([[this.cmin,1],[this.cmax,1]])*[[1],[size_c/3]]; - alpha_c = sol[1-1]; - beta_c = sol[2-1]; - ipar = [[this.cmin],[this.cmax],[size_c]]; - rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; + var size_c = size(this.colormap.slice(),1); + var sol = inv([[this.cmin,1],[this.cmax,1]])*[[1],[size_c/3]]; + var alpha_c = sol[1-1]; + var beta_c = sol[2-1]; + var ipar = [[this.cmin],[this.cmax],[size_c]]; + var rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; this.model.ipar = new ScilabDouble(ipar); this.model.rpar = new ScilabDouble(rpar); graphics.exprs = exprs; diff --git a/js/Sinks/CMATVIEW.pickle b/js/Sinks/CMATVIEW.pickle index 6509461d..f56928ee 100644 --- a/js/Sinks/CMATVIEW.pickle +++ b/js/Sinks/CMATVIEW.pickle @@ -2,20 +2,18 @@ c__builtin__ set p0 ((lp1 -S'colormap' +S'x' p2 -aS'jetcolormap' +aS'model' p3 -aS'x' +aS'cmax' p4 -aS'model' +aS'colormap' p5 -aS'cmax' -p6 aS'cmin' -p7 -atp8 -Rp9 +p6 +atp7 +Rp8 .(dp0 S'cmin' p1 diff --git a/js/Sinks/CMSCOPE.js b/js/Sinks/CMSCOPE.js index 66b294c3..5827d49a 100644 --- a/js/Sinks/CMSCOPE.js +++ b/js/Sinks/CMSCOPE.js @@ -10,8 +10,8 @@ function CMSCOPE() { this.ymin = [[-1],[-5]]; this.ymax = [[1],[5]]; this.per = [[30],[30]]; - yy = [[transpose(this.ymin.slice())],[transpose(this.ymax.slice())]]; - period = transpose(this.per.slice()); + var yy = [[transpose(this.ymin.slice())],[transpose(this.ymax.slice())]]; + var period = transpose(this.per.slice()); this.model = scicos_model(); this.model.sim = list(new ScilabString(["cmscope"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble(this.in1); @@ -22,8 +22,8 @@ function CMSCOPE() { this.model.ipar = new ScilabDouble([this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice(1-1,sum(this.in1))]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[strcat(string(this.in1)," ")],[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp([])],[strcat(string(this.ymin)," ")],[strcat(string(this.ymax)," ")],[strcat(string(this.per)," ")],[string(this.N)],[string(0)],[emptystr()]]; - gr_i = []; + var exprs = [[strcat(string(this.in1)," ")],[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp([])],[strcat(string(this.ymin)," ")],[strcat(string(this.ymax)," ")],[strcat(string(this.per)," ")],[string(this.N)],[string(0)],[emptystr()]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -59,69 +59,72 @@ function CMSCOPE() { this.heritance = arguments[0]["heritance"] this.nom = arguments[0]["nom"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.in1,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.heritance,this.nom,exprs] = scicos_getvalue("Set Scope parameters",["Input ports sizes","Drawing colors (>0) or mark (<0)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin vector","Ymax vector","Refresh period","Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"],list("vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec",1,"vec",1,"str",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.in1,"*")<=0) { - mess = [[mess],["Block must have at least one input port"],[" "]]; - ok = false; + var mess = [[mess],["Block must have at least one input port"],[" "]]; + var ok = false; } if (min(this.in1)<=0) { - mess = [[mess],["Port sizes must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Port sizes must be positive"],[" "]]; + var ok = false; } if (size(this.clrs,"*")<sum(this.in1)) { - mess = [[mess],["Not enough colors defined (at least "+string(sum(this.in1))+")"],[" "]]; - ok = false; + var mess = [[mess],["Not enough colors defined (at least "+string(sum(this.in1))+")"],[" "]]; + var ok = false; } if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number can\'t be < -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number can\'t be < -1"],[" "]]; + var ok = false; } if (size(this.per,"*")!=size(this.ymin,"*")) { - mess = [[mess],["Size of Refresh Period must equal size of Ymin/Ymax vector"],[" "]]; - ok = false; + var mess = [[mess],["Size of Refresh Period must equal size of Ymin/Ymax vector"],[" "]]; + var ok = false; } for (i=1;i<=size(this.per,"*");i+=1) { if ((this.per[i-1]<=0)) { - mess = [[mess],["Refresh Period must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Refresh Period must be positive"],[" "]]; + var ok = false; } } if (this.N<2) { - mess = [[mess],["Buffer size must be at least 2"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 2"],[" "]]; + var ok = false; } if (or(this.ymin>=this.ymax)) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (!or(this.heritance==[0,1])) { - mess = [[mess],["Accept herited events must be 0 or 1"],[" "]]; - ok = false; + var mess = [[mess],["Accept herited events must be 0 or 1"],[" "]]; + var ok = false; } if (!ok) { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { this.in1 = this.in1.slice(); - a = size(this.in1,1); - in2 = ones(a,1); - [this.model,graphics,ok] = set_io(this.model,graphics,list([this.in1,in2],ones(a,1)),list(),ones(1-this.heritance,1),[]); + var a = size(this.in1,1); + var in2 = ones(a,1); + var tmpvar0 = set_io(this.model,graphics,list([this.in1,in2],ones(a,1)),list(),ones(1-this.heritance,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { if (this.wpos==[]) { @@ -131,11 +134,11 @@ function CMSCOPE() { this.wdim = [[-1],[-1]]; } if (ok) { - period = transpose(this.per.slice()); - yy = [[transpose(this.ymin.slice())],[transpose(this.ymax.slice())]]; - rpar = [[0],[period.slice()],[yy.slice()]]; + var period = transpose(this.per.slice()); + var yy = [[transpose(this.ymin.slice())],[transpose(this.ymax.slice())]]; + var rpar = [[0],[period.slice()],[yy.slice()]]; this.clrs = this.clrs.slice(1-1,sum(this.in1)); - ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice()],[this.heritance]]; + var ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice()],[this.heritance]]; this.model.evtin = new ScilabDouble([ones(1-this.heritance,1)]); this.model.dstate = []; this.model.rpar = new ScilabDouble(rpar); diff --git a/js/Sinks/CMSCOPE.pickle b/js/Sinks/CMSCOPE.pickle index 9849db15..f4dc4e76 100644 --- a/js/Sinks/CMSCOPE.pickle +++ b/js/Sinks/CMSCOPE.pickle @@ -98,63 +98,60 @@ p26 sS'mess' p27 g2 -sS'[this.model,graphics,ok]' -p28 -g21 sS'in1' -p29 +p28 g2 sS'in2' -p30 +p29 g21 sS'N' -p31 +p30 g21 sS'yy' -p32 +p31 g2 sS'model.rpar' -p33 +p32 g2 sS'wdim' -p34 +p33 g2 sS'model.ipar' -p35 +p34 g2 sS'typ' -p36 +p35 g4 sS'a' -p37 +p36 g21 sS'ok' -p38 +p37 S'boolean' -p39 +p38 sS'model.blocktype' -p40 +p39 S'string' -p41 +p40 sS'model.dep_ut' -p42 +p41 g4 sS'exprs' -p43 +p42 g2 sS'gr_i' -p44 +p43 g4 sS'ipar' -p45 +p44 g2 sS'y' -p46 +p45 g4 sS'x' -p47 +p46 g21 sS'model' -p48 +p47 g7 s.
\ No newline at end of file diff --git a/js/Sinks/CSCOPE.js b/js/Sinks/CSCOPE.js index 9c19b26b..f5886c93 100644 --- a/js/Sinks/CSCOPE.js +++ b/js/Sinks/CSCOPE.js @@ -18,8 +18,8 @@ function CSCOPE() { this.model.ipar = new ScilabDouble([this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[transpose(string(0))],[emptystr()]]; - gr_i = []; + var exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[transpose(string(0))],[emptystr()]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -53,48 +53,51 @@ function CSCOPE() { this.heritance = arguments[0]["heritance"] this.nom = arguments[0]["nom"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.heritance,this.nom,exprs] = scicos_getvalue("Set Scope parameters",["Color (>0) or mark (<0) vector (8 entries)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin","Ymax","Refresh period","Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"str",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number can\'t be < -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number can\'t be < -1"],[" "]]; + var ok = false; } if (this.per<=0) { - mess = [[mess],["Refresh period must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Refresh period must be positive"],[" "]]; + var ok = false; } if (this.N<2) { - mess = [[mess],["Buffer size must be at least 2"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 2"],[" "]]; + var ok = false; } if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (!or(this.heritance==[0,1])) { - mess = [[mess],["Accept herited events must be 0 or 1"],[" "]]; - ok = false; + var mess = [[mess],["Accept herited events must be 0 or 1"],[" "]]; + var ok = false; } if (!ok) { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list([-1,1],1),list(),ones(1-this.heritance,1),[]); + var tmpvar0 = set_io(this.model,graphics,list([-1,1],1),list(),ones(1-this.heritance,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { if (this.wpos==[]) { @@ -103,8 +106,8 @@ function CSCOPE() { if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } - rpar = [[0],[this.ymin],[this.ymax],[this.per]]; - ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; + var rpar = [[0],[this.ymin],[this.ymax],[this.per]]; + var ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; this.model.rpar = new ScilabDouble(rpar); this.model.ipar = new ScilabDouble(ipar); this.model.evtin = new ScilabDouble([ones(1-this.heritance,1)]); diff --git a/js/Sinks/CSCOPE.pickle b/js/Sinks/CSCOPE.pickle index e7fe344b..f28b8737 100644 --- a/js/Sinks/CSCOPE.pickle +++ b/js/Sinks/CSCOPE.pickle @@ -36,9 +36,9 @@ p2 sS'wpos' p3 g2 -sS'arg1' +sS'win' p4 -S'object' +S'double' p5 sS'graphics.exprs' p6 @@ -49,29 +49,29 @@ sS'x.model' p8 NsS'ymin' p9 -S'double' -p10 +g5 sS'model.in2' -p11 -g10 +p10 +g5 sS'graphics' +p11 +S'object' p12 -g5 sS'ymax' p13 -g10 +g5 sS'x.graphics' p14 -g5 +g12 sS'per' p15 -g10 -sS'win' +g5 +sS'arg1' p16 -g10 +g12 sS'model.evtin' p17 -g10 +g5 sS'graphics.id' p18 NsS'model.label' @@ -83,55 +83,52 @@ p21 sS'mess' p22 g2 -sS'[this.model,graphics,ok]' -p23 -g10 sS'model.in1' -p24 -g10 +p23 +g5 sS'model.rpar' -p25 +p24 g2 sS'N' -p26 -g10 +p25 +g5 sS'wdim' -p27 +p26 g2 sS'model.ipar' -p28 +p27 g2 sS'typ' -p29 +p28 S'vector' -p30 +p29 sS'ok' -p31 +p30 S'boolean' -p32 +p31 sS'model.blocktype' -p33 +p32 S'string' -p34 +p33 sS'model.dep_ut' -p35 -g30 +p34 +g29 sS'exprs' -p36 +p35 g2 sS'gr_i' -p37 -g30 +p36 +g29 sS'ipar' -p38 +p37 g2 sS'y' -p39 -g30 +p38 +g29 sS'x' -p40 -g10 -sS'model' -p41 +p39 g5 +sS'model' +p40 +g12 s.
\ No newline at end of file diff --git a/js/Sinks/CSCOPXY.js b/js/Sinks/CSCOPXY.js index 458e7eef..3b6078d3 100644 --- a/js/Sinks/CSCOPXY.js +++ b/js/Sinks/CSCOPXY.js @@ -22,8 +22,8 @@ function CSCOPXY() { this.model.ipar = new ScilabDouble([this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = [[string(this.nbr_curves)],[sci2exp(this.clrs)],[sci2exp(this.siz)],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; - gr_i = []; + var exprs = [[string(this.nbr_curves)],[sci2exp(this.clrs)],[sci2exp(this.siz)],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -59,61 +59,64 @@ function CSCOPXY() { this.ymax = parseFloat(arguments[0]["ymax"]) this.N = parseFloat(arguments[0]["N"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.xmin,this.xmax,this.ymin,this.ymax,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of Curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin","Xmax","Ymin","Ymax","Buffer size"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (this.nbr_curves<=0) { - mess = [[mess],["Number of Curves cannot be negative or null"],[" "]]; - ok = false; + var mess = [[mess],["Number of Curves cannot be negative or null"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; + var ok = false; } if (this.N<1) { - mess = [[mess],["Buffer size must be at least 1"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 1"],[" "]]; + var ok = false; } if (this.N==1&&this.clrs>0) { - mess = [[mess],["Buffer size must be at least 2"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 2"],[" "]]; + var ok = false; } if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (this.xmin>=this.xmax) { - mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; + var ok = false; } if (!ok) { message(mess); } else { - in1 = this.nbr_curves*ones(2,1); - in2 = ones(2,1); - [this.model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); + var in1 = this.nbr_curves*ones(2,1); + var in2 = ones(2,1); + var tmpvar0 = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } - rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + var rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + var ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; this.model.rpar = new ScilabDouble(rpar); this.model.ipar = new ScilabDouble(ipar); graphics.exprs = exprs; diff --git a/js/Sinks/CSCOPXY.pickle b/js/Sinks/CSCOPXY.pickle index 462dabd2..1a1a92bd 100644 --- a/js/Sinks/CSCOPXY.pickle +++ b/js/Sinks/CSCOPXY.pickle @@ -94,60 +94,57 @@ g2 sS'mess' p24 g4 -sS'[this.model,graphics,ok]' -p25 -g2 sS'in1' -p26 +p25 S'string' -p27 +p26 sS'in2' -p28 +p27 g2 sS'N' -p29 +p28 g2 sS'model.rpar' -p30 +p29 g4 sS'graphics.exprs' -p31 +p30 NsS'model.ipar' -p32 +p31 g4 sS'typ' -p33 +p32 S'vector' -p34 +p33 sS'ok' -p35 +p34 S'boolean' -p36 +p35 sS'model.blocktype' -p37 -g27 +p36 +g26 sS'model.dep_ut' -p38 -g34 +p37 +g33 sS'exprs' -p39 +p38 g4 sS'gr_i' -p40 -g34 +p39 +g33 sS'ipar' -p41 +p40 g4 sS'y' -p42 -g34 +p41 +g33 sS'x' -p43 +p42 g2 sS'model' -p44 +p43 g15 sS'nbr_curves' -p45 +p44 g2 s.
\ No newline at end of file diff --git a/js/Sinks/CSCOPXY3D.js b/js/Sinks/CSCOPXY3D.js index 142cf4b2..80f313d2 100644 --- a/js/Sinks/CSCOPXY3D.js +++ b/js/Sinks/CSCOPXY3D.js @@ -22,8 +22,8 @@ function CSCOPXY3D() { this.model.ipar = new ScilabDouble([this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; - gr_i = []; + var exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -59,72 +59,75 @@ function CSCOPXY3D() { this.param3ds = inverse(arguments[0]["param3ds"]) this.N = parseFloat(arguments[0]["N"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.vec_x,this.vec_y,this.vec_z,this.param3ds,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of curves","color (>0) or mark (<0)","Line or Mark Size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin and Xmax","Ymin and Ymax","Zmin and Zmax","Alpha and Theta","Buffer size"],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",2,"vec",2,"vec",2,"vec",2,"vec",1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { - mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { - mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; - ok = false; + var mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; + var ok = false; } if (size(this.clrs,"*")!=size(this.siz,"*")) { - mess = [[mess],["Colors and Size must have same size"],[" "]]; - ok = false; + var mess = [[mess],["Colors and Size must have same size"],[" "]]; + var ok = false; } if (this.nbr_curves<=0) { - mess = [[mess],["Number of curves cannot be negative or null"],[" "]]; - ok = false; + var mess = [[mess],["Number of curves cannot be negative or null"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; + var ok = false; } if (this.N<1) { - mess = [[mess],["Buffer size must be at least 1"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 1"],[" "]]; + var ok = false; } if (this.N<2) { for (i=1;i<=size(this.clrs,"*");i+=1) { if (this.clrs[i-1]>0) { - mess = [[mess],["Buffer size must be at least 2 or Change a color (must be >0)"],[" "]]; - ok = false; + var mess = [[mess],["Buffer size must be at least 2 or Change a color (must be >0)"],[" "]]; + var ok = false; } } } if (this.vec_y[1-1]>=this.vec_y[2-1]) { - mess = [[mess],["Ymax must be higher than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be higher than Ymin"],[" "]]; + var ok = false; } if (this.vec_x[1-1]>=this.vec_x[2-1]) { - mess = [[mess],["Xmax must be higher than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be higher than Xmin"],[" "]]; + var ok = false; } if (this.vec_z[1-1]>=this.vec_z[2-1]) { - mess = [[mess],["Zmax must be higher than Zmin"],[" "]]; - ok = false; + var mess = [[mess],["Zmax must be higher than Zmin"],[" "]]; + var ok = false; } if (ok) { - in1 = this.nbr_curves*ones(3,1); - in2 = ones(3,1); - [this.model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); + var in1 = this.nbr_curves*ones(3,1); + var in2 = ones(3,1); + var tmpvar0 = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } - rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; - size_siz = size(this.siz,"*"); - ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + var rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; + var size_siz = size(this.siz,"*"); + var ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; this.model.rpar = new ScilabDouble(rpar); this.model.ipar = new ScilabDouble(ipar); graphics.exprs = exprs; diff --git a/js/Sinks/CSCOPXY3D.pickle b/js/Sinks/CSCOPXY3D.pickle index e0b15b28..6ac1a115 100644 --- a/js/Sinks/CSCOPXY3D.pickle +++ b/js/Sinks/CSCOPXY3D.pickle @@ -38,9 +38,9 @@ p2 sS'wpos' p3 g2 -sS'arg1' +sS'win' p4 -S'object' +S'double' p5 sS'wdim' p6 @@ -61,96 +61,93 @@ p11 g2 sS'graphics' p12 -g5 -sS'x.graphics' +S'object' p13 -g5 -sS'siz' +sS'x.graphics' p14 -g2 -sS'vec_z' +g13 +sS'siz' p15 g2 -sS'win' +sS'vec_z' p16 -S'double' +g2 +sS'arg1' p17 +g13 sS'model.evtin' p18 -g17 -sS'vec_x' -p19 -g2 +g5 sS'model.sim' -p20 +p19 S'list' -p21 +p20 sS'mess' +p21 +g2 +sS'vec_x' p22 g2 -sS'[this.model,graphics,ok]' -p23 -g17 sS'vec_y' -p24 +p23 g2 sS'in1' -p25 +p24 S'string' -p26 +p25 sS'in2' -p27 -g17 +p26 +g5 sS'N' -p28 -g17 +p27 +g5 sS'size_siz' -p29 -g17 +p28 +g5 sS'model.rpar' -p30 +p29 g2 sS'graphics.exprs' -p31 +p30 NsS'model.ipar' -p32 +p31 g2 sS'typ' -p33 +p32 S'vector' -p34 +p33 sS'ok' -p35 +p34 S'boolean' -p36 +p35 sS'model.blocktype' -p37 -g26 +p36 +g25 sS'param3ds' -p38 +p37 g2 sS'model.dep_ut' -p39 -g34 +p38 +g33 sS'exprs' -p40 +p39 g2 sS'gr_i' -p41 -g34 +p40 +g33 sS'ipar' -p42 +p41 g2 sS'y' -p43 -g34 +p42 +g33 sS'x' -p44 -g17 +p43 +g5 sS'model' +p44 +g13 +sS'nbr_curves' p45 g5 -sS'nbr_curves' -p46 -g17 s.
\ No newline at end of file diff --git a/js/Sinks/OUTIMPL_f.js b/js/Sinks/OUTIMPL_f.js index 68bb28fa..f7688fea 100644 --- a/js/Sinks/OUTIMPL_f.js +++ b/js/Sinks/OUTIMPL_f.js @@ -9,12 +9,12 @@ function OUTIMPL_f() { this.model.ipar = [1]; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,false]; - mo = modelica(); + var mo = modelica(); mo.model = "PORT"; mo.inputs = "n"; this.model.equations = new ScilabDouble([mo]); - exprs = "1"; - gr_i = []; + var exprs = "1"; + var gr_i = []; this.x = standard_define([1,1],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; return new ImplicitOutBlock(this.x); @@ -30,11 +30,11 @@ function OUTIMPL_f() { OUTIMPL_f.prototype.set = function OUTIMPL_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,"*")==2) { - exprs = exprs[1-1]; + var exprs = exprs[1-1]; } while (true) { [ok,this.prt,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","OUTIMPL_f")],[" "],["Implicit output port"]],"Port number",list("vec",1),exprs); @@ -46,8 +46,8 @@ function OUTIMPL_f() { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { if (this.model.ipar!=this.prt) { - needcompile = 4; - y = needcompile; + var needcompile = 4; + var y = needcompile; } this.model.ipar = new ScilabDouble([this.prt]); graphics.exprs = exprs; diff --git a/js/Sinks/OUT_f.js b/js/Sinks/OUT_f.js index eff38eaa..ee146a61 100644 --- a/js/Sinks/OUT_f.js +++ b/js/Sinks/OUT_f.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Sinks/OUT_f.sci" */ function OUT_f() { OUT_f.prototype.define = function OUT_f() { - n = -1; + var n = -1; this.prt = 1; this.model = scicos_model(); this.model.sim = new ScilabString(["output"]); @@ -11,8 +11,8 @@ function OUT_f() { this.model.ipar = new ScilabDouble([this.prt]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,false]; - exprs = string(this.prt); - gr_i = []; + var exprs = string(this.prt); + var gr_i = []; this.x = standard_define([1,1],this.model,exprs,gr_i); return new ExplicitOutBlock(this.x); } @@ -27,11 +27,11 @@ function OUT_f() { OUT_f.prototype.set = function OUT_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; - graphics = arg1.graphics; + var graphics = arg1.graphics; this.model = arg1.model; - exprs = graphics.exprs; + var exprs = graphics.exprs; if (size(exprs,"*")==2) { - exprs = exprs[1-1]; + var exprs = exprs[1-1]; } while (true) { [ok,this.prt,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","OUT_f")],[" "],["Regular output port"]],"Port number",list("vec",1),exprs); diff --git a/js/Sinks/TOWS_c.js b/js/Sinks/TOWS_c.js index c2f0d93d..f7aa7b54 100644 --- a/js/Sinks/TOWS_c.js +++ b/js/Sinks/TOWS_c.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Sinks/TOWS_c.sci" */ function TOWS_c() { TOWS_c.prototype.define = function TOWS_c() { - nu = -1; + var nu = -1; this.nz = 128; this.varnam = "A"; this.herit = 0; @@ -18,8 +18,8 @@ function TOWS_c() { this.model.blocktype = new ScilabString(["d"]); this.model.firing = []; this.model.dep_ut = [false,false]; - gr_i = []; - exprs = [[string(this.nz)],[string(this.varnam)],[string(this.herit)]]; + var gr_i = []; + var exprs = [[string(this.nz)],[string(this.varnam)],[string(this.herit)]]; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -39,9 +39,9 @@ function TOWS_c() { this.varnam = arguments[0]["varnam"] this.herit = parseFloat(arguments[0]["herit"]) this.x = arg1; - graphics = arg1.graphics; + var graphics = arg1.graphics; this.model = arg1.model; - exprs = graphics.exprs; + var exprs = graphics.exprs; while (true) { [ok,this.nz,this.varnam,this.herit,exprs] = scicos_getvalue("Set Xcos buffer block",["Size of buffer","Scilab variable name","Inherit (no:0, yes:1)"],list("vec",1,"str",1,"vec",1),exprs); if (!ok) { @@ -49,17 +49,20 @@ function TOWS_c() { } if ((this.nz<=0)) { message("Size of buffer must be positive"); - ok = false; + var ok = false; } - r = false; - ierr = execstr("r = validvar(varnam)","errcatch"); + var r = false; + var ierr = execstr("r = validvar(varnam)","errcatch"); if (!r||ierr!=0||length(this.varnam)>19) { message([["Invalid variable name."],["Please choose another variable name."]]); - ok = false; + var ok = false; } execstr("if type("+this.varnam+") <> 17 | or(fieldnames("+this.varnam+") <> [\"values\"; \"time\"]) then"+" message([\"Protected variable name.\"; \"Please choose another variable name.\"]);"+" ok = %f;"+" end","errcatch"); if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],-1),list(),ones(1-this.herit,1),[]); + var tmpvar0 = set_io(this.model,graphics,list([-1,-2],-1),list(),ones(1-this.herit,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (this.herit==1) { this.model.blocktype = new ScilabString(["x"]); } else { diff --git a/js/Sinks/TOWS_c.pickle b/js/Sinks/TOWS_c.pickle index 7f443569..4a87ca85 100644 --- a/js/Sinks/TOWS_c.pickle +++ b/js/Sinks/TOWS_c.pickle @@ -72,47 +72,44 @@ p21 sS'model.evtout' p22 g8 -sS'[this.model,graphics,ok]' -p23 -g5 sS'model.intyp' -p24 +p23 g5 sS'model.rpar' -p25 +p24 g8 sS'graphics.exprs' -p26 +p25 NsS'model.ipar' -p27 +p26 S'matrix' -p28 +p27 sS'typ' -p29 +p28 g8 sS'ok' -p30 +p29 S'boolean' -p31 +p30 sS'model.blocktype' -p32 +p31 g10 sS'model.dep_ut' -p33 +p32 g8 sS'exprs' -p34 -g28 +p33 +g27 sS'r' -p35 -g31 +p34 +g30 sS'y' -p36 +p35 g8 sS'x' -p37 +p36 g5 sS'model' -p38 +p37 g2 s.
\ No newline at end of file diff --git a/js/Sinks/TRASH_f.js b/js/Sinks/TRASH_f.js index 4c9eca2b..e36cee9d 100644 --- a/js/Sinks/TRASH_f.js +++ b/js/Sinks/TRASH_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Sinks/TRASH_f.sci" */ function TRASH_f() { TRASH_f.prototype.define = function TRASH_f() { - in1 = -1; + var in1 = -1; this.model = scicos_model(); this.model.sim = new ScilabString(["trash"]); this.model.in1 = new ScilabDouble([in1]); this.model.evtin = new ScilabDouble([1]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = " "; - gr_i = []; + var exprs = " "; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } diff --git a/js/Sinks/WFILE_f.js b/js/Sinks/WFILE_f.js index e8d9f730..b6a2a5ec 100644 --- a/js/Sinks/WFILE_f.js +++ b/js/Sinks/WFILE_f.js @@ -2,10 +2,10 @@ function WFILE_f() { WFILE_f.prototype.define = function WFILE_f() { this.in1 = 1; - nin = sum(this.in1); - frmt = "(7(e10.3,1x))"; - fname = "foo"; - lunit = 0; + var nin = sum(this.in1); + var frmt = "(7(e10.3,1x))"; + var fname = "foo"; + var lunit = 0; this.N = 2; this.model = scicos_model(); this.model.sim = new ScilabString(["writef"]); @@ -15,8 +15,8 @@ function WFILE_f() { this.model.ipar = new ScilabDouble([length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N)]]; - gr_i = []; + var exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N)]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -38,56 +38,59 @@ function WFILE_f() { this.frmt1 = parseFloat(arguments[0]["frmt1"]) this.N = parseFloat(arguments[0]["N"]) warnobsolete("WRITEC_f","6.0.0"); - warnMessage = msprintf(_("Feature %s is obsolete."),"WFILE_f"); - warnAdvise = msprintf(_("Please use %s instead."),"WRITEC_f"); - warnXcosMessage = msprintf("%s %s",warnMessage,warnAdvise); + var warnMessage = msprintf(_("Feature %s is obsolete."),"WFILE_f"); + var warnAdvise = msprintf(_("Please use %s instead."),"WRITEC_f"); + var warnXcosMessage = msprintf("%s %s",warnMessage,warnAdvise); warnBlockByUID(arg1.model.label,warnXcosMessage); this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - dstate = this.model.dstate; - lunit = dstate[2-1]; - fname = exprs[2-1]; - frmt = exprs[3-1]; + var dstate = this.model.dstate; + var lunit = dstate[2-1]; + var fname = exprs[2-1]; + var frmt = exprs[3-1]; while (true) { [ok,this.in1,this.fname1,this.frmt1,this.N,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","WFILE_f")],[" "],["Write to output file"],[" "],["Write is done on:"],[" - A binary file if no format given"],[" - A formatted text file if a format (Fortran type) is given"]],["Input Size","Output File Name","Output Format","Buffer Size"],list("vec",1,"str",1,"str",1,"vec",1),exprs); if (!ok) { break; } this.in1 = int(this.in1); - nin = this.in1; + var nin = this.in1; this.fname1 = pathconvert(stripblanks(this.fname1),false,true); this.frmt1 = stripblanks(this.frmt1); if (lunit>0&&min(length(frmt),1)!=min(length(this.frmt1),1)) { block_parameter_error("Simulation running !!! You cannot switch<br />between formatted and unformatted when running","End current simulation first."); - ok = false; + var ok = false; } else if (lunit>0&&this.fname1!=fname) { block_parameter_error("You cannot modify \'Output File Name\' when running.","End current simulation first."); - ok = false; + var ok = false; } else if (this.fname1=="") { block_parameter_error("Wrong value for \'Output File Name\' parameter","You must provide a filename."); - ok = false; + var ok = false; } else if (fileparts(this.fname1)!="") { - [pa,fn,ex] = fileparts(this.fname1); + var tmpvar0 = fileparts(this.fname1) + var pa = tmpvar0[0] + var fn = tmpvar0[1] + var ex = tmpvar0[2]; if (!this.isdir[pa-1]) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Output File Name"),msprintf("Directory \'%s\' does not exist",pa)); - ok = false; + var ok = false; } } else if (this.frmt1!=""&&(part(this.frmt1,1)!="("||part(this.frmt1,length(this.frmt1))!=")")) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Input Format",this.frmt1),"You must enclose the format\'s string between parentheses."); - ok = false; + var ok = false; } else if (this.N<2) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Buffer Size",this.N),"Must be greater than 1."); - ok = false; + var ok = false; } else if (this.in1<=0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Input Size",this.in1),"Strictly positive integer expected."); - ok = false; + var ok = false; } if (ok) { - ipar = [[length(this.fname1)],[length(this.frmt1)],[0],[this.N],[this._str2code[this.fname1-1]],[this._str2code[this.frmt1-1]]]; + var ipar = [[length(this.fname1)],[length(this.frmt1)],[0],[this.N],[this._str2code[this.fname1-1]],[this._str2code[this.frmt1-1]]]; if (prod(size(dstate))!=(nin+1)*this.N+2) { - dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + var dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } this.model.in1 = new ScilabDouble([nin]); this.model.dstate = new ScilabDouble(dstate); diff --git a/js/Sinks/WFILE_f.pickle b/js/Sinks/WFILE_f.pickle index e42167dc..895c2b46 100644 --- a/js/Sinks/WFILE_f.pickle +++ b/js/Sinks/WFILE_f.pickle @@ -41,91 +41,88 @@ sS'model.dep_ut' p8 S'vector' p9 -sS'[pa,fn,ex]' +sS'warnMessage' p10 S'double' p11 -sS'warnMessage' -p12 -g11 sS'x.graphics' -p13 +p12 g4 sS'lunit' -p14 +p13 g11 sS'fname' -p15 +p14 S'string' -p16 +p15 sS'frmt' -p17 -g16 +p16 +g15 sS'model.evtin' -p18 +p17 g11 sS'model.sim' -p19 -g16 +p18 +g15 sS'nin' +p19 +g11 +sS'model.in1' p20 g11 sS'in1' p21 g11 -sS'model.in1' -p22 -g11 sS'warnAdvise' -p23 +p22 g11 sS'warnXcosMessage' -p24 +p23 g11 sS'graphics' -p25 +p24 g4 sS'model.ipar' -p26 +p25 g2 sS'typ' -p27 +p26 g9 sS'arg1.model' -p28 +p27 g4 sS'ok' -p29 +p28 S'boolean' -p30 +p29 sS'model.blocktype' -p31 -g16 +p30 +g15 sS'frmt1' -p32 +p31 g11 sS'fname1' -p33 +p32 g11 sS'exprs' -p34 +p33 g2 sS'N' -p35 +p34 g11 sS'gr_i' -p36 +p35 g9 sS'ipar' -p37 +p36 g2 sS'y' -p38 +p37 g9 sS'x' -p39 +p38 g11 sS'model' -p40 +p39 g4 s.
\ No newline at end of file diff --git a/js/Sinks/WRITEAU_f.js b/js/Sinks/WRITEAU_f.js index 917f3dca..29f756ba 100644 --- a/js/Sinks/WRITEAU_f.js +++ b/js/Sinks/WRITEAU_f.js @@ -1,12 +1,12 @@ /* autogenerated from "macros/Sinks/WRITEAU_f.sci" */ function WRITEAU_f() { WRITEAU_f.prototype.define = function WRITEAU_f() { - in1 = 1; - nin = sum(in1); - frmt = "uc "; - fname = "/dev/audio"; + var in1 = 1; + var nin = sum(in1); + var frmt = "uc "; + var fname = "/dev/audio"; this.swap = 0; - lunit = 0; + var lunit = 0; this.N = 2; this.model = scicos_model(); this.model.sim = list(new ScilabString(["writeau"]), new ScilabDouble([2])); @@ -16,8 +16,8 @@ function WRITEAU_f() { this.model.ipar = new ScilabDouble([length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [true,false]; - exprs = [string(this.N),string(this.swap)]; - gr_i = []; + var exprs = [string(this.N),string(this.swap)]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -35,35 +35,35 @@ function WRITEAU_f() { this.N = parseFloat(arguments[0]["N"]) this.swap = parseFloat(arguments[0]["swap"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - ipar = this.model.ipar; - dstate = this.model.dstate; - lunit = dstate[2-1]; + var ipar = this.model.ipar; + var dstate = this.model.dstate; + var lunit = dstate[2-1]; while (true) { [ok,this.N,this.swap,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","WRITEAU_f")],[" "],["Write \'.au\' sound file on audio device"]],["Buffer Size","Swap Mode (0:No, 1:Yes)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - nin = 1; - fname1 = "/dev/audio"; - frmt1 = "uc "; + var nin = 1; + var fname1 = "/dev/audio"; + var frmt1 = "uc "; if (this.alreadyran&&(this.N!=ipar[5-1])) { block_parameter_error(msprintf("You cannot modify \'%s\' when running.","Buffer Size"),"End current simulation first"); - ok = false; + var ok = false; } else if (this.N<1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Buffer Size",this.N),"Strictly positive integer expected."); - ok = false; + var ok = false; } if (this.swap!=0&&this.swap!=1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Swap Mode",this.swap),msprintf("Must be in the interval %s.","[0, 1]")); - ok = false; + var ok = false; } if (ok) { - ipar = [[length(fname1)],[this._str2code[frmt1-1]],[this.N],[this.swap],[this._str2code[fname1-1]]]; + var ipar = [[length(fname1)],[this._str2code[frmt1-1]],[this.N],[this.swap],[this._str2code[fname1-1]]]; if (prod(size(dstate))!=(nin+1)*this.N+2) { - dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + var dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } this.model.in1 = new ScilabDouble([1]); this.model.dstate = new ScilabDouble(dstate); diff --git a/js/Sinks/WRITEC_f.js b/js/Sinks/WRITEC_f.js index 7b1967e9..34ec1758 100644 --- a/js/Sinks/WRITEC_f.js +++ b/js/Sinks/WRITEC_f.js @@ -2,11 +2,11 @@ function WRITEC_f() { WRITEC_f.prototype.define = function WRITEC_f() { this.in1 = 1; - nin = sum(this.in1); - frmt = "c "; - fname = "foo"; + var nin = sum(this.in1); + var frmt = "c "; + var fname = "foo"; this.swap = 0; - lunit = 0; + var lunit = 0; this.N = 2; this.model = scicos_model(); this.model.sim = list(new ScilabString(["writec"]), new ScilabDouble([2])); @@ -16,8 +16,8 @@ function WRITEC_f() { this.model.ipar = new ScilabDouble([length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N),string(this.swap)]]; - gr_i = []; + var exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N),string(this.swap)]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -41,56 +41,59 @@ function WRITEC_f() { this.N = parseFloat(arguments[0]["N"]) this.swap = parseFloat(arguments[0]["swap"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - ipar = this.model.ipar; - dstate = this.model.dstate; - lunit = dstate[2-1]; - fname = exprs[2-1]; - frmt = exprs[3-1]; + var ipar = this.model.ipar; + var dstate = this.model.dstate; + var lunit = dstate[2-1]; + var fname = exprs[2-1]; + var frmt = exprs[3-1]; while (true) { [ok,this.in1,this.fname1,this.frmt1,this.N,this.swap,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","WRITEC_f")],[" "],["Write to C binary file"]],["Input Size","Output File Name","Output Format","Buffer Size","Swap Mode (0:No, 1:Yes)"],list("vec",1,"str",1,"str",1,"vec",1,"vec",1),exprs); if (!ok) { break; } this.in1 = int(this.in1); - nin = this.in1; + var nin = this.in1; 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"]; + var fmts = ["s","l","d","f","c","us","ul","uc","ull","uls","ubl","ubs","dl","fl","ll","sl","db","fb","lb","sb"]; if (and(this.frmt1!=fmts)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Input Format",this.frmt1),"Valid formats are: "+strcat(fmts,", ")); - ok = false; + var ok = false; } else if (this.alreadyran&&this.fname1!=fname) { block_parameter_error(msprintf("You cannot modify \'%s\' when running","Input Format"),"End current simulation first."); - ok = false; + var ok = false; } else if (this.alreadyran&&this.N!=ipar[5-1]) { block_parameter_error(msprintf("You cannot modify \'Buffer Size\' when running.","Buffer Size"),"End current simulation first"); - ok = false; + var ok = false; } else if (this.fname1=="") { block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Output File Name"),"You must provide a filename."); } else if (fileparts(this.fname1)!="") { - [pa,fn,ex] = fileparts(this.fname1); + var tmpvar0 = fileparts(this.fname1) + var pa = tmpvar0[0] + var fn = tmpvar0[1] + var ex = tmpvar0[2]; if (!this.isdir[pa-1]) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Output File Name"),msprintf("Directory \'%s\' does not exist",pa)); - ok = false; + var ok = false; } } else if (this.N<1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Buffer Size",this.N),"Strictly positive integer expected."); - ok = false; + var ok = false; } else if (this.in1<=0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Input Size",this.in1),"Strictly positive integer expected."); - ok = false; + var ok = false; } else if (this.swap!=0&&this.swap!=1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Swap Mode",this.swap),msprintf("Must be in the interval %s.","[0, 1]")); - ok = false; + var ok = false; } this.frmt1 = part(this.frmt1,1,3); if (ok) { - ipar = [[length(this.fname1)],[this._str2code[this.frmt1-1]],[this.N],[this.swap],[this._str2code[this.fname1-1]]]; + var ipar = [[length(this.fname1)],[this._str2code[this.frmt1-1]],[this.N],[this.swap],[this._str2code[this.fname1-1]]]; if (prod(size(dstate))!=(nin+1)*this.N+2) { - dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + var dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } this.model.in1 = new ScilabDouble([nin]); this.model.dstate = new ScilabDouble(dstate); diff --git a/js/Sinks/WRITEC_f.pickle b/js/Sinks/WRITEC_f.pickle index f630f0aa..1b564164 100644 --- a/js/Sinks/WRITEC_f.pickle +++ b/js/Sinks/WRITEC_f.pickle @@ -33,9 +33,10 @@ sS'arg1' p3 S'object' p4 -sS'graphics.exprs' +sS'graphics' p5 -NsS'dstate' +g4 +sS'dstate' p6 g2 sS'x.model' @@ -45,86 +46,82 @@ sS'model.dep_ut' p8 S'vector' p9 -sS'[pa,fn,ex]' +sS'model.in1' p10 S'double' p11 -sS'model.in1' -p12 -g11 sS'x.graphics' -p13 +p12 g4 sS'lunit' -p14 +p13 g11 sS'swap' -p15 +p14 g11 sS'fname' -p16 +p15 S'string' -p17 +p16 sS'frmt' -p18 -g17 +p17 +g16 sS'model.evtin' -p19 +p18 g11 sS'model.sim' -p20 +p19 S'list' -p21 +p20 sS'nin' -p22 +p21 g11 sS'fmts' -p23 +p22 g9 sS'in1' -p24 +p23 g11 sS'N' -p25 +p24 g11 -sS'graphics' +sS'graphics.exprs' +p25 +NsS'model.ipar' p26 -g4 -sS'model.ipar' -p27 g2 sS'typ' -p28 +p27 g9 sS'ok' -p29 +p28 S'boolean' -p30 +p29 sS'model.blocktype' -p31 -g17 +p30 +g16 sS'frmt1' -p32 -g17 +p31 +g16 sS'fname1' -p33 +p32 g11 sS'exprs' -p34 +p33 g2 sS'gr_i' -p35 +p34 g9 sS'ipar' -p36 +p35 g2 sS'y' -p37 +p36 g9 sS'x' -p38 +p37 g11 sS'model' -p39 +p38 g4 s.
\ No newline at end of file |