summaryrefslogtreecommitdiff
path: root/js/Sources/CONST.js
diff options
context:
space:
mode:
authorSunil Shetye2018-07-09 11:43:39 +0530
committerSunil Shetye2018-07-09 12:16:25 +0530
commit62b1d7dd9183ed75733b44104890586b03818214 (patch)
tree9859e9ca295df98df945bd5fcccc3a264e8bede1 /js/Sources/CONST.js
parent5c011853630a1b466ef4789d5b600dd530d0a3ec (diff)
downloadsci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.gz
sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.bz2
sci2js-62b1d7dd9183ed75733b44104890586b03818214.zip
support ScilabBoolean, ScilabDouble, ScilabString
Diffstat (limited to 'js/Sources/CONST.js')
-rw-r--r--js/Sources/CONST.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/js/Sources/CONST.js b/js/Sources/CONST.js
index 34c1ca06..af405b98 100644
--- a/js/Sources/CONST.js
+++ b/js/Sources/CONST.js
@@ -2,16 +2,16 @@
function CONST() {
CONST.prototype.define = function CONST() {
this.C = 1;
- model = scicos_model();
- model.sim = list("cstblk4",4);
- model.in1 = [];
- model.out = 1;
- model.rpar = this.C;
- model.blocktype = "d";
- model.dep_ut = [false,false];
+ this.model = scicos_model();
+ this.model.sim = list("cstblk4",4);
+ this.model.in1 = [];
+ this.model.out = new ScilabDouble(1);
+ this.model.rpar = new ScilabDouble(this.C);
+ this.model.blocktype = new ScilabString("d");
+ this.model.dep_ut = [false,false];
exprs = strcat(sci2exp(this.C));
gr_i = [];
- this.x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],this.model,exprs,gr_i);
return new BasicBlock(this.x);
}
CONST.prototype.details = function CONST() {
@@ -27,7 +27,7 @@ function CONST() {
this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
- model = arg1.model;
+ this.model = arg1.model;
while (true) {
[ok,this.C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs);
if (!ok) {
@@ -40,11 +40,11 @@ function CONST() {
} else if (and(sz>1)) {
message("C matrix is not supported, use CONST_m instead");
} else {
- model.rpar = this.C.slice();
- model.out = nout;
+ this.model.rpar = this.C.slice();
+ this.model.out = new ScilabDouble(nout);
graphics.exprs = exprs;
this.x.graphics = graphics;
- this.x.model = model;
+ this.x.model = this.model;
break;
}
}