diff options
author | Sunil Shetye | 2018-07-09 11:43:39 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-09 12:16:25 +0530 |
commit | 62b1d7dd9183ed75733b44104890586b03818214 (patch) | |
tree | 9859e9ca295df98df945bd5fcccc3a264e8bede1 /js/Linear/CLSS.js | |
parent | 5c011853630a1b466ef4789d5b600dd530d0a3ec (diff) | |
download | sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.gz sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.bz2 sci2js-62b1d7dd9183ed75733b44104890586b03818214.zip |
support ScilabBoolean, ScilabDouble, ScilabString
Diffstat (limited to 'js/Linear/CLSS.js')
-rw-r--r-- | js/Linear/CLSS.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/js/Linear/CLSS.js b/js/Linear/CLSS.js index b227e048..2f336b4a 100644 --- a/js/Linear/CLSS.js +++ b/js/Linear/CLSS.js @@ -8,17 +8,17 @@ function CLSS() { this.D = 0; in1 = 1; out = 1; - model = scicos_model(); - model.sim = list("csslti4",4); - 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("csslti4",4); + 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.prototype.details = function CLSS() { @@ -46,7 +46,7 @@ function CLSS() { 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) { @@ -74,7 +74,7 @@ function CLSS() { if (ms!=ns||!okD) { message(_("Matrix A is not square or D has wrong dimension")); } 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()]]; @@ -84,16 +84,16 @@ function CLSS() { } 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; } } |