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/Linear | |
parent | 0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff) | |
download | sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2 sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip |
fix assignment to list
Diffstat (limited to 'js/Linear')
61 files changed, 1259 insertions, 1268 deletions
diff --git a/js/Linear/BIGSOM_f.js b/js/Linear/BIGSOM_f.js index da6a2b13..95fe10ed 100644 --- a/js/Linear/BIGSOM_f.js +++ b/js/Linear/BIGSOM_f.js @@ -9,8 +9,8 @@ function BIGSOM_f() { this.model.rpar = new ScilabDouble(this.sgn); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = sci2exp(this.sgn); - gr_i = []; + var exprs = sci2exp(this.sgn); + var gr_i = []; this.x = standard_define([2,3],this.model,exprs,gr_i); return new BigSom(this.x); } @@ -25,16 +25,19 @@ function BIGSOM_f() { BIGSOM_f.prototype.set = function BIGSOM_f() { this.sgn = inverse(arguments[0]["sgn"]) 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.sgn,exprs] = scicos_getvalue("Set sum block parameters","Inputs ports signs/gain",list("vec",-1),exprs); if (!ok) { break; } - in1 = -ones(size(this.sgn,"*"),1); - [this.model,graphics,ok] = check_io(this.model,graphics,in1,-1,[],[]); + var in1 = -ones(size(this.sgn,"*"),1); + var tmpvar0 = check_io(this.model,graphics,in1,-1,[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (ok) { this.model.rpar = this.sgn.slice(); graphics.exprs = exprs; diff --git a/js/Linear/BIGSOM_f.pickle b/js/Linear/BIGSOM_f.pickle index d2fb8c99..a4b3bc4b 100644 --- a/js/Linear/BIGSOM_f.pickle +++ b/js/Linear/BIGSOM_f.pickle @@ -33,46 +33,43 @@ p9 sS'arg1' p10 g9 -sS'[this.model,graphics,ok]' -p11 -g4 sS'graphics.exprs' -p12 +p11 NsS'in1' -p13 +p12 S'double' -p14 +p13 sS'model.rpar' -p15 +p14 g2 sS'exprs' -p16 +p15 g7 sS'x.model' -p17 +p16 NsS'gr_i' -p18 +p17 S'vector' -p19 +p18 sS'model.dep_ut' -p20 -g19 +p19 +g18 sS'graphics' -p21 +p20 g9 sS'y' -p22 -g19 +p21 +g18 sS'x' -p23 -g14 +p22 +g13 sS'model' -p24 +p23 g9 sS'typ' -p25 -g19 +p24 +g18 sS'model.out' -p26 -g14 +p25 +g13 s.
\ No newline at end of file diff --git a/js/Linear/CLINDUMMY_f.js b/js/Linear/CLINDUMMY_f.js index db4f00c3..047efa5f 100644 --- a/js/Linear/CLINDUMMY_f.js +++ b/js/Linear/CLINDUMMY_f.js @@ -1,14 +1,14 @@ /* autogenerated from "macros/Linear/CLINDUMMY_f.sci" */ function CLINDUMMY_f() { CLINDUMMY_f.prototype.define = function CLINDUMMY_f() { - x0 = 0; + var x0 = 0; this.model = scicos_model(); this.model.sim = list(new ScilabString(["cdummy"]), new ScilabDouble([4])); this.model.state = new ScilabDouble([x0]); this.model.blocktype = new ScilabString(["c"]); this.model.firing = []; this.model.dep_ut = [false,true]; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } diff --git a/js/Linear/CLR.js b/js/Linear/CLR.js index 64751b07..b4abd599 100644 --- a/js/Linear/CLR.js +++ b/js/Linear/CLR.js @@ -1,12 +1,12 @@ /* autogenerated from "macros/Linear/CLR.sci" */ function CLR() { CLR.prototype.define = function CLR() { - x0 = 0; - A = -1; - B = 1; - C = 1; - D = 0; - exprs = [["1"],["1+s"]]; + var x0 = 0; + var A = -1; + var B = 1; + var C = 1; + var D = 0; + var exprs = [["1"],["1+s"]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["csslti4"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([1]); @@ -15,7 +15,7 @@ function CLR() { this.model.rpar = new ScilabDouble([A.slice()],[B.slice()],[C.slice()],[D.slice()]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -33,15 +33,15 @@ function CLR() { this.num = arguments[0]["num"] this.den = arguments[0]["den"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - x0 = this.model.state; - rpar = this.model.rpar; - ns = prod(size(x0)); - nin = 1; - nout = 1; - PREVAR_scicos_context = PREVAR_scicos_context; + var x0 = this.model.state; + var rpar = this.model.rpar; + var ns = prod(size(x0)); + var nin = 1; + var nout = 1; + var PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.s = %s; while (true) { [ok,this.num,this.den,exprs] = scicos_getvalue("Set continuous SISO transfer parameters",["Numerator (s)","Denominator (s)"],list("pol",1,"pol",1),exprs); @@ -50,24 +50,30 @@ function CLR() { } if (degree(this.num)>degree(this.den)) { message("Transfer function must be proper or strictly proper."); - ok = false; + var ok = false; } if (ok) { - H = cont_frm(this.num,this.den); - [A,B,C,D] = H.slice(2-1,5); + var H = cont_frm(this.num,this.den); + var tmpvar0 = H.slice(2-1,5) + var A = tmpvar0[0] + var B = tmpvar0[1] + var C = tmpvar0[2] + var D = tmpvar0[3]; graphics.exprs = exprs; - [ns1,ns1] = size(A); - rpar = [[matrix(A,ns1*ns1,1)],[matrix(B,ns1,1)],[matrix(C,ns1,1)],[D]]; + var tmpvar1 = size(A) + var ns1 = tmpvar1[0] + var ns1 = tmpvar1[1]; + var rpar = [[matrix(A,ns1*ns1,1)],[matrix(B,ns1,1)],[matrix(C,ns1,1)],[D]]; if (norm(D,1)!=0) { - mmm = [true,true]; + var mmm = [true,true]; } else { - mmm = [false,true]; + var mmm = [false,true]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; } if (ns1<=ns) { - x0 = x0.slice(1-1,ns1); + var x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } diff --git a/js/Linear/CLR.pickle b/js/Linear/CLR.pickle index 805fede1..a0c8eaad 100644 --- a/js/Linear/CLR.pickle +++ b/js/Linear/CLR.pickle @@ -43,84 +43,78 @@ g8 sS'x.graphics' p12 g2 -sS'[ns1,ns1]' -p13 -g8 -sS'[A,B,C,D]' -p14 -S'vector' -p15 sS'ns' -p16 +p13 g8 sS'A' -p17 +p14 g8 sS'model.sim' -p18 +p15 S'list' -p19 +p16 sS'C' -p20 +p17 g8 sS'PREVAR_scicos_context.s' -p21 +p18 g8 sS'nin' -p22 +p19 g8 sS'D' -p23 +p20 g8 sS'H' -p24 +p21 g8 sS'model.rpar' -p25 +p22 g5 sS'mmm' -p26 -g15 +p23 +S'vector' +p24 sS'model.state' -p27 +p25 g8 sS'graphics.exprs' -p28 +p26 NsS'x0' -p29 +p27 g8 sS'typ' -p30 -g15 +p28 +g24 sS'ok' -p31 +p29 S'boolean' -p32 +p30 sS'model.blocktype' -p33 +p31 S'string' -p34 +p32 sS'model.dep_ut' -p35 -g15 +p33 +g24 sS'exprs' -p36 +p34 g5 sS'gr_i' -p37 -g15 +p35 +g24 sS'PREVAR_scicos_context' -p38 +p36 NsS'y' -p39 -g15 +p37 +g24 sS'x' -p40 +p38 g8 sS'model' -p41 +p39 g2 sS'nout' -p42 +p40 g8 s.
\ No newline at end of file diff --git a/js/Linear/CLR_f.js b/js/Linear/CLR_f.js index d91ac6e5..d1b8d23b 100644 --- a/js/Linear/CLR_f.js +++ b/js/Linear/CLR_f.js @@ -1,12 +1,12 @@ /* autogenerated from "macros/Linear/CLR_f.sci" */ function CLR_f() { CLR_f.prototype.define = function CLR_f() { - x0 = 0; - A = -1; - B = 1; - C = 1; - D = 0; - exprs = [["1"],["1+s"]]; + var x0 = 0; + var A = -1; + var B = 1; + var C = 1; + var D = 0; + var exprs = [["1"],["1+s"]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["csslti"]), new ScilabDouble([1])); this.model.in1 = new ScilabDouble([1]); @@ -15,7 +15,7 @@ function CLR_f() { this.model.rpar = new ScilabDouble([A.slice()],[B.slice()],[C.slice()],[D.slice()]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - gr_i = []; + var gr_i = []; this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -33,15 +33,15 @@ function CLR_f() { this.num = arguments[0]["num"] this.den = arguments[0]["den"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - x0 = this.model.state; - rpar = this.model.rpar; - ns = prod(size(x0)); - nin = 1; - nout = 1; - PREVAR_scicos_context = PREVAR_scicos_context; + var x0 = this.model.state; + var rpar = this.model.rpar; + var ns = prod(size(x0)); + var nin = 1; + var nout = 1; + var PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.s = %s; while (true) { [ok,this.num,this.den,exprs] = scicos_getvalue("Set continuous SISO transfer parameters",["Numerator (s)","Denominator (s)"],list("pol",1,"pol",1),exprs); @@ -50,24 +50,30 @@ function CLR_f() { } if (degree(this.num)>degree(this.den)) { message("Transfer must be proper or strictly proper"); - ok = false; + var ok = false; } if (ok) { - H = cont_frm(this.num,this.den); - [A,B,C,D] = H.slice(2-1,5); + var H = cont_frm(this.num,this.den); + var tmpvar0 = H.slice(2-1,5) + var A = tmpvar0[0] + var B = tmpvar0[1] + var C = tmpvar0[2] + var D = tmpvar0[3]; graphics.exprs = exprs; - [ns1,ns1] = size(A); - rpar = [[matrix(A,ns1*ns1,1)],[matrix(B,ns1,1)],[matrix(C,ns1,1)],[D]]; + var tmpvar1 = size(A) + var ns1 = tmpvar1[0] + var ns1 = tmpvar1[1]; + var rpar = [[matrix(A,ns1*ns1,1)],[matrix(B,ns1,1)],[matrix(C,ns1,1)],[D]]; if (norm(D,1)!=0) { - mmm = [true,true]; + var mmm = [true,true]; } else { - mmm = [false,true]; + var mmm = [false,true]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; } if (ns1<=ns) { - x0 = x0.slice(1-1,ns1); + var x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } diff --git a/js/Linear/CLR_f.pickle b/js/Linear/CLR_f.pickle index 805fede1..a0c8eaad 100644 --- a/js/Linear/CLR_f.pickle +++ b/js/Linear/CLR_f.pickle @@ -43,84 +43,78 @@ g8 sS'x.graphics' p12 g2 -sS'[ns1,ns1]' -p13 -g8 -sS'[A,B,C,D]' -p14 -S'vector' -p15 sS'ns' -p16 +p13 g8 sS'A' -p17 +p14 g8 sS'model.sim' -p18 +p15 S'list' -p19 +p16 sS'C' -p20 +p17 g8 sS'PREVAR_scicos_context.s' -p21 +p18 g8 sS'nin' -p22 +p19 g8 sS'D' -p23 +p20 g8 sS'H' -p24 +p21 g8 sS'model.rpar' -p25 +p22 g5 sS'mmm' -p26 -g15 +p23 +S'vector' +p24 sS'model.state' -p27 +p25 g8 sS'graphics.exprs' -p28 +p26 NsS'x0' -p29 +p27 g8 sS'typ' -p30 -g15 +p28 +g24 sS'ok' -p31 +p29 S'boolean' -p32 +p30 sS'model.blocktype' -p33 +p31 S'string' -p34 +p32 sS'model.dep_ut' -p35 -g15 +p33 +g24 sS'exprs' -p36 +p34 g5 sS'gr_i' -p37 -g15 +p35 +g24 sS'PREVAR_scicos_context' -p38 +p36 NsS'y' -p39 -g15 +p37 +g24 sS'x' -p40 +p38 g8 sS'model' -p41 +p39 g2 sS'nout' -p42 +p40 g8 s.
\ No newline at end of file diff --git a/js/Linear/CLSS.js b/js/Linear/CLSS.js index 679b0e73..d5fd2d3a 100644 --- a/js/Linear/CLSS.js +++ b/js/Linear/CLSS.js @@ -6,8 +6,8 @@ function CLSS() { this.B = 1; this.C = 1; this.D = 0; - in1 = 1; - out = 1; + var in1 = 1; + var out = 1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["csslti4"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([in1]); @@ -16,8 +16,8 @@ function CLSS() { this.model.rpar = new ScilabDouble([this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -41,10 +41,10 @@ function CLSS() { this.D = parseFloat(arguments[0]["D"]) this.x0 = parseFloat(arguments[0]["x0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; if (size(exprs,"*")==7) { - exprs = exprs[[1:4,7]-1]; + var exprs = exprs[[1:4,7]-1]; } this.model = arg1.model; while (true) { @@ -52,37 +52,42 @@ function CLSS() { if (!ok) { break; } - out = size(this.C,1); + var out = size(this.C,1); if (out==0) { - out = []; + var out = []; } - in1 = size(this.B,2); + var in1 = size(this.B,2); if (in1==0) { - in1 = []; + var in1 = []; } - [ms,ns] = size(this.A); - okD = true; + var tmpvar0 = size(this.A) + var ms = tmpvar0[0] + var ns = tmpvar0[1]; + var okD = true; if (size(this.D,"*")!=size(this.C,1)*size(this.B,2)) { if (size(this.D,"*")==1) { this.D = this.D*ones(this.C*this.B); } else if (size(this.D,"*")==0) { this.D = zeros(this.C*this.B); } else { - okD = false; + var okD = false; } } if (ms!=ns||!okD) { message(_("Matrix A is not square or D has wrong dimension")); } else { - [this.model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); + var tmpvar1 = check_io(this.model,graphics,in1,out,[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; - rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; if (this.D!=[]) { if (norm(this.D,1)!=0) { - mmm = [true,true]; + var mmm = [true,true]; } else { - mmm = [false,true]; + var mmm = [false,true]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/CLSS.pickle b/js/Linear/CLSS.pickle index 4f321577..321fe50f 100644 --- a/js/Linear/CLSS.pickle +++ b/js/Linear/CLSS.pickle @@ -33,87 +33,81 @@ p5 sS'x.model' p6 g2 -sS'[ms,ns]' +sS'model.out' p7 S'double' p8 -sS'model.out' -p9 -g8 sS'out' -p10 +p9 g8 sS'model.in1' -p11 +p10 g8 sS'x.graphics' -p12 +p11 g2 sS'A' -p13 +p12 g8 sS'model.sim' -p14 +p13 S'list' -p15 +p14 sS'C' -p16 +p15 g8 sS'B' -p17 +p16 g8 sS'D' -p18 +p17 g8 -sS'[this.model,graphics,ok]' -p19 -g15 sS'in1' -p20 +p18 g8 sS'model.rpar' -p21 +p19 g5 sS'mmm' -p22 +p20 S'vector' -p23 +p21 sS'model.state' -p24 +p22 g8 sS'graphics.exprs' -p25 +p23 g8 sS'x0' -p26 +p24 g8 sS'typ' -p27 -g23 +p25 +g21 sS'model.blocktype' -p28 +p26 S'string' -p29 +p27 sS'model.dep_ut' -p30 -g23 +p28 +g21 sS'exprs' -p31 +p29 g5 sS'gr_i' -p32 -g23 +p30 +g21 sS'okD' -p33 +p31 S'boolean' -p34 +p32 sS'y' -p35 -g23 +p33 +g21 sS'x' -p36 +p34 g8 sS'model' -p37 +p35 g2 s.
\ No newline at end of file diff --git a/js/Linear/CLSS_f.js b/js/Linear/CLSS_f.js index 77ee0162..f6afb7fb 100644 --- a/js/Linear/CLSS_f.js +++ b/js/Linear/CLSS_f.js @@ -6,8 +6,8 @@ function CLSS_f() { this.B = 1; this.C = 1; this.D = 0; - in1 = 1; - out = 1; + var in1 = 1; + var out = 1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["csslti"]), new ScilabDouble([1])); this.model.in1 = new ScilabDouble([in1]); @@ -16,8 +16,8 @@ function CLSS_f() { this.model.rpar = new ScilabDouble([this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -41,10 +41,10 @@ function CLSS_f() { this.D = parseFloat(arguments[0]["D"]) this.x0 = parseFloat(arguments[0]["x0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; if (size(exprs,"*")==7) { - exprs = exprs[[1:4,7]-1]; + var exprs = exprs[[1:4,7]-1]; } this.model = arg1.model; while (true) { @@ -52,27 +52,32 @@ function CLSS_f() { if (!ok) { break; } - out = size(this.C,1); + var out = size(this.C,1); if (out==0) { - out = []; + var out = []; } - in1 = size(this.B,2); + var in1 = size(this.B,2); if (in1==0) { - in1 = []; + var in1 = []; } - [ms,ns] = size(this.A); + var tmpvar0 = size(this.A) + var ms = tmpvar0[0] + var ns = tmpvar0[1]; if (ms!=ns) { message("A matrix must be square"); } else { - [this.model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); + var tmpvar1 = check_io(this.model,graphics,in1,out,[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; - rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; if (this.D!=[]) { if (norm(this.D,1)!=0) { - mmm = [true,true]; + var mmm = [true,true]; } else { - mmm = [false,true]; + var mmm = [false,true]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/CLSS_f.pickle b/js/Linear/CLSS_f.pickle index 09fdffb3..5800baa1 100644 --- a/js/Linear/CLSS_f.pickle +++ b/js/Linear/CLSS_f.pickle @@ -33,83 +33,77 @@ p5 sS'x.model' p6 g2 -sS'model.dep_ut' -p7 -S'vector' -p8 sS'model.out' -p9 +p7 S'double' -p10 +p8 sS'out' -p11 -g10 +p9 +g8 sS'model.in1' -p12 -g10 +p10 +g8 sS'x.graphics' -p13 +p11 g2 sS'A' -p14 -g10 +p12 +g8 sS'model.sim' -p15 +p13 S'list' -p16 +p14 sS'C' -p17 -g10 +p15 +g8 sS'B' -p18 -g10 +p16 +g8 sS'D' -p19 -g10 -sS'[this.model,graphics,ok]' -p20 -g16 +p17 +g8 sS'in1' -p21 -g10 +p18 +g8 sS'model.rpar' -p22 +p19 g5 sS'mmm' +p20 +S'vector' +p21 +sS'model.state' +p22 +g8 +sS'graphics.exprs' p23 g8 -sS'model.state' +sS'x0' p24 -g10 -sS'graphics.exprs' +g8 +sS'typ' p25 -g10 -sS'x0' +g21 +sS'model.blocktype' p26 -g10 -sS'typ' +S'string' p27 -g8 -sS'model.blocktype' +sS'model.dep_ut' p28 -S'string' -p29 -sS'[ms,ns]' -p30 -g10 +g21 sS'exprs' -p31 +p29 g5 sS'gr_i' -p32 -g8 +p30 +g21 sS'y' -p33 -g8 +p31 +g21 sS'x' -p34 -g10 +p32 +g8 sS'model' -p35 +p33 g2 s.
\ No newline at end of file diff --git a/js/Linear/DELAYV_f.js b/js/Linear/DELAYV_f.js index e8b2de09..0cfbfc4d 100644 --- a/js/Linear/DELAYV_f.js +++ b/js/Linear/DELAYV_f.js @@ -2,7 +2,7 @@ function DELAYV_f() { DELAYV_f.prototype.define = function DELAYV_f() { this.nin = 1; - z0 = zeros(11,1); + var z0 = zeros(11,1); this.zz0 = z0.slice(1-1,$-1); this.T = 1; this.model = scicos_model(); @@ -16,8 +16,8 @@ function DELAYV_f() { this.model.blocktype = new ScilabString(["d"]); this.model.firing = [0,-1]; this.model.dep_ut = [true,false]; - exprs = [[string(this.nin)],[strcat(string(z0.slice(1-1,$-1)),";")],[string(this.T)]]; - gr_i = []; + var exprs = [[string(this.nin)],[strcat(string(z0.slice(1-1,$-1)),";")],[string(this.T)]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -37,13 +37,13 @@ function DELAYV_f() { this.zz0 = inverse(arguments[0]["zz0"]) this.T = parseFloat(arguments[0]["T"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; this.nin = this.model.in1[1-1]; - z0 = this.model.dstate; + var z0 = this.model.dstate; this.zz0 = z0.slice(1-1,$-1); - told = z0[$-1]; + var told = z0[$-1]; while (true) { [ok,this.nin,this.zz0,this.T,exprs] = scicos_getvalue("Set delay parameters",["Number of inputs","Register initial condition","Max delay"],list("vec",1,"vec",-1,"vec",1),exprs); if (!ok) { @@ -51,14 +51,17 @@ function DELAYV_f() { } if (size(this.zz0,"*")<2) { message("Register length must be at least 2"); - ok = false; + var ok = false; } if (this.T<=0) { message("Delay must be positive"); - ok = false; + var ok = false; } if (ok) { - [this.model,graphics,ok] = check_io(this.model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]); + var tmpvar0 = check_io(this.model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/DELAYV_f.pickle b/js/Linear/DELAYV_f.pickle index e6e095e1..caf0384e 100644 --- a/js/Linear/DELAYV_f.pickle +++ b/js/Linear/DELAYV_f.pickle @@ -65,44 +65,41 @@ g11 sS'nin' p20 g2 -sS'[this.model,graphics,ok]' -p21 -g18 sS'model.rpar' -p22 +p21 g2 sS'T' -p23 +p22 g2 sS'graphics.exprs' -p24 +p23 NsS'z0' -p25 +p24 g2 sS'ok' -p26 +p25 S'boolean' -p27 +p26 sS'model.blocktype' -p28 +p27 S'string' -p29 +p28 sS'model.dep_ut' -p30 +p29 g7 sS'exprs' -p31 +p30 g11 sS'gr_i' -p32 +p31 g7 sS'y' -p33 +p32 g7 sS'x' -p34 +p33 g2 sS'model' -p35 +p34 g4 s.
\ No newline at end of file diff --git a/js/Linear/DELAY_f.js b/js/Linear/DELAY_f.js index 129377bb..dad5fa7c 100644 --- a/js/Linear/DELAY_f.js +++ b/js/Linear/DELAY_f.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Linear/DELAY_f.sci" */ function DELAY_f() { DELAY_f.prototype.define = function DELAY_f() { - evtdly = EVTDLY_f("define"); + var evtdly = EVTDLY_f("define"); evtdly.graphics.orig = [243,296]; evtdly.graphics.sz = [40,40]; evtdly.graphics.flip = true; @@ -10,7 +10,7 @@ function DELAY_f() { evtdly.graphics.peout = 7; evtdly.model.rpar = 0.1; evtdly.model.firing = 0; - register = REGISTER_f("define"); + var register = REGISTER_f("define"); register.graphics.orig = [238,195]; register.graphics.sz = [50,50]; register.graphics.flip = true; @@ -18,25 +18,25 @@ function DELAY_f() { register.graphics.pin = 6; register.graphics.pout = 5; register.graphics.pein = 9; - input_port = IN_f("define"); + var input_port = IN_f("define"); input_port.graphics.orig = [92,210]; input_port.graphics.sz = [20,20]; input_port.graphics.flip = true; input_port.graphics.exprs = [["1"],["1"]]; input_port.graphics.pout = 6; input_port.model.ipar = 1; - output_port = OUT_f("define"); + var output_port = OUT_f("define"); output_port.graphics.orig = [440,210]; output_port.graphics.sz = [20,20]; output_port.graphics.flip = true; output_port.graphics.exprs = [["1"],["1"]]; output_port.graphics.pin = 5; output_port.model.ipar = 1; - split = CLKSPLIT_f("define"); + var split = CLKSPLIT_f("define"); split.graphics.orig = [[263],[271.2]]; split.graphics.pein = 7; split.graphics.peout = [[9],[10]]; - diagram = scicos_diagram(); + var diagram = scicos_diagram(); diagram.objs[1-1] = input_port; diagram.objs[2-1] = output_port; diagram.objs[3-1] = register; @@ -78,9 +78,9 @@ function DELAY_f() { DELAY_f.prototype.set = function DELAY_f() { this.dt = arguments[0]["dt"] this.z0 = arguments[0]["z0"] - ppath = list(0,0); + var ppath = list(0,0); for (i=1;i<=length(arg1.model.rpar.objs);i+=1) { - o = arg1.model.rpar.objs[i-1]; + var o = arg1.model.rpar.objs[i-1]; if (typeof(o)=="Block"&&o.gui=="REGISTER_f") { ppath[1-1] = i; } @@ -92,25 +92,25 @@ function DELAY_f() { } } this.x = arg1; - newpar = list(); - register = this.x.model.rpar.objs[ppath[1-1]-1]; - evtdly = this.x.model.rpar.objs[ppath[2-1]-1]; - register_exprs = register.graphics.exprs; - evtdly_exprs = evtdly.graphics.exprs; - exprs = [[evtdly_exprs[1-1]],[register_exprs]]; + var newpar = list(); + var register = this.x.model.rpar.objs[ppath[1-1]-1]; + var evtdly = this.x.model.rpar.objs[ppath[2-1]-1]; + var register_exprs = register.graphics.exprs; + var evtdly_exprs = evtdly.graphics.exprs; + var exprs = [[evtdly_exprs[1-1]],[register_exprs]]; while (true) { [ok,this.dt,this.z0,exprs] = scicos_getvalue([["This block implements as a discretized delay"],["it is consist of a shift register and a clock"],["value of the delay is given by;","the discretization time step multiplied by the"],["number-1 of state of the register"]],["Discretization time step","Register initial state"],list("vec",1,"vec",-1),exprs); if (!ok) { break; } - mess = []; + var mess = []; if (prod(size(this.z0))<1) { - mess = [[mess],["Register length must be at least 1"],[" "]]; - ok = false; + var mess = [[mess],["Register length must be at least 1"],[" "]]; + var ok = false; } if (this.dt<=0) { - mess = [[mess],["Discretization time step must be positive"],[" "]]; - ok = false; + var mess = [[mess],["Discretization time step must be positive"],[" "]]; + var ok = false; } if (!ok) { message(mess); @@ -130,9 +130,9 @@ function DELAY_f() { break; } } - needcompile = 0; - y = needcompile; - typ = newpar; + var needcompile = 0; + var y = needcompile; + var typ = newpar; return new BasicBlock(this.x); } } diff --git a/js/Linear/DERIV.js b/js/Linear/DERIV.js index 127b74fa..853643e7 100644 --- a/js/Linear/DERIV.js +++ b/js/Linear/DERIV.js @@ -7,8 +7,8 @@ function DERIV() { this.model.out = new ScilabDouble([-1]); this.model.blocktype = new ScilabString(["x"]); this.model.dep_ut = [true,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/Linear/DIFF_c.js b/js/Linear/DIFF_c.js index f1a45eeb..f8d77168 100644 --- a/js/Linear/DIFF_c.js +++ b/js/Linear/DIFF_c.js @@ -9,8 +9,8 @@ function DIFF_c() { this.model.state = new ScilabDouble(this.x0); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -28,26 +28,26 @@ function DIFF_c() { this.x0 = inverse(arguments[0]["x0"]) this.xd0 = inverse(arguments[0]["xd0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { - ask_again = false; + var ask_again = false; [ok,this.x0,this.xd0,exprs] = scicos_getvalue("Set continuous linear system parameters",["Initial state","Initial Derivative"],list("vec",-1,"vec",-1),exprs); if (!ok) { break; } this.x0 = this.x0.slice(); - N = size(this.x0,"*"); + var N = size(this.x0,"*"); this.xd0 = this.xd0.slice(); - Nxd = size(this.xd0,"*"); + var Nxd = size(this.xd0,"*"); if ((N!=Nxd)) { message("Incompatible sizes: states and their derivatives should have the same size "); - ask_again = true; + var ask_again = true; } if ((N<=0&&!ask_again)) { x_message("number of states must be > 0 "); - ask_again = true; + var ask_again = true; } if (!ask_again) { graphics.exprs = exprs; diff --git a/js/Linear/DLR.js b/js/Linear/DLR.js index 96fe4163..8c4d3f0e 100644 --- a/js/Linear/DLR.js +++ b/js/Linear/DLR.js @@ -1,12 +1,12 @@ /* autogenerated from "macros/Linear/DLR.sci" */ function DLR() { DLR.prototype.define = function DLR() { - x0 = 0; - A = -1; - B = 1; - C = 1; - D = 0; - exprs = [["1"],["1+z"]]; + var x0 = 0; + var A = -1; + var B = 1; + var C = 1; + var D = 0; + var exprs = [["1"],["1+z"]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["dsslti4"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([1]); @@ -16,7 +16,7 @@ function DLR() { this.model.rpar = new ScilabDouble([A.slice()],[B.slice()],[C.slice()],[D.slice()]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,12 +34,12 @@ function DLR() { this.num = arguments[0]["num"] this.den = arguments[0]["den"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - x0 = this.model.dstate; - ns = prod(size(x0)); - PREVAR_scicos_context = PREVAR_scicos_context; + var x0 = this.model.dstate; + var ns = prod(size(x0)); + var PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.z = %z; while (true) { [ok,this.num,this.den,exprs] = scicos_getvalue("Set discrete SISO transfer parameters",["Numerator (z)","Denominator (z)"],list("pol",1,"pol",1),exprs); @@ -48,25 +48,31 @@ function DLR() { } if (degree(this.num)>degree(this.den)) { message("Transfer function must be proper"); - ok = false; + var ok = false; } if (ok) { - H = cont_frm(this.num,this.den); - [A,B,C,D] = H.slice(2-1,5); + var H = cont_frm(this.num,this.den); + var tmpvar0 = H.slice(2-1,5) + var A = tmpvar0[0] + var B = tmpvar0[1] + var C = tmpvar0[2] + var D = tmpvar0[3]; graphics.exprs = exprs; - [ns1,ns1] = size(A); + var tmpvar1 = size(A) + var ns1 = tmpvar1[0] + var ns1 = tmpvar1[1]; if (ns1<=ns) { - x0 = x0.slice(1-1,ns1); + var x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } - rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + var rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; this.model.dstate = x0; this.model.rpar = new ScilabDouble(rpar); if (norm(D,1)!=0) { - mmm = [true,false]; + var mmm = [true,false]; } else { - mmm = [false,false]; + var mmm = [false,false]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/DLR.pickle b/js/Linear/DLR.pickle index 34bf03b2..8a5f2aa6 100644 --- a/js/Linear/DLR.pickle +++ b/js/Linear/DLR.pickle @@ -47,80 +47,74 @@ g2 sS'x.graphics' p14 g4 -sS'[ns1,ns1]' -p15 -g10 -sS'[A,B,C,D]' -p16 -g2 sS'model.evtin' -p17 +p15 g10 sS'ns' -p18 +p16 g10 sS'A' -p19 +p17 g10 sS'model.sim' -p20 +p18 S'list' -p21 +p19 sS'C' -p22 +p20 g10 sS'B' -p23 +p21 g10 sS'D' -p24 +p22 g10 sS'H' -p25 +p23 g10 sS'PREVAR_scicos_context.z' -p26 +p24 g10 sS'model.rpar' -p27 +p25 g7 sS'mmm' -p28 +p26 g2 sS'graphics.exprs' -p29 +p27 NsS'x0' -p30 +p28 g10 sS'typ' -p31 +p29 g2 sS'ok' -p32 +p30 S'boolean' -p33 +p31 sS'model.blocktype' -p34 +p32 S'string' -p35 +p33 sS'model.dep_ut' -p36 +p34 g2 sS'exprs' -p37 +p35 g7 sS'gr_i' -p38 +p36 g2 sS'PREVAR_scicos_context' -p39 +p37 NsS'y' -p40 +p38 g2 sS'x' -p41 +p39 g10 sS'model' -p42 +p40 g4 s.
\ No newline at end of file diff --git a/js/Linear/DLR_f.js b/js/Linear/DLR_f.js index 801be7cb..0306a6d9 100644 --- a/js/Linear/DLR_f.js +++ b/js/Linear/DLR_f.js @@ -1,12 +1,12 @@ /* autogenerated from "macros/Linear/DLR_f.sci" */ function DLR_f() { DLR_f.prototype.define = function DLR_f() { - x0 = 0; - A = -1; - B = 1; - C = 1; - D = 0; - exprs = [["1"],["1+z"]]; + var x0 = 0; + var A = -1; + var B = 1; + var C = 1; + var D = 0; + var exprs = [["1"],["1+z"]]; this.model = scicos_model(); this.model.sim = new ScilabString(["dsslti"]); this.model.in1 = new ScilabDouble([1]); @@ -16,7 +16,7 @@ function DLR_f() { this.model.rpar = new ScilabDouble([A.slice()],[B.slice()],[C.slice()],[D.slice()]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,12 +34,12 @@ function DLR_f() { this.num = arguments[0]["num"] this.den = arguments[0]["den"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - x0 = this.model.dstate; - ns = prod(size(x0)); - PREVAR_scicos_context = PREVAR_scicos_context; + var x0 = this.model.dstate; + var ns = prod(size(x0)); + var PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.z = %z; while (true) { [ok,this.num,this.den,exprs] = scicos_getvalue("Set discrete SISO transfer parameters",["Numerator (z)","Denominator (z)"],list("pol",1,"pol",1),exprs); @@ -48,25 +48,31 @@ function DLR_f() { } if (degree(this.num)>degree(this.den)) { message("Transfer must be proper"); - ok = false; + var ok = false; } if (ok) { - H = cont_frm(this.num,this.den); - [A,B,C,D] = H.slice(2-1,5); + var H = cont_frm(this.num,this.den); + var tmpvar0 = H.slice(2-1,5) + var A = tmpvar0[0] + var B = tmpvar0[1] + var C = tmpvar0[2] + var D = tmpvar0[3]; graphics.exprs = exprs; - [ns1,ns1] = size(A); + var tmpvar1 = size(A) + var ns1 = tmpvar1[0] + var ns1 = tmpvar1[1]; if (ns1<=ns) { - x0 = x0.slice(1-1,ns1); + var x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } - rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + var rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; this.model.dstate = x0; this.model.rpar = new ScilabDouble(rpar); if (norm(D,1)!=0) { - mmm = [true,false]; + var mmm = [true,false]; } else { - mmm = [false,false]; + var mmm = [false,false]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/DLR_f.pickle b/js/Linear/DLR_f.pickle index 5646a5ed..44d413c7 100644 --- a/js/Linear/DLR_f.pickle +++ b/js/Linear/DLR_f.pickle @@ -47,79 +47,73 @@ g2 sS'x.graphics' p14 g4 -sS'[ns1,ns1]' -p15 -g10 -sS'[A,B,C,D]' -p16 -g2 sS'model.evtin' -p17 +p15 g10 sS'ns' -p18 +p16 g10 sS'A' -p19 +p17 g10 sS'model.sim' -p20 +p18 S'string' -p21 +p19 sS'C' -p22 +p20 g10 sS'B' -p23 +p21 g10 sS'D' -p24 +p22 g10 sS'H' -p25 +p23 g10 sS'PREVAR_scicos_context.z' -p26 +p24 g10 sS'model.rpar' -p27 +p25 g7 sS'mmm' -p28 +p26 g2 sS'graphics.exprs' -p29 +p27 NsS'x0' -p30 +p28 g10 sS'typ' -p31 +p29 g2 sS'ok' -p32 +p30 S'boolean' -p33 +p31 sS'model.blocktype' -p34 -g21 +p32 +g19 sS'model.dep_ut' -p35 +p33 g2 sS'exprs' -p36 +p34 g7 sS'gr_i' -p37 +p35 g2 sS'PREVAR_scicos_context' -p38 +p36 NsS'y' -p39 +p37 g2 sS'x' -p40 +p38 g10 sS'model' -p41 +p39 g4 s.
\ No newline at end of file diff --git a/js/Linear/DLSS.js b/js/Linear/DLSS.js index 49becba3..69f34f7c 100644 --- a/js/Linear/DLSS.js +++ b/js/Linear/DLSS.js @@ -15,8 +15,8 @@ function DLSS() { this.model.rpar = new ScilabDouble([this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -40,10 +40,10 @@ function DLSS() { this.D = parseFloat(arguments[0]["D"]) this.x0 = parseFloat(arguments[0]["x0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; if (size(exprs,"*")==7) { - exprs = exprs[[1:4,7]-1]; + var exprs = exprs[[1:4,7]-1]; } this.model = arg1.model; while (true) { @@ -51,37 +51,42 @@ function DLSS() { if (!ok) { break; } - out = size(this.C,1); + var out = size(this.C,1); if (out==0) { - out = []; + var out = []; } - in1 = size(this.B,2); + var in1 = size(this.B,2); if (in1==0) { - in1 = []; + var in1 = []; } - [ms,ns] = size(this.A); - okD = true; + var tmpvar0 = size(this.A) + var ms = tmpvar0[0] + var ns = tmpvar0[1]; + var okD = true; if (size(this.D,"*")!=size(this.C,1)*size(this.B,2)) { if (size(this.D,"*")==1) { this.D = this.D*ones(this.C*this.B); } else if (size(this.D,"*")==0) { this.D = zeros(this.C*this.B); } else { - okD = false; + var okD = false; } } if (ms!=ns||!okD) { message(_("Matrix A is not square or D has wrong dimension")); } else { - [this.model,graphics,ok] = check_io(this.model,graphics,in1,out,1,[]); + var tmpvar1 = check_io(this.model,graphics,in1,out,1,[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; - rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; if (this.D!=[]) { if (norm(this.D,1)!=0) { - mmm = [true,false]; + var mmm = [true,false]; } else { - mmm = [false,false]; + var mmm = [false,false]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/DLSS.pickle b/js/Linear/DLSS.pickle index 52fc31ec..2dfb7e72 100644 --- a/js/Linear/DLSS.pickle +++ b/js/Linear/DLSS.pickle @@ -37,86 +37,80 @@ p7 sS'x.model' p8 g4 -sS'[ms,ns]' +sS'model.out' p9 S'double' p10 -sS'model.out' -p11 -g10 sS'out' -p12 +p11 g2 sS'model.in1' -p13 +p12 g10 sS'x.graphics' -p14 +p13 g4 sS'model.evtin' -p15 +p14 g10 sS'A' -p16 +p15 g10 sS'model.sim' -p17 +p16 S'list' -p18 +p17 sS'C' -p19 +p18 g10 sS'B' -p20 +p19 g10 sS'D' -p21 +p20 g10 -sS'[this.model,graphics,ok]' -p22 -g18 sS'in1' -p23 +p21 g2 sS'model.rpar' -p24 +p22 g7 sS'mmm' -p25 +p23 g2 sS'graphics.exprs' -p26 +p24 g10 sS'x0' -p27 +p25 g10 sS'typ' -p28 +p26 g2 sS'model.blocktype' -p29 +p27 S'string' -p30 +p28 sS'model.dep_ut' -p31 +p29 g2 sS'exprs' -p32 +p30 g7 sS'gr_i' -p33 +p31 g2 sS'okD' -p34 +p32 S'boolean' -p35 +p33 sS'y' -p36 +p34 g2 sS'x' -p37 +p35 g10 sS'model' -p38 +p36 g4 s.
\ No newline at end of file diff --git a/js/Linear/DLSS_f.js b/js/Linear/DLSS_f.js index 409916ab..81a76895 100644 --- a/js/Linear/DLSS_f.js +++ b/js/Linear/DLSS_f.js @@ -15,8 +15,8 @@ function DLSS_f() { this.model.rpar = new ScilabDouble([this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -40,10 +40,10 @@ function DLSS_f() { this.D = parseFloat(arguments[0]["D"]) this.x0 = parseFloat(arguments[0]["x0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; if (size(exprs,"*")==7) { - exprs = exprs[[1:4,7]-1]; + var exprs = exprs[[1:4,7]-1]; } this.model = arg1.model; while (true) { @@ -51,27 +51,32 @@ function DLSS_f() { if (!ok) { break; } - out = size(this.C,1); + var out = size(this.C,1); if (out==0) { - out = []; + var out = []; } - in1 = size(this.B,2); + var in1 = size(this.B,2); if (in1==0) { - in1 = []; + var in1 = []; } - [ms,ns] = size(this.A); + var tmpvar0 = size(this.A) + var ms = tmpvar0[0] + var ns = tmpvar0[1]; if (ms!=ns) { message("A matrix must be square"); } else { - [this.model,graphics,ok] = check_io(this.model,graphics,in1,out,1,[]); + var tmpvar1 = check_io(this.model,graphics,in1,out,1,[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; - rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; if (this.D!=[]) { if (norm(this.D,1)!=0) { - mmm = [true,false]; + var mmm = [true,false]; } else { - mmm = [false,false]; + var mmm = [false,false]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/DLSS_f.pickle b/js/Linear/DLSS_f.pickle index cd25ebe9..c8c627de 100644 --- a/js/Linear/DLSS_f.pickle +++ b/js/Linear/DLSS_f.pickle @@ -37,82 +37,76 @@ p7 sS'x.model' p8 g4 -sS'model.dep_ut' -p9 -g2 sS'model.out' -p10 +p9 S'double' -p11 +p10 sS'out' -p12 +p11 g2 sS'model.in1' -p13 -g11 +p12 +g10 sS'x.graphics' -p14 +p13 g4 sS'model.evtin' -p15 -g11 +p14 +g10 sS'A' -p16 -g11 +p15 +g10 sS'model.sim' -p17 +p16 S'list' -p18 +p17 sS'C' -p19 -g11 +p18 +g10 sS'B' -p20 -g11 +p19 +g10 sS'D' -p21 -g11 -sS'[this.model,graphics,ok]' -p22 -g18 +p20 +g10 sS'in1' -p23 +p21 g2 sS'model.rpar' -p24 +p22 g7 sS'mmm' -p25 +p23 g2 sS'graphics.exprs' -p26 -g11 +p24 +g10 sS'x0' -p27 -g11 +p25 +g10 sS'typ' -p28 +p26 g2 sS'model.blocktype' -p29 +p27 S'string' -p30 -sS'[ms,ns]' -p31 -g11 +p28 +sS'model.dep_ut' +p29 +g2 sS'exprs' -p32 +p30 g7 sS'gr_i' -p33 +p31 g2 sS'y' -p34 +p32 g2 sS'x' -p35 -g11 +p33 +g10 sS'model' -p36 +p34 g4 s.
\ No newline at end of file diff --git a/js/Linear/DOLLAR.js b/js/Linear/DOLLAR.js index 960f1660..c92f7138 100644 --- a/js/Linear/DOLLAR.js +++ b/js/Linear/DOLLAR.js @@ -1,10 +1,10 @@ /* autogenerated from "macros/Linear/DOLLAR.sci" */ function DOLLAR() { DOLLAR.prototype.define = function DOLLAR() { - z = 0; + var z = 0; this.inh = 0; - in1 = 1; - exprs = string([[z],[this.inh]]); + var in1 = 1; + var exprs = string([[z],[this.inh]]); this.model = scicos_model(); this.model.sim = list(new ScilabString(["dollar4"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([in1]); @@ -13,7 +13,7 @@ function DOLLAR() { this.model.dstate = new ScilabDouble([z]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -31,8 +31,8 @@ function DOLLAR() { this.a = arguments[0]["a"] this.inh = parseFloat(arguments[0]["inh"]) 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[2-1] = "0"; @@ -42,51 +42,54 @@ function DOLLAR() { if (!ok) { break; } - out = [size(this.a,1),size(this.a,2)]; + var out = [size(this.a,1),size(this.a,2)]; if (out==0) { - out = []; + var out = []; } - in1 = out; + var in1 = out; this.model.sim = list(new ScilabString(["dollar4_m"]), new ScilabDouble([4])); this.model.odstate = list(new ScilabDouble([this.a])); this.model.dstate = []; if (this.type[(this.a)==1-1]) { if (isreal(this.a)) { - it = 1; - ot = 1; + var it = 1; + var ot = 1; if ((size(this.a,1)==1||size(this.a,2)==1)) { this.model.sim = list(new ScilabString(["dollar4"]), new ScilabDouble([4])); this.model.dstate = this.a.slice(); this.model.odstate = list(); } } else { - it = 2; - ot = 2; + var it = 2; + var ot = 2; } } else if ((typeof(this.a)=="int32")) { - it = 3; - ot = 3; + var it = 3; + var ot = 3; } else if ((typeof(this.a)=="int16")) { - it = 4; - ot = 4; + var it = 4; + var ot = 4; } else if ((typeof(this.a)=="int8")) { - it = 5; - ot = 5; + var it = 5; + var ot = 5; } else if ((typeof(this.a)=="uint32")) { - it = 6; - ot = 6; + var it = 6; + var ot = 6; } else if ((typeof(this.a)=="uint16")) { - it = 7; - ot = 7; + var it = 7; + var ot = 7; } else if ((typeof(this.a)=="uint8")) { - it = 8; - ot = 8; + var it = 8; + var ot = 8; } else { message("type is not recognized"); - ok = false; + var ok = false; } if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/DOLLAR.pickle b/js/Linear/DOLLAR.pickle index f1752657..032d6ef5 100644 --- a/js/Linear/DOLLAR.pickle +++ b/js/Linear/DOLLAR.pickle @@ -61,46 +61,43 @@ p18 sS'model.sim' p19 g2 -sS'[this.model,graphics,ok]' -p20 -g4 sS'in1' -p21 +p20 g4 sS'graphics.exprs' -p22 +p21 NsS'typ' -p23 +p22 g13 sS'ot' -p24 +p23 g4 sS'ok' -p25 +p24 S'boolean' -p26 +p25 sS'model.blocktype' -p27 +p26 g18 sS'model.dep_ut' -p28 +p27 g13 sS'exprs' -p29 +p28 g18 sS'gr_i' -p30 +p29 g13 sS'y' -p31 +p30 g13 sS'x' -p32 +p31 g4 sS'model' -p33 +p32 g6 sS'z' -p34 +p33 g4 s.
\ No newline at end of file diff --git a/js/Linear/DOLLAR_f.js b/js/Linear/DOLLAR_f.js index daf7ecc1..843477e9 100644 --- a/js/Linear/DOLLAR_f.js +++ b/js/Linear/DOLLAR_f.js @@ -1,10 +1,10 @@ /* autogenerated from "macros/Linear/DOLLAR_f.sci" */ function DOLLAR_f() { DOLLAR_f.prototype.define = function DOLLAR_f() { - z = 0; + var z = 0; this.inh = 0; - in1 = 1; - exprs = string([[z],[this.inh]]); + var in1 = 1; + var exprs = string([[z],[this.inh]]); this.model = scicos_model(); this.model.sim = new ScilabString(["dollar"]); this.model.in1 = new ScilabDouble([in1]); @@ -13,7 +13,7 @@ function DOLLAR_f() { this.model.dstate = new ScilabDouble([z]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -31,8 +31,8 @@ function DOLLAR_f() { this.a = arguments[0]["a"] this.inh = parseFloat(arguments[0]["inh"]) 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[2-1] = "0"; @@ -42,13 +42,16 @@ function DOLLAR_f() { if (!ok) { break; } - out = size(this.a,"*"); + var out = size(this.a,"*"); if (out==0) { - out = []; + var out = []; } - in1 = out; + var in1 = out; if (ok) { - [this.model,graphics,ok] = check_io(this.model,graphics,-1,-1,ones(1-this.inh,1),[]); + var tmpvar0 = check_io(this.model,graphics,-1,-1,ones(1-this.inh,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/DOLLAR_f.pickle b/js/Linear/DOLLAR_f.pickle index 223b5a69..3693edac 100644 --- a/js/Linear/DOLLAR_f.pickle +++ b/js/Linear/DOLLAR_f.pickle @@ -52,40 +52,36 @@ p15 sS'model.sim' p16 g15 -sS'[this.model,graphics,ok]' -p17 -S'list' -p18 sS'in1' -p19 +p17 g2 sS'graphics.exprs' -p20 +p18 NsS'typ' -p21 +p19 g10 sS'model.blocktype' -p22 +p20 g15 sS'model.dep_ut' -p23 +p21 g10 sS'exprs' -p24 +p22 g15 sS'gr_i' -p25 +p23 g10 sS'y' -p26 +p24 g10 sS'x' -p27 +p25 g2 sS'model' -p28 +p26 g4 sS'z' -p29 +p27 g2 s.
\ No newline at end of file diff --git a/js/Linear/DOLLAR_m.js b/js/Linear/DOLLAR_m.js index 2e7e5501..daaa8404 100644 --- a/js/Linear/DOLLAR_m.js +++ b/js/Linear/DOLLAR_m.js @@ -1,10 +1,10 @@ /* autogenerated from "macros/Linear/DOLLAR_m.sci" */ function DOLLAR_m() { DOLLAR_m.prototype.define = function DOLLAR_m() { - z = 0; + var z = 0; this.inh = 0; - in1 = 1; - exprs = string([[z],[this.inh]]); + var in1 = 1; + var exprs = string([[z],[this.inh]]); this.model = scicos_model(); this.model.sim = list(new ScilabString(["dollar4"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([in1]); @@ -13,7 +13,7 @@ function DOLLAR_m() { this.model.dstate = new ScilabDouble([z]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -31,8 +31,8 @@ function DOLLAR_m() { this.a = arguments[0]["a"] this.inh = parseFloat(arguments[0]["inh"]) 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[2-1] = "0"; @@ -42,51 +42,54 @@ function DOLLAR_m() { if (!ok) { break; } - out = [size(this.a,1),size(this.a,2)]; + var out = [size(this.a,1),size(this.a,2)]; if (out==0) { - out = []; + var out = []; } - in1 = out; + var in1 = out; this.model.sim = list(new ScilabString(["dollar4_m"]), new ScilabDouble([4])); this.model.odstate = list(new ScilabDouble([this.a])); this.model.dstate = []; if ((this.type[this.a-1]==1)) { if (isreal(this.a)) { - it = 1; - ot = 1; + var it = 1; + var ot = 1; if ((size(this.a,1)==1||size(this.a,2)==1)) { this.model.sim = list(new ScilabString(["dollar4"]), new ScilabDouble([4])); this.model.dstate = this.a.slice(); this.model.odstate = list(); } } else { - it = 2; - ot = 2; + var it = 2; + var ot = 2; } } else if ((typeof(this.a)=="int32")) { - it = 3; - ot = 3; + var it = 3; + var ot = 3; } else if ((typeof(this.a)=="int16")) { - it = 4; - ot = 4; + var it = 4; + var ot = 4; } else if ((typeof(this.a)=="int8")) { - it = 5; - ot = 5; + var it = 5; + var ot = 5; } else if ((typeof(this.a)=="uint32")) { - it = 6; - ot = 6; + var it = 6; + var ot = 6; } else if ((typeof(this.a)=="uint16")) { - it = 7; - ot = 7; + var it = 7; + var ot = 7; } else if ((typeof(this.a)=="uint8")) { - it = 8; - ot = 8; + var it = 8; + var ot = 8; } else { message("type is not recognized"); - ok = false; + var ok = false; } if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/DOLLAR_m.pickle b/js/Linear/DOLLAR_m.pickle index f1752657..032d6ef5 100644 --- a/js/Linear/DOLLAR_m.pickle +++ b/js/Linear/DOLLAR_m.pickle @@ -61,46 +61,43 @@ p18 sS'model.sim' p19 g2 -sS'[this.model,graphics,ok]' -p20 -g4 sS'in1' -p21 +p20 g4 sS'graphics.exprs' -p22 +p21 NsS'typ' -p23 +p22 g13 sS'ot' -p24 +p23 g4 sS'ok' -p25 +p24 S'boolean' -p26 +p25 sS'model.blocktype' -p27 +p26 g18 sS'model.dep_ut' -p28 +p27 g13 sS'exprs' -p29 +p28 g18 sS'gr_i' -p30 +p29 g13 sS'y' -p31 +p30 g13 sS'x' -p32 +p31 g4 sS'model' -p33 +p32 g6 sS'z' -p34 +p33 g4 s.
\ No newline at end of file diff --git a/js/Linear/GAINBLK.js b/js/Linear/GAINBLK.js index e399edfb..8cd16680 100644 --- a/js/Linear/GAINBLK.js +++ b/js/Linear/GAINBLK.js @@ -2,10 +2,10 @@ function GAINBLK() { GAINBLK.prototype.define = function GAINBLK() { this.gain = 1; - in1 = -1; - out = -1; - in2 = -2; - out2 = -2; + var in1 = -1; + var out = -1; + var in2 = -2; + var out2 = -2; this.model = scicos_model(); this.model.sim = list(new ScilabString(["gainblk"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([in1]); @@ -15,8 +15,8 @@ function GAINBLK() { this.model.rpar = new ScilabDouble([this.gain]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [strcat(sci2exp(this.gain))]; - gr_i = []; + var exprs = [strcat(sci2exp(this.gain))]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,11 +34,11 @@ function GAINBLK() { this.gain = parseFloat(arguments[0]["gain"]) this.over = arguments[0]["over"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,"*")==1) { - exprs = [[exprs],[sci2exp(0)]]; + var exprs = [[exprs],[sci2exp(0)]]; } while (true) { [ok,this.gain,this.over,exprs] = scicos_getvalue("Set gain block parameters",["Gain","Do On Overflow(0=Nothing 1=Saturate 2=Error)"],list("mat",[-1,-1],"vec",1),exprs); @@ -50,98 +50,106 @@ function GAINBLK() { } else { if (typeof(this.gain)=="constant") { if (isreal(this.gain)) { - it = 1; - ot = 1; + var it = 1; + var ot = 1; this.model.sim = list(new ScilabString(["gainblk"]), new ScilabDouble([4])); this.model.rpar = this.gain.slice(); this.model.opar = list(); } else { message("type is not supported"); - ok = false; + var ok = false; } } else { if ((this.over==0)) { if ((typeof(this.gain)=="int32")) { - ot = 3; + var ot = 3; this.model.sim = list(new ScilabString(["gainblk_i32n"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="int16")) { - ot = 4; + var ot = 4; this.model.sim = list(new ScilabString(["gainblk_i16n"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="int8")) { - ot = 5; + var ot = 5; this.model.sim = list(new ScilabString(["gainblk_i8n"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint32")) { - ot = 6; + var ot = 6; this.model.sim = list(new ScilabString(["gainblk_ui32n"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint16")) { - ot = 7; + var ot = 7; this.model.sim = list(new ScilabString(["gainblk_ui16n"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint8")) { - ot = 8; + var ot = 8; this.model.sim = list(new ScilabString(["gainblk_ui8n"]), new ScilabDouble([4])); } else { message("type is not supported."); - ok = false; + var ok = false; } } else if ((this.over==1)) { if ((typeof(this.gain)=="int32")) { - ot = 3; + var ot = 3; this.model.sim = list(new ScilabString(["gainblk_i32s"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="int16")) { - ot = 4; + var ot = 4; this.model.sim = list(new ScilabString(["gainblk_i16s"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="int8")) { - ot = 5; + var ot = 5; this.model.sim = list(new ScilabString(["gainblk_i8s"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint32")) { - ot = 6; + var ot = 6; this.model.sim = list(new ScilabString(["gainblk_ui32s"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint16")) { - ot = 7; + var ot = 7; this.model.sim = list(new ScilabString(["gainblk_ui16s"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint8")) { - ot = 8; + var ot = 8; this.model.sim = list(new ScilabString(["gainblk_ui8s"]), new ScilabDouble([4])); } else { message("type is not supported."); - ok = false; + var ok = false; } } else if ((this.over==2)) { if ((typeof(this.gain)=="int32")) { - ot = 3; + var ot = 3; this.model.sim = list(new ScilabString(["gainblk_i32e"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="int16")) { - ot = 4; + var ot = 4; this.model.sim = list(new ScilabString(["gainblk_i16e"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="int8")) { - ot = 5; + var ot = 5; this.model.sim = list(new ScilabString(["gainblk_i8e"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint32")) { - ot = 6; + var ot = 6; this.model.sim = list(new ScilabString(["gainblk_ui32e"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint16")) { - ot = 7; + var ot = 7; this.model.sim = list(new ScilabString(["gainblk_ui16e"]), new ScilabDouble([4])); } else if ((typeof(this.gain)=="uint8")) { - ot = 8; + var ot = 8; this.model.sim = list(new ScilabString(["gainblk_ui8e"]), new ScilabDouble([4])); } else { message("type is not an integer."); - ok = false; + var ok = false; } } else { message("Do on Overflow must be 0,1,2"); - ok = false; + var ok = false; } this.model.rpar = []; this.model.opar = list(this.gain.slice()); } if (ok) { - [out,in1] = size(this.gain); + var tmpvar0 = size(this.gain) + var out = tmpvar0[0] + var in1 = tmpvar0[1]; if (out*in1!=1) { - [this.model,graphics,ok] = set_io(this.model,graphics,list([in1,-1],ot),list([out,-1],ot),[],[]); + var tmpvar1 = set_io(this.model,graphics,list([in1,-1],ot),list([out,-1],ot),[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; } else { - [this.model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],ot),list([-1,-2],ot),[],[]); + var tmpvar2 = set_io(this.model,graphics,list([-1,-2],ot),list([-1,-2],ot),[],[]) + this.model = tmpvar2[0] + var graphics = tmpvar2[1] + var ok = tmpvar2[2]; } } if (ok) { diff --git a/js/Linear/GAINBLK.pickle b/js/Linear/GAINBLK.pickle index 31b6e852..4d9f0cbf 100644 --- a/js/Linear/GAINBLK.pickle +++ b/js/Linear/GAINBLK.pickle @@ -45,68 +45,62 @@ sS'model.sim' p12 S'list' p13 -sS'[out,in1]' -p14 -g5 -sS'[this.model,graphics,ok]' -p15 -g5 sS'model.out2' -p16 +p14 g5 sS'in1' -p17 +p15 g5 sS'in2' -p18 +p16 g5 sS'model.rpar' -p19 +p17 g5 sS'graphics.exprs' -p20 +p18 S'matrix' -p21 +p19 sS'typ' -p22 +p20 S'vector' -p23 +p21 sS'model.opar' -p24 +p22 g13 sS'out2' -p25 +p23 g5 sS'ok' -p26 +p24 S'boolean' -p27 +p25 sS'model.blocktype' -p28 +p26 S'string' -p29 +p27 sS'model.dep_ut' -p30 -g23 +p28 +g21 sS'exprs' -p31 -g23 +p29 +g21 sS'gr_i' -p32 -g23 +p30 +g21 sS'y' -p33 -g23 +p31 +g21 sS'x' -p34 +p32 g5 sS'model' -p35 +p33 g2 sS'ot' -p36 +p34 g5 sS'gain' -p37 +p35 g5 s.
\ No newline at end of file diff --git a/js/Linear/GAINBLK_f.js b/js/Linear/GAINBLK_f.js index 3c884a91..55cf64ea 100644 --- a/js/Linear/GAINBLK_f.js +++ b/js/Linear/GAINBLK_f.js @@ -2,8 +2,8 @@ function GAINBLK_f() { GAINBLK_f.prototype.define = function GAINBLK_f() { this.gain = 1; - in1 = 1; - out = 1; + var in1 = 1; + var out = 1; this.model = scicos_model(); this.model.sim = new ScilabString(["gain"]); this.model.in1 = new ScilabDouble([in1]); @@ -11,8 +11,8 @@ function GAINBLK_f() { this.model.rpar = new ScilabDouble([this.gain]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [strcat(sci2exp(this.gain))]; - gr_i = []; + var exprs = [strcat(sci2exp(this.gain))]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -28,8 +28,8 @@ function GAINBLK_f() { GAINBLK_f.prototype.set = function GAINBLK_f() { this.gain = parseFloat(arguments[0]["gain"]) 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.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]); @@ -39,8 +39,13 @@ function GAINBLK_f() { if (this.gain==[]) { message("Gain must have at least one element"); } else { - [out,in1] = size(this.gain); - [this.model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); + var tmpvar0 = size(this.gain) + var out = tmpvar0[0] + var in1 = tmpvar0[1]; + var tmpvar1 = check_io(this.model,graphics,in1,out,[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; this.model.rpar = this.gain.slice(); diff --git a/js/Linear/GAINBLK_f.pickle b/js/Linear/GAINBLK_f.pickle index 8a166c85..c9ead743 100644 --- a/js/Linear/GAINBLK_f.pickle +++ b/js/Linear/GAINBLK_f.pickle @@ -11,73 +11,66 @@ p4 atp5 Rp6 .(dp0 -S'arg1' +S'model.sim' p1 -S'object' +S'string' p2 -sS'graphics' +sS'model.in1' p3 -g2 -sS'x.model' +S'double' p4 -NsS'model.out' +sS'model.blocktype' p5 -S'double' +g2 +sS'x.graphics' p6 -sS'out' +S'object' p7 -g6 -sS'model.in1' +sS'model.dep_ut' p8 -g6 -sS'x.graphics' +S'vector' p9 -g2 -sS'model.sim' +sS'arg1' p10 -S'string' +g7 +sS'graphics.exprs' p11 -sS'[out,in1]' +NsS'in1' p12 -g6 -sS'[this.model,graphics,ok]' +g4 +sS'model.rpar' p13 -S'list' +g4 +sS'exprs' p14 -sS'in1' +g9 +sS'x.model' p15 -g6 -sS'model.rpar' +NsS'gr_i' p16 -g6 +g9 sS'gain' p17 -g6 -sS'graphics.exprs' +g4 +sS'graphics' p18 -NsS'typ' +g7 +sS'y' p19 -S'vector' +g9 +sS'x' p20 -sS'model.blocktype' +g4 +sS'model' p21 -g11 -sS'model.dep_ut' +g7 +sS'model.out' p22 -g20 -sS'exprs' +g4 +sS'typ' p23 -g20 -sS'gr_i' +g9 +sS'out' p24 -g20 -sS'y' -p25 -g20 -sS'x' -p26 -g6 -sS'model' -p27 -g2 +g4 s.
\ No newline at end of file diff --git a/js/Linear/GAIN_f.js b/js/Linear/GAIN_f.js index 3ac3a5e9..e987baef 100644 --- a/js/Linear/GAIN_f.js +++ b/js/Linear/GAIN_f.js @@ -2,8 +2,8 @@ function GAIN_f() { GAIN_f.prototype.define = function GAIN_f() { this.gain = 1; - in1 = 1; - out = 1; + var in1 = 1; + var out = 1; this.model = scicos_model(); this.model.sim = new ScilabString(["gain"]); this.model.in1 = new ScilabDouble([1]); @@ -11,8 +11,8 @@ function GAIN_f() { this.model.rpar = new ScilabDouble([this.gain]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[strcat(sci2exp(this.gain))],[strcat(sci2exp(in1))],[strcat(sci2exp(out))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.gain))],[strcat(sci2exp(in1))],[strcat(sci2exp(out))]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -28,8 +28,8 @@ function GAIN_f() { GAIN_f.prototype.set = function GAIN_f() { this.gain = parseFloat(arguments[0]["gain"]) 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.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]); @@ -39,8 +39,13 @@ function GAIN_f() { if (this.gain==[]) { message("Gain must have at least one element"); } else { - [out,in1] = size(this.gain); - [this.model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); + var tmpvar0 = size(this.gain) + var out = tmpvar0[0] + var in1 = tmpvar0[1]; + var tmpvar1 = check_io(this.model,graphics,in1,out,[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; this.model.rpar = this.gain.slice(); diff --git a/js/Linear/GAIN_f.pickle b/js/Linear/GAIN_f.pickle index d35d1dd8..e204ca44 100644 --- a/js/Linear/GAIN_f.pickle +++ b/js/Linear/GAIN_f.pickle @@ -11,74 +11,67 @@ p4 atp5 Rp6 .(dp0 -S'arg1' +S'model.sim' p1 -S'object' +S'string' p2 -sS'graphics' +sS'model.in1' p3 -g2 -sS'x.model' +S'double' p4 -NsS'model.out' +sS'model.blocktype' p5 -S'double' +g2 +sS'x.graphics' p6 -sS'out' +S'object' p7 -g6 -sS'model.in1' +sS'model.dep_ut' p8 -g6 -sS'x.graphics' +S'vector' p9 -g2 -sS'model.sim' +sS'arg1' p10 -S'string' +g7 +sS'graphics.exprs' p11 -sS'[out,in1]' +NsS'in1' p12 -g6 -sS'[this.model,graphics,ok]' +g4 +sS'model.rpar' p13 -S'list' +g4 +sS'exprs' p14 -sS'in1' +S'matrix' p15 -g6 -sS'model.rpar' +sS'x.model' p16 -g6 -sS'gain' +NsS'gr_i' p17 -g6 -sS'graphics.exprs' +g9 +sS'gain' p18 -NsS'typ' +g4 +sS'graphics' p19 -S'vector' +g7 +sS'y' p20 -sS'model.blocktype' +g9 +sS'x' p21 -g11 -sS'model.dep_ut' +g4 +sS'model' p22 -g20 -sS'exprs' +g7 +sS'model.out' p23 -S'matrix' +g4 +sS'typ' p24 -sS'gr_i' +g9 +sS'out' p25 -g20 -sS'y' -p26 -g20 -sS'x' -p27 -g6 -sS'model' -p28 -g2 +g4 s.
\ No newline at end of file diff --git a/js/Linear/INTEGRAL.js b/js/Linear/INTEGRAL.js index 1e07521b..c70354a8 100644 --- a/js/Linear/INTEGRAL.js +++ b/js/Linear/INTEGRAL.js @@ -2,8 +2,8 @@ function INTEGRAL() { INTEGRAL.prototype.define = function INTEGRAL() { this.maxp = 1; - minp = -1; - rpar = []; + var minp = -1; + var rpar = []; this.model = scicos_model(); this.model.state = new ScilabDouble([0]); this.model.sim = list(new ScilabString(["integral_func"]), new ScilabDouble([4])); @@ -12,8 +12,8 @@ function INTEGRAL() { this.model.rpar = rpar; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = string([[0],[0],[0],[this.maxp],[minp]]); - gr_i = []; + var exprs = string([[0],[0],[0],[this.maxp],[minp]]); + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.id = "1/s"; return new BasicBlock(this.x); @@ -38,8 +38,8 @@ function INTEGRAL() { this.maxp = parseFloat(arguments[0]["maxp"]) this.lowp = arguments[0]["lowp"] 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.x0,this.reinit,this.satur,this.maxp,this.lowp,exprs] = scicos_getvalue("Set Integral block parameters",["Initial Condition","With re-intialization (1:yes, 0:no)","With saturation (1:yes, 0:no)","Upper limit","Lower limit"],list("vec",-1,"vec",1,"vec",1,"vec",-1,"vec",-1),exprs); @@ -62,27 +62,30 @@ function INTEGRAL() { } if ((size(this.x0,1)!=size(this.maxp,1)||size(this.x0,1)!=size(this.lowp,1))) { message("x0 and Upper limit and Lower limit must have same size"); - ok = false; + var ok = false; } else if (or(this.maxp<=this.lowp)) { message("Upper limits must be > Lower limits"); - ok = false; + var ok = false; } else if (or(this.x0>this.maxp)||or(this.x0<this.lowp)) { message("Initial condition x0 should be inside the limits"); - ok = false; + var ok = false; } else { - rpar = [[this.maxp],[this.lowp]]; + var rpar = [[this.maxp],[this.lowp]]; this.model.nzcross = new ScilabDouble([size(this.x0,1)]); this.model.nmode = new ScilabDouble([size(this.x0,1)]); } } else { - rpar = []; + var rpar = []; this.model.nzcross = new ScilabDouble([0]); this.model.nmode = new ScilabDouble([0]); } if (ok) { this.model.rpar = rpar; this.model.state = this.x0; - [this.model,graphics,ok] = check_io(this.model,graphics,size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,1),ones(this.reinit,1),[]); + var tmpvar0 = check_io(this.model,graphics,size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,1),ones(this.reinit,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/INTEGRAL.pickle b/js/Linear/INTEGRAL.pickle index c42e86ab..7fadba67 100644 --- a/js/Linear/INTEGRAL.pickle +++ b/js/Linear/INTEGRAL.pickle @@ -55,62 +55,59 @@ sS'model.sim' p14 S'list' p15 -sS'[this.model,graphics,ok]' -p16 -g15 sS'model.nmode' -p17 +p16 g4 sS'model.rpar' -p18 +p17 g6 sS'model.in1' -p19 +p18 g4 sS'satur' -p20 +p19 g4 sS'model.state' -p21 +p20 g4 sS'lowp' -p22 +p21 S'string' -p23 +p22 sS'graphics.exprs' -p24 +p23 NsS'x0' -p25 +p24 g6 sS'model.nzcross' -p26 +p25 g4 sS'x.graphics.id' -p27 -g23 +p26 +g22 sS'ok' -p28 +p27 S'boolean' -p29 +p28 sS'model.blocktype' -p30 -g23 +p29 +g22 sS'model.dep_ut' -p31 +p30 g6 sS'exprs' -p32 -g23 +p31 +g22 sS'gr_i' -p33 +p32 g6 sS'y' -p34 +p33 g6 sS'x' -p35 +p34 g4 sS'model' -p36 +p35 g2 s.
\ No newline at end of file diff --git a/js/Linear/INTEGRAL_f.js b/js/Linear/INTEGRAL_f.js index 8be55672..53ed84e2 100644 --- a/js/Linear/INTEGRAL_f.js +++ b/js/Linear/INTEGRAL_f.js @@ -9,8 +9,8 @@ function INTEGRAL_f() { this.model.state = new ScilabDouble([this.x0]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = strcat(sci2exp(this.x0)); - gr_i = []; + var exprs = strcat(sci2exp(this.x0)); + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -25,8 +25,8 @@ function INTEGRAL_f() { INTEGRAL_f.prototype.set = function INTEGRAL_f() { this.x0 = parseFloat(arguments[0]["x0"]) 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.x0,exprs] = scicos_getvalue("Set continuous linear system parameters","Initial state",list("vec",1),exprs); diff --git a/js/Linear/INTEGRAL_m.js b/js/Linear/INTEGRAL_m.js index 842615a0..667cd9e1 100644 --- a/js/Linear/INTEGRAL_m.js +++ b/js/Linear/INTEGRAL_m.js @@ -2,8 +2,8 @@ function INTEGRAL_m() { INTEGRAL_m.prototype.define = function INTEGRAL_m() { this.maxp = 1; - minp = -1; - rpar = []; + var minp = -1; + var rpar = []; this.model = scicos_model(); this.model.state = new ScilabDouble([0]); this.model.sim = list(new ScilabString(["integral_func"]), new ScilabDouble([4])); @@ -14,8 +14,8 @@ function INTEGRAL_m() { this.model.rpar = rpar; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = string([[0],[0],[0],[this.maxp],[minp]]); - gr_i = []; + var exprs = string([[0],[0],[0],[this.maxp],[minp]]); + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -39,8 +39,8 @@ function INTEGRAL_m() { this.maxp = parseFloat(arguments[0]["maxp"]) this.lowp = parseFloat(arguments[0]["lowp"]) 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.x0,this.reinit,this.satur,this.maxp,this.lowp,exprs] = scicos_getvalue("Set Integral block parameters",["Initial Condition","With re-intialization (1:yes, 0:no)","With saturation (1:yes, 0:no)","Upper limit","Lower limit"],list("mat",[-1,-1],"vec",1,"vec",1,"mat",[-1,-1],"mat",[-1,-1]),exprs); @@ -48,9 +48,9 @@ function INTEGRAL_m() { break; } if (isreal(this.x0)) { - Datatype = 1; + var Datatype = 1; } else { - Datatype = 2; + var Datatype = 2; } if (this.reinit!=0) { this.reinit = 1; @@ -66,15 +66,15 @@ function INTEGRAL_m() { } if ((size(this.x0)!=size(this.maxp)||size(this.x0)!=size(this.lowp))) { message("x0 and Upper limit and Lower limit must have same size"); - ok = false; + var ok = false; } else if (or(this.maxp<=this.lowp)) { message("Upper limits must be > Lower limits"); - ok = false; + var ok = false; } else if (or(this.x0>this.maxp)||or(this.x0<this.lowp)) { message("Initial condition x0 should be inside the limits"); - ok = false; + var ok = false; } else { - rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())]]; + var rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())]]; this.model.nzcross = new ScilabDouble([size(this.x0,"*")]); this.model.nmode = new ScilabDouble([size(this.x0,"*")]); } @@ -87,21 +87,21 @@ function INTEGRAL_m() { } if ((size(this.x0)!=size(this.maxp)||size(this.x0)!=size(this.lowp))) { message("x0 and Upper limit and Lower limit must have same size"); - ok = false; + var ok = false; } else if (or(real(this.maxp)<=real(this.lowp))||or(imag(this.maxp)<=imag(this.lowp))) { message("Upper limits must be > Lower limits"); - ok = false; + var ok = false; } else if (or(real(this.x0)>real(this.maxp))||or(real(this.x0)<real(this.lowp))||or(imag(this.x0)>imag(this.maxp))||or(imag(this.x0)<imag(this.lowp))) { message("Initial condition x0 should be inside the limits"); - ok = false; + var ok = false; } else { - rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())],[imag(this.maxp.slice())],[imag(this.lowp.slice())]]; + var rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())],[imag(this.maxp.slice())],[imag(this.lowp.slice())]]; this.model.nzcross = new ScilabDouble([2*size(this.x0,"*")]); this.model.nmode = new ScilabDouble([2*size(this.x0,"*")]); } } } else { - rpar = []; + var rpar = []; this.model.nzcross = new ScilabDouble([0]); this.model.nmode = new ScilabDouble([0]); } @@ -110,21 +110,24 @@ function INTEGRAL_m() { if ((Datatype==1)) { this.model.state = new ScilabDouble([real(this.x0.slice())]); this.model.sim = list(new ScilabString(["integral_func"]), new ScilabDouble([4])); - it = [[1],[ones(this.reinit,1)]]; - ot = 1; + var it = [[1],[ones(this.reinit,1)]]; + var ot = 1; } else if ((Datatype==2)) { this.model.state = new ScilabDouble([real(this.x0.slice())],[imag(this.x0.slice())]); this.model.sim = list(new ScilabString(["integralz_func"]), new ScilabDouble([4])); - it = [[2],[2*ones(this.reinit,1)]]; - ot = 2; + var it = [[2],[2*ones(this.reinit,1)]]; + var ot = 2; } else { message("Datatype is not supported"); - ok = false; + var ok = false; } if (ok) { - in1 = [size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,2)*[[1],[ones(this.reinit,1)]]]; - out = size(this.x0); - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.reinit,1),[]); + var in1 = [size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,2)*[[1],[ones(this.reinit,1)]]]; + var out = size(this.x0); + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.reinit,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } } if (ok) { diff --git a/js/Linear/INTEGRAL_m.pickle b/js/Linear/INTEGRAL_m.pickle index 76a2f5ed..7538823d 100644 --- a/js/Linear/INTEGRAL_m.pickle +++ b/js/Linear/INTEGRAL_m.pickle @@ -68,65 +68,62 @@ p19 sS'Datatype' p20 g4 -sS'[this.model,graphics,ok]' -p21 -g4 sS'model.out2' -p22 +p21 g4 sS'in1' -p23 +p22 g8 sS'model.rpar' -p24 +p23 g8 sS'model.nmode' -p25 +p24 g4 sS'satur' -p26 +p25 g4 sS'model.state' -p27 +p26 g4 sS'lowp' -p28 +p27 g4 sS'graphics' -p29 +p28 g2 sS'model.nzcross' -p30 +p29 g4 sS'ok' -p31 +p30 S'boolean' -p32 +p31 sS'model.blocktype' -p33 +p32 S'string' -p34 +p33 sS'model.dep_ut' -p35 +p34 g8 sS'exprs' -p36 -g34 +p35 +g33 sS'gr_i' -p37 +p36 g8 sS'graphics.exprs' -p38 +p37 NsS'y' -p39 +p38 g8 sS'x' -p40 +p39 g4 sS'model' -p41 +p40 g2 sS'ot' -p42 +p41 g4 s.
\ No newline at end of file diff --git a/js/Linear/PID.js b/js/Linear/PID.js index a004f67b..320f1396 100644 --- a/js/Linear/PID.js +++ b/js/Linear/PID.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Linear/PID.sci" */ function PID() { PID.prototype.define = function PID() { - scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["PID"],tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["PID"],tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m.objs[1-1] = scicos_block(gui="INTEGRAL_m",graphics=scicos_graphics(orig=[318.304,183.11733],sz=[40,40],flip=true,theta=0,exprs=[["0"],["0"],["0"],["1"],["-1"]],pin=7,pout=9,pein=[],peout=[],gr_i=[],id="1/s",in_implicit="E",out_implicit="E"),model=scicos_model(sim=list("integral_func",4),in1=1,in2=1,intyp=1,out=1,out2=1,outtyp=1,evtin=[],evtout=[],state=0,dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="c",firing=[],dep_ut=[false,true],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[2-1] = scicos_block(gui="SUMMATION",graphics=scicos_graphics(orig=[387.97067,172.85067],sz=[40,60],flip=true,theta=0,exprs=[["1"],["[1;1;1]"]],pin=[[10],[9],[11]],pout=19,pein=[],peout=[],gr_i=[],id="",in_implicit=[["E"],["E"],["E"]],out_implicit="E"),model=scicos_model(sim=list("summation",4),in1=[[-1],[-1],[-1]],in2=[[-2],[-2],[-2]],intyp=[[1],[1],[1]],out=-1,out2=-2,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[[1],[1],[1]],opar=list(),blocktype="c",firing=[],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[3-1] = scicos_block(gui="GAINBLK",graphics=scicos_graphics(orig=[321.23733,235.91733],sz=[40,40],flip=true,theta=0,exprs="1",pin=17,pout=10,pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit="E"),model=scicos_model(sim=list("gainblk",4),in1=-1,in2=-2,intyp=1,out=-1,out2=-2,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=1,ipar=[],opar=list(),blocktype="c",firing=[],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); @@ -35,7 +35,7 @@ function PID() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = [false,false]; this.model.rpar = new ScilabDouble([scs_m]); - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } @@ -55,12 +55,12 @@ function PID() { this.i = arguments[0]["i"] this.d = arguments[0]["d"] this.exprs0 = arguments[0]["exprs0"] - ppath = list(0,0,0); + var ppath = list(0,0,0); for (i=1;i<=length(arg1.model.rpar.objs);i+=1) { - o = arg1.model.rpar.objs[this.i-1]; + var o = arg1.model.rpar.objs[this.i-1]; if (typeof(o)=="Link") { - from = arg1.model.rpar.objs[o.from[1-1]-1]; - to = arg1.model.rpar.objs[o.to[1-1]-1]; + var from = arg1.model.rpar.objs[o.from[1-1]-1]; + var to = arg1.model.rpar.objs[o.to[1-1]-1]; if (from.gui=="GAINBLK") { switch (to.gui) { case "SUMMATION": @@ -85,17 +85,17 @@ function PID() { } } } - newpar = list(); - xx1 = arg1.model.rpar.objs[ppath[1-1]-1]; + var newpar = list(); + var xx1 = arg1.model.rpar.objs[ppath[1-1]-1]; exprs[1-1] = xx1.graphics.exprs[1-1]; - p_old = xx1.model.rpar; - xx2 = arg1.model.rpar.objs[ppath[2-1]-1]; + var p_old = xx1.model.rpar; + var xx2 = arg1.model.rpar.objs[ppath[2-1]-1]; exprs[2-1] = xx2.graphics.exprs[1-1]; - i_old = xx2.model.rpar; - xx3 = arg1.model.rpar.objs[ppath[3-1]-1]; + var i_old = xx2.model.rpar; + var xx3 = arg1.model.rpar.objs[ppath[3-1]-1]; exprs[3-1] = xx3.graphics.exprs[1-1]; - d_old = xx3.model.rpar; - y = 0; + var d_old = xx3.model.rpar; + var y = 0; while (true) { [ok,this.p,this.i,this.d,this.exprs0] = scicos_getvalue("Set PID parameters",["Proportional","Integral","Derivation"],list("vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { @@ -114,16 +114,16 @@ function PID() { break; } } - needcompile = 0; + var needcompile = 0; if (!(p_old==this.p&&i_old==this.i&&d_old==this.d)) { newpar[size(newpar)+1-1] = ppath[1-1]; newpar[size(newpar)+1-1] = ppath[2-1]; newpar[size(newpar)+1-1] = ppath[3-1]; - needcompile = 2; + var needcompile = 2; } this.x = arg1; - y = max(y,needcompile); - typ = newpar; + var y = max(y,needcompile); + var typ = newpar; return new BasicBlock(this.x); } } diff --git a/js/Linear/REGISTER.js b/js/Linear/REGISTER.js index 34036efe..5e86e2ce 100644 --- a/js/Linear/REGISTER.js +++ b/js/Linear/REGISTER.js @@ -10,8 +10,8 @@ function REGISTER() { this.model.dstate = new ScilabDouble([this.z0]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = strcat(string(this.z0),";"); - gr_i = []; + var exprs = strcat(string(this.z0),";"); + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -29,11 +29,11 @@ function REGISTER() { this.z0 = parseFloat(arguments[0]["z0"]) this.it = arguments[0]["it"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,1)==1) { - exprs = [[exprs],[sci2exp(1)]]; + var exprs = [[exprs],[sci2exp(1)]]; } while (true) { [ok,this.z0,this.it,exprs] = scicos_getvalue("Set delay parameters",["Register initial condition","Datatype (1=double 3=int32 ...)"],list("vec",-1,"vec",1),exprs); @@ -42,7 +42,7 @@ function REGISTER() { } if (prod(size(this.z0))<1) { message("Register length must be at least 1"); - ok = false; + var ok = false; } if (this.it==1) { this.model.sim = list(new ScilabString(["delay4"]), new ScilabDouble([4])); @@ -70,14 +70,17 @@ function REGISTER() { this.z0 = uint8(this.z0); } else { message("Datatype is not supported"); - ok = false; + var ok = false; } this.model.odstate = list(new ScilabDouble([this.z0])); this.model.dstate = []; } if (ok) { - in1 = [1,1]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]); + var in1 = [1,1]; + var tmpvar0 = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/REGISTER.pickle b/js/Linear/REGISTER.pickle index 8ca0dc7f..7d82ed1e 100644 --- a/js/Linear/REGISTER.pickle +++ b/js/Linear/REGISTER.pickle @@ -49,43 +49,40 @@ g4 sS'model.sim' p15 g2 -sS'[this.model,graphics,ok]' -p16 -g4 sS'in1' -p17 +p16 g13 sS'graphics.exprs' -p18 +p17 S'matrix' -p19 +p18 sS'z0' -p20 +p19 g4 sS'ok' -p21 +p20 S'boolean' -p22 +p21 sS'model.blocktype' -p23 +p22 S'string' -p24 +p23 sS'model.dep_ut' -p25 +p24 g13 sS'exprs' -p26 +p25 g4 sS'gr_i' -p27 +p26 g13 sS'y' -p28 +p27 g13 sS'x' -p29 +p28 g4 sS'model' -p30 +p29 g6 s.
\ No newline at end of file diff --git a/js/Linear/REGISTER_f.js b/js/Linear/REGISTER_f.js index 87ea4883..f61de699 100644 --- a/js/Linear/REGISTER_f.js +++ b/js/Linear/REGISTER_f.js @@ -10,8 +10,8 @@ function REGISTER_f() { this.model.dstate = new ScilabDouble([this.z0]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = strcat(string(this.z0),";"); - gr_i = []; + var exprs = strcat(string(this.z0),";"); + var gr_i = []; this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -26,8 +26,8 @@ function REGISTER_f() { REGISTER_f.prototype.set = function REGISTER_f() { this.z0 = parseFloat(arguments[0]["z0"]) 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.z0,exprs] = scicos_getvalue("Set delay parameters","Register initial condition",list("vec",-1),exprs); @@ -36,7 +36,7 @@ function REGISTER_f() { } if (prod(size(this.z0))<1) { message("Register length must be at least 1"); - ok = false; + var ok = false; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/SAMPHOLD.js b/js/Linear/SAMPHOLD.js index f2aff8d1..a3849f9a 100644 --- a/js/Linear/SAMPHOLD.js +++ b/js/Linear/SAMPHOLD.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Linear/SAMPHOLD.sci" */ function SAMPHOLD() { SAMPHOLD.prototype.define = function SAMPHOLD() { - in1 = -1; + var in1 = -1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["samphold4"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([-1]); @@ -9,7 +9,7 @@ function SAMPHOLD() { this.model.evtin = new ScilabDouble([1]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [true,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model," ",gr_i); return new BasicBlock(this.x); } diff --git a/js/Linear/SAMPHOLD_m.js b/js/Linear/SAMPHOLD_m.js index b9ee78b1..8d4d93a5 100644 --- a/js/Linear/SAMPHOLD_m.js +++ b/js/Linear/SAMPHOLD_m.js @@ -12,8 +12,8 @@ function SAMPHOLD_m() { this.model.evtin = new ScilabDouble([1]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [true,false]; - label = [sci2exp(1)]; - gr_i = []; + var label = [sci2exp(1)]; + var gr_i = []; this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -30,8 +30,8 @@ function SAMPHOLD_m() { this.it = arguments[0]["it"] this.x = arg1; this.x.model.firing = []; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.it,exprs] = scicos_getvalue("Set parameters Block",["Datatype(1=real double 2=Complex 3=int32 ...)"],list("vec",1),label); @@ -40,11 +40,14 @@ function SAMPHOLD_m() { } if (((this.it<1)||(this.it>8))) { message("Datatype is not supported"); - ok = false; + var ok = false; } if (ok) { - in1 = [this.model.in1,this.model.in2]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]); + var in1 = [this.model.in1,this.model.in2]; + var tmpvar0 = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (ok) { graphics.exprs = exprs; arg1.graphics = graphics; diff --git a/js/Linear/SAMPHOLD_m.pickle b/js/Linear/SAMPHOLD_m.pickle index 23b819b3..c7f11ba6 100644 --- a/js/Linear/SAMPHOLD_m.pickle +++ b/js/Linear/SAMPHOLD_m.pickle @@ -45,50 +45,47 @@ p13 sS'arg1.graphics' p14 g2 -sS'[this.model,graphics,ok]' -p15 -g5 sS'model.out2' -p16 +p15 g5 sS'in1' -p17 +p16 g9 sS'model.in1' -p18 +p17 g5 sS'model.outtyp' -p19 +p18 g5 sS'graphics.exprs' -p20 +p19 NsS'typ' -p21 +p20 g9 sS'arg1.model' -p22 +p21 g2 sS'ok' -p23 +p22 S'boolean' -p24 +p23 sS'model.blocktype' -p25 +p24 S'string' -p26 +p25 sS'model.dep_ut' -p27 +p26 g9 sS'gr_i' -p28 +p27 g9 sS'y' -p29 +p28 g9 sS'x' -p30 +p29 g5 sS'model' -p31 +p30 g2 s.
\ No newline at end of file diff --git a/js/Linear/SAMPLEHOLD_f.js b/js/Linear/SAMPLEHOLD_f.js index 35768a23..7421d96e 100644 --- a/js/Linear/SAMPLEHOLD_f.js +++ b/js/Linear/SAMPLEHOLD_f.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Linear/SAMPLEHOLD_f.sci" */ function SAMPLEHOLD_f() { SAMPLEHOLD_f.prototype.define = function SAMPLEHOLD_f() { - in1 = -1; + var in1 = -1; this.model = scicos_model(); this.model.sim = new ScilabString(["samphold"]); this.model.in1 = new ScilabDouble([-1]); @@ -9,7 +9,7 @@ function SAMPLEHOLD_f() { this.model.evtin = new ScilabDouble([1]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [true,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model," ",gr_i); return new BasicBlock(this.x); } diff --git a/js/Linear/SOM_f.js b/js/Linear/SOM_f.js index ec087b3c..40e4c2ff 100644 --- a/js/Linear/SOM_f.js +++ b/js/Linear/SOM_f.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Linear/SOM_f.sci" */ function SOM_f() { SOM_f.prototype.define = function SOM_f() { - sgn = [[1],[1],[1]]; + var sgn = [[1],[1],[1]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["sum"]), new ScilabDouble([2])); this.model.in1 = new ScilabDouble([-1],[-1],[-1]); @@ -9,8 +9,8 @@ function SOM_f() { this.model.rpar = new ScilabDouble(sgn); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(1)],[sci2exp(sgn)]]; - gr_i = []; + var exprs = [[sci2exp(1)],[sci2exp(sgn)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -24,22 +24,22 @@ function SOM_f() { } SOM_f.prototype.set = function SOM_f() { 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[2-1]; + var exprs = exprs[2-1]; } if (size(exprs,"*")!=3) { - exprs = string(this.model.rpar); + var exprs = string(this.model.rpar); } if (graphics.flip) { - labs = ["down","left","up"]; + var labs = ["down","left","up"]; } else { - labs = ["down","right","up"]; + var labs = ["down","right","up"]; } - str = [["This sum block is obsolete","parameters cannot be modified. Please replace it with new sum block"],["and gain blocks in the linear palette"," ","Input ports are located at up, side and down positions.","Current gains are:"]]; - str = [[str],[(part(labs.slice(),1,7)+exprs.slice())]]; + var str = [["This sum block is obsolete","parameters cannot be modified. Please replace it with new sum block"],["and gain blocks in the linear palette"," ","Input ports are located at up, side and down positions.","Current gains are:"]]; + var str = [[str],[(part(labs.slice(),1,7)+exprs.slice())]]; message(str); return new BasicBlock(this.x); } diff --git a/js/Linear/SUMMATION.js b/js/Linear/SUMMATION.js index a56677db..d70f6699 100644 --- a/js/Linear/SUMMATION.js +++ b/js/Linear/SUMMATION.js @@ -11,8 +11,8 @@ function SUMMATION() { this.model.ipar = new ScilabDouble(this.sgn); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = sci2exp(this.sgn); - gr_i = []; + var exprs = sci2exp(this.sgn); + var gr_i = []; this.x = standard_define([2,3],this.model,exprs,gr_i); return new Summation(this.x); } @@ -32,13 +32,13 @@ function SUMMATION() { this.sgn = inverse(arguments[0]["sgn"]) this.satur = arguments[0]["satur"] this.x = arg1; - graphics = arg1.graphics; + var graphics = arg1.graphics; this.model = arg1.model; - exprs = graphics.exprs; + var exprs = graphics.exprs; if (size(exprs,1)==1) { - exprs = [[sci2exp(1)],[exprs],[sci2exp(0)]]; + var exprs = [[sci2exp(1)],[exprs],[sci2exp(0)]]; } else if (size(exprs,1)==2) { - exprs = [[exprs],[sci2exp(0)]]; + var exprs = [[exprs],[sci2exp(0)]]; } while (true) { [ok,this.Datatype,this.sgn,this.satur,exprs] = scicos_getvalue("Set sum block parameters",["Datatype (1=real double 2=complex 3=int32 ...)","Number of inputs or sign vector (of +1, -1)","Do on Overflow(0=Nothing 1=Saturate 2=Error)"],list("vec",1,"vec",-1,"vec",1),exprs); @@ -48,45 +48,45 @@ function SUMMATION() { this.sgn = this.sgn.slice(); if ((this.satur!=0&&this.satur!=1&&this.satur!=2)) { message("Do on overflow must be 0,1,2"); - ok = false; + var ok = false; } if (size(this.sgn,1)==1) { if (this.sgn<1) { message("Number of inputs must be > 0"); - ok = false; + var ok = false; } else if (this.sgn==1) { - in1 = -1; - in2 = -2; + var in1 = -1; + var in2 = -2; this.sgn = []; - nout = 1; - nout2 = 1; + var nout = 1; + var nout2 = 1; } else { - in1 = -ones(this.sgn,1); - in2 = 2*in1; + var in1 = -ones(this.sgn,1); + var in2 = 2*in1; this.sgn = ones(this.sgn,1); - nout = -1; - nout2 = -2; + var nout = -1; + var nout2 = -2; } } else { if (!and(abs(this.sgn)==1)) { message("Signs can only be +1 or -1"); - ok = false; + var ok = false; } else { - in1 = -ones(size(this.sgn,1),1); - in2 = 2*in1; - nout = -1; - nout2 = -2; + var in1 = -ones(size(this.sgn,1),1); + var in2 = 2*in1; + var nout = -1; + var nout2 = -2; } } - it = this.Datatype*ones(1,size(in1,1)); - ot = this.Datatype; + var it = this.Datatype*ones(1,size(in1,1)); + var ot = this.Datatype; if (this.Datatype==1) { this.model.sim = list(new ScilabString(["summation"]), new ScilabDouble([4])); } else if (this.Datatype==2) { this.model.sim = list(new ScilabString(["summation_z"]), new ScilabDouble([4])); } else if (((this.Datatype<1)||(this.Datatype>8))) { message("Datatype is not supported"); - ok = false; + var ok = false; } else { if (this.satur==0) { if (this.Datatype==3) { @@ -133,7 +133,10 @@ function SUMMATION() { } } if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],it),list([nout,nout2],ot),[],[]); + var tmpvar0 = set_io(this.model,graphics,list([in1,in2],it),list([nout,nout2],ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { this.model.rpar = new ScilabDouble([this.satur]); diff --git a/js/Linear/SUMMATION.pickle b/js/Linear/SUMMATION.pickle index 6a1a82b2..9645ce38 100644 --- a/js/Linear/SUMMATION.pickle +++ b/js/Linear/SUMMATION.pickle @@ -49,61 +49,58 @@ sS'model.sim' p14 S'list' p15 -sS'[this.model,graphics,ok]' -p16 -g10 sS'model.out2' -p17 +p16 g10 sS'in1' -p18 +p17 g10 sS'in2' -p19 +p18 g10 sS'model.rpar' -p20 +p19 NsS'graphics.exprs' -p21 +p20 g8 sS'nout2' -p22 +p21 g10 sS'model.ipar' -p23 +p22 g8 sS'typ' -p24 +p23 S'vector' -p25 +p24 sS'ok' -p26 +p25 S'boolean' -p27 +p26 sS'model.blocktype' -p28 +p27 g5 sS'model.dep_ut' -p29 -g25 +p28 +g24 sS'exprs' -p30 +p29 g5 sS'gr_i' -p31 -g25 +p30 +g24 sS'y' -p32 -g25 +p31 +g24 sS'x' -p33 +p32 g10 sS'model' -p34 +p33 g2 sS'ot' -p35 +p34 NsS'nout' -p36 +p35 g10 s.
\ No newline at end of file diff --git a/js/Linear/SUM_f.js b/js/Linear/SUM_f.js index 5557a31a..59abbc82 100644 --- a/js/Linear/SUM_f.js +++ b/js/Linear/SUM_f.js @@ -7,8 +7,8 @@ function SUM_f() { this.model.out = new ScilabDouble([-1]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - gr_i = []; - exprs = []; + var gr_i = []; + var exprs = []; this.x = standard_define([1,1],this.model,exprs,gr_i); return new BasicBlock(this.x); } diff --git a/js/Linear/TCLSS.js b/js/Linear/TCLSS.js index 50067410..51b90c89 100644 --- a/js/Linear/TCLSS.js +++ b/js/Linear/TCLSS.js @@ -6,9 +6,9 @@ function TCLSS() { this.B = 1; this.C = 1; this.D = 0; - in1 = 1; - nx = size(this.x0,"*"); - out = 1; + var in1 = 1; + var nx = size(this.x0,"*"); + var out = 1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["tcslti4"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([in1],[nx]); @@ -18,8 +18,8 @@ function TCLSS() { this.model.rpar = new ScilabDouble([this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -43,38 +43,43 @@ function TCLSS() { this.D = parseFloat(arguments[0]["D"]) this.x0 = parseFloat(arguments[0]["x0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,"*")==7) { - exprs = exprs[[1:4,7]-1]; + var exprs = exprs[[1:4,7]-1]; } while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { break; } - out = size(this.C,1); + var out = size(this.C,1); if (out==0) { - out = []; + var out = []; } - in1 = size(this.B,2); + var in1 = size(this.B,2); if (in1==0) { - in1 = []; + var in1 = []; } - [ms,ns] = size(this.A); + var tmpvar0 = size(this.A) + var ms = tmpvar0[0] + var ns = tmpvar0[1]; if (ms!=ns) { message("A matrix must be square"); } else { - [this.model,graphics,ok] = check_io(this.model,graphics,[[in1],[ms]],out,1,[]); + var tmpvar1 = check_io(this.model,graphics,[[in1],[ms]],out,1,[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; - rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; if (this.D!=[]) { if (norm(this.D,1)!=0) { - mmm = [true,true]; + var mmm = [true,true]; } else { - mmm = [false,true]; + var mmm = [false,true]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/TCLSS.pickle b/js/Linear/TCLSS.pickle index 64147209..24d42f9f 100644 --- a/js/Linear/TCLSS.pickle +++ b/js/Linear/TCLSS.pickle @@ -33,89 +33,83 @@ p5 sS'x.model' p6 g2 -sS'model.dep_ut' -p7 -S'vector' -p8 sS'model.out' -p9 +p7 S'double' -p10 +p8 sS'out' -p11 -g10 +p9 +g8 sS'model.in1' -p12 +p10 g5 sS'x.graphics' -p13 +p11 g2 sS'nx' -p14 -g10 +p12 +g8 sS'model.evtin' -p15 -g10 +p13 +g8 sS'A' -p16 -g10 +p14 +g8 sS'model.sim' -p17 +p15 S'list' -p18 +p16 sS'C' -p19 -g10 +p17 +g8 sS'B' -p20 -g10 +p18 +g8 sS'D' -p21 -g10 -sS'[this.model,graphics,ok]' -p22 -g18 +p19 +g8 sS'in1' -p23 -g10 +p20 +g8 sS'model.rpar' -p24 +p21 g5 sS'mmm' +p22 +S'vector' +p23 +sS'model.state' +p24 +g8 +sS'graphics.exprs' p25 g8 -sS'model.state' +sS'x0' p26 -g10 -sS'graphics.exprs' +g8 +sS'typ' p27 -g10 -sS'x0' +g23 +sS'model.blocktype' p28 -g10 -sS'typ' +S'string' p29 -g8 -sS'model.blocktype' +sS'model.dep_ut' p30 -S'string' -p31 -sS'[ms,ns]' -p32 -g10 +g23 sS'exprs' -p33 +p31 g5 sS'gr_i' -p34 -g8 +p32 +g23 sS'y' -p35 -g8 +p33 +g23 sS'x' -p36 -g10 +p34 +g8 sS'model' -p37 +p35 g2 s.
\ No newline at end of file diff --git a/js/Linear/TCLSS_f.js b/js/Linear/TCLSS_f.js index 5fd45bac..33f82aa0 100644 --- a/js/Linear/TCLSS_f.js +++ b/js/Linear/TCLSS_f.js @@ -6,9 +6,9 @@ function TCLSS_f() { this.B = 1; this.C = 1; this.D = 0; - in1 = 1; - nx = size(this.x0,"*"); - out = 1; + var in1 = 1; + var nx = size(this.x0,"*"); + var out = 1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["tcslti"]), new ScilabDouble([1])); this.model.in1 = new ScilabDouble([in1],[nx]); @@ -18,8 +18,8 @@ function TCLSS_f() { this.model.rpar = new ScilabDouble([this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -43,38 +43,43 @@ function TCLSS_f() { this.D = parseFloat(arguments[0]["D"]) this.x0 = parseFloat(arguments[0]["x0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,"*")==7) { - exprs = exprs[[1:4,7]-1]; + var exprs = exprs[[1:4,7]-1]; } while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { break; } - out = size(this.C,1); + var out = size(this.C,1); if (out==0) { - out = []; + var out = []; } - in1 = size(this.B,2); + var in1 = size(this.B,2); if (in1==0) { - in1 = []; + var in1 = []; } - [ms,ns] = size(this.A); + var tmpvar0 = size(this.A) + var ms = tmpvar0[0] + var ns = tmpvar0[1]; if (ms!=ns) { message("A matrix must be square"); } else { - [this.model,graphics,ok] = check_io(this.model,graphics,[[in1],[ms]],out,1,[]); + var tmpvar1 = check_io(this.model,graphics,[[in1],[ms]],out,1,[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { graphics.exprs = exprs; - rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; if (this.D!=[]) { if (norm(this.D,1)!=0) { - mmm = [true,true]; + var mmm = [true,true]; } else { - mmm = [false,true]; + var mmm = [false,true]; } if (or(this.model.dep_ut!=mmm)) { this.model.dep_ut = mmm; diff --git a/js/Linear/TCLSS_f.pickle b/js/Linear/TCLSS_f.pickle index 64147209..24d42f9f 100644 --- a/js/Linear/TCLSS_f.pickle +++ b/js/Linear/TCLSS_f.pickle @@ -33,89 +33,83 @@ p5 sS'x.model' p6 g2 -sS'model.dep_ut' -p7 -S'vector' -p8 sS'model.out' -p9 +p7 S'double' -p10 +p8 sS'out' -p11 -g10 +p9 +g8 sS'model.in1' -p12 +p10 g5 sS'x.graphics' -p13 +p11 g2 sS'nx' -p14 -g10 +p12 +g8 sS'model.evtin' -p15 -g10 +p13 +g8 sS'A' -p16 -g10 +p14 +g8 sS'model.sim' -p17 +p15 S'list' -p18 +p16 sS'C' -p19 -g10 +p17 +g8 sS'B' -p20 -g10 +p18 +g8 sS'D' -p21 -g10 -sS'[this.model,graphics,ok]' -p22 -g18 +p19 +g8 sS'in1' -p23 -g10 +p20 +g8 sS'model.rpar' -p24 +p21 g5 sS'mmm' +p22 +S'vector' +p23 +sS'model.state' +p24 +g8 +sS'graphics.exprs' p25 g8 -sS'model.state' +sS'x0' p26 -g10 -sS'graphics.exprs' +g8 +sS'typ' p27 -g10 -sS'x0' +g23 +sS'model.blocktype' p28 -g10 -sS'typ' +S'string' p29 -g8 -sS'model.blocktype' +sS'model.dep_ut' p30 -S'string' -p31 -sS'[ms,ns]' -p32 -g10 +g23 sS'exprs' -p33 +p31 g5 sS'gr_i' -p34 -g8 +p32 +g23 sS'y' -p35 -g8 +p33 +g23 sS'x' -p36 -g10 +p34 +g8 sS'model' -p37 +p35 g2 s.
\ No newline at end of file diff --git a/js/Linear/TIME_DELAY.js b/js/Linear/TIME_DELAY.js index 466e3ee5..d02b26f5 100644 --- a/js/Linear/TIME_DELAY.js +++ b/js/Linear/TIME_DELAY.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Linear/TIME_DELAY.sci" */ function TIME_DELAY() { TIME_DELAY.prototype.define = function TIME_DELAY() { - nin = 1; + var nin = 1; this.T = 1; this.init = 0; this.N = 1024; @@ -13,8 +13,8 @@ function TIME_DELAY() { this.model.ipar = new ScilabDouble([this.N]); this.model.blocktype = new ScilabString(["x"]); this.model.dep_ut = [false,true]; - exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; - gr_i = []; + var exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; + var gr_i = []; this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,10 +34,10 @@ function TIME_DELAY() { this.init = parseFloat(arguments[0]["init"]) 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; - nin = this.model.in1[1-1]; + var nin = this.model.in1[1-1]; while (true) { [ok,this.T,this.init,this.N,exprs] = scicos_getvalue("Set delay parameters",["Delay","initial input","Buffer size"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -45,14 +45,17 @@ function TIME_DELAY() { } if (this.N<2) { message("Buffer must be larger than 2"); - ok = false; + var ok = false; } if (this.T<=0) { message("Delay must be positive"); - ok = false; + var ok = false; } if (ok) { - [this.model,graphics,ok] = check_io(this.model,graphics,[-1],-1,[],[]); + var tmpvar0 = check_io(this.model,graphics,[-1],-1,[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/TIME_DELAY.pickle b/js/Linear/TIME_DELAY.pickle index 79702cf9..b4c2bf5b 100644 --- a/js/Linear/TIME_DELAY.pickle +++ b/js/Linear/TIME_DELAY.pickle @@ -46,51 +46,48 @@ p12 sS'nin' p13 g6 -sS'[this.model,graphics,ok]' -p14 -g12 sS'model.rpar' -p15 +p14 g8 sS'N' -p16 +p15 g6 sS'T' -p17 +p16 g6 sS'graphics.exprs' -p18 +p17 NsS'model.ipar' -p19 +p18 g6 sS'typ' -p20 +p19 g8 sS'ok' -p21 +p20 S'boolean' -p22 +p21 sS'model.blocktype' -p23 +p22 S'string' -p24 +p23 sS'model.dep_ut' -p25 +p24 g8 sS'exprs' -p26 +p25 S'matrix' -p27 +p26 sS'gr_i' -p28 +p27 g8 sS'y' -p29 +p28 g8 sS'x' -p30 +p29 g6 sS'model' -p31 +p30 g2 s.
\ No newline at end of file diff --git a/js/Linear/VARIABLE_DELAY.js b/js/Linear/VARIABLE_DELAY.js index 575eafc3..3be1a51b 100644 --- a/js/Linear/VARIABLE_DELAY.js +++ b/js/Linear/VARIABLE_DELAY.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Linear/VARIABLE_DELAY.sci" */ function VARIABLE_DELAY() { VARIABLE_DELAY.prototype.define = function VARIABLE_DELAY() { - nin = 1; + var nin = 1; this.T = 1; this.init = 0; this.N = 1024; @@ -13,8 +13,8 @@ function VARIABLE_DELAY() { this.model.ipar = new ScilabDouble([this.N]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; - gr_i = []; + var exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,10 +34,10 @@ function VARIABLE_DELAY() { this.init = parseFloat(arguments[0]["init"]) 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; - nin = this.model.in1[1-1]; + var nin = this.model.in1[1-1]; while (true) { [ok,this.T,this.init,this.N,exprs] = scicos_getvalue("Set delay parameters",["Max delay","initial input","Buffer size"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -45,14 +45,17 @@ function VARIABLE_DELAY() { } if (this.N<2) { message("Buffer must be larger than 2"); - ok = false; + var ok = false; } if (this.T<=0) { message("Delay must be positive"); - ok = false; + var ok = false; } if (ok) { - [this.model,graphics,ok] = check_io(this.model,graphics,[[-1],[1]],-1,[],[]); + var tmpvar0 = check_io(this.model,graphics,[[-1],[1]],-1,[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/Linear/VARIABLE_DELAY.pickle b/js/Linear/VARIABLE_DELAY.pickle index a46b1460..7f7ec489 100644 --- a/js/Linear/VARIABLE_DELAY.pickle +++ b/js/Linear/VARIABLE_DELAY.pickle @@ -46,51 +46,48 @@ p12 sS'nin' p13 g6 -sS'[this.model,graphics,ok]' -p14 -g12 sS'model.rpar' -p15 +p14 S'vector' -p16 +p15 sS'N' -p17 +p16 g6 sS'T' -p18 +p17 g6 sS'graphics.exprs' -p19 +p18 NsS'model.ipar' -p20 +p19 g6 sS'typ' -p21 -g16 +p20 +g15 sS'ok' -p22 +p21 S'boolean' -p23 +p22 sS'model.blocktype' -p24 +p23 S'string' -p25 +p24 sS'model.dep_ut' -p26 -g16 +p25 +g15 sS'exprs' -p27 +p26 g8 sS'gr_i' -p28 -g16 +p27 +g15 sS'y' -p29 -g16 +p28 +g15 sS'x' -p30 +p29 g6 sS'model' -p31 +p30 g2 s.
\ No newline at end of file |