summaryrefslogtreecommitdiff
path: root/js/Misc/scifunc_block.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Misc/scifunc_block.js')
-rw-r--r--js/Misc/scifunc_block.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/js/Misc/scifunc_block.js b/js/Misc/scifunc_block.js
index 2676a016..1b119b75 100644
--- a/js/Misc/scifunc_block.js
+++ b/js/Misc/scifunc_block.js
@@ -24,9 +24,9 @@ function scifunc_block() {
this.model.blocktype = new ScilabString([typ]);
this.model.firing = new ScilabDouble(auto);
this.model.dep_ut = new ScilabDouble([true,false]);
- var exprs = list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
- var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"scifunc_block\",sz(1),sz(2));"]);
- this.x = standard_define([2,2],this.model,exprs,gr_i);
+ this.exprs = list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
+ this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"scifunc_block\",sz(1),sz(2));"]);
+ this.x = standard_define([2,2],this.model,this.exprs,this.gr_i);
return new BasicBlock(this.x);
}
scifunc_block.prototype.details = function scifunc_block() {
@@ -61,16 +61,16 @@ function scifunc_block() {
this.x = arg1;
this.model = arg1.model;
this.graphics = arg1.graphics;
- var exprs = this.graphics.exprs;
- if (size(exprs[1-1],"*")==8) {
- exprs[1-1][9-1] = "0";
+ this.exprs = this.graphics.exprs;
+ if (size(this.exprs[1-1],"*")==8) {
+ this.exprs[1-1][9-1] = "0";
}
while (true) {
- [ok,this.i,this.o,this.ci,this.co,this.xx,this.z,this.rpar,this.auto0,this.deptime,this.lab] = scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],["input ports sizes","output port sizes","input event ports sizes","output events ports sizes","initial continuous state","initial discrete state","System parameters vector","initial firing vector (<0 for no firing)","is block always active (0:no, 1:yes)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%4)","vec",1),exprs[1-1]);
+ [ok,this.i,this.o,this.ci,this.co,this.xx,this.z,this.rpar,this.auto0,this.deptime,this.lab] = scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],["input ports sizes","output port sizes","input event ports sizes","output events ports sizes","initial continuous state","initial discrete state","System parameters vector","initial firing vector (<0 for no firing)","is block always active (0:no, 1:yes)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%4)","vec",1),this.exprs[1-1]);
if (!ok) {
break;
}
- exprs[1-1] = this.lab;
+ this.exprs[1-1] = this.lab;
this.xx = this.xx.slice();
this.z = this.z.slice();
this.rpar = this.rpar.slice();
@@ -83,7 +83,7 @@ function scifunc_block() {
var nci = size(this.ci,1);
this.co = int(this.co.slice());
var nco = size(this.co,1);
- var tmpvar0 = genfunc1(exprs[2-1],this.i,this.o,nci,nco,size(this.xx,1),size(this.z,1),nrp,"c");
+ var tmpvar0 = genfunc1(this.exprs[2-1],this.i,this.o,nci,nco,size(this.xx,1),size(this.z,1),nrp,"c");
var ok = tmpvar0[0];
var tt = tmpvar0[1];
var dep_ut = tmpvar0[2];
@@ -111,8 +111,8 @@ function scifunc_block() {
this.model.firing = new ScilabDouble([auto]);
this.model.dep_ut = new ScilabDouble([dep_ut]);
this.x.model = this.model;
- exprs[2-1] = tt;
- this.graphics.exprs = new ScilabDouble([exprs]);
+ this.exprs[2-1] = tt;
+ this.graphics.exprs = new ScilabDouble([this.exprs]);
this.x.graphics = this.graphics;
break;
}