diff options
Diffstat (limited to 'js/Linear/CLSS_f.js')
-rw-r--r-- | js/Linear/CLSS_f.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/js/Linear/CLSS_f.js b/js/Linear/CLSS_f.js index ffad604c..2576257d 100644 --- a/js/Linear/CLSS_f.js +++ b/js/Linear/CLSS_f.js @@ -8,17 +8,17 @@ function CLSS_f() { this.D = 0; in1 = 1; out = 1; - model = scicos_model(); - model.sim = list("csslti",1); - model.in1 = in1; - model.out = out; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti",1); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[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 = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLSS_f.prototype.details = function CLSS_f() { @@ -46,7 +46,7 @@ function CLSS_f() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; 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) { @@ -64,7 +64,7 @@ function CLSS_f() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -74,16 +74,16 @@ function CLSS_f() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } |