summaryrefslogtreecommitdiff
path: root/js/Sources
diff options
context:
space:
mode:
Diffstat (limited to 'js/Sources')
-rw-r--r--js/Sources/CLOCK_c.js8
-rw-r--r--js/Sources/CLOCK_f.js4
-rw-r--r--js/Sources/CONST_m.js4
-rw-r--r--js/Sources/CURVE_c.js3
-rw-r--r--js/Sources/CURV_f.js6
-rw-r--r--js/Sources/FROMWSB.js14
-rw-r--r--js/Sources/FROMWS_c.js4
-rw-r--r--js/Sources/GENSIN_f.js2
-rw-r--r--js/Sources/IN_f.js12
-rw-r--r--js/Sources/RAND_f.js4
-rw-r--r--js/Sources/RAND_m.js4
-rw-r--r--js/Sources/READAU_f.js14
-rw-r--r--js/Sources/READC_f.js18
-rw-r--r--js/Sources/RFILE_f.js20
-rw-r--r--js/Sources/STEP_FUNCTION.js14
15 files changed, 65 insertions, 66 deletions
diff --git a/js/Sources/CLOCK_c.js b/js/Sources/CLOCK_c.js
index cad67ad4..598ed817 100644
--- a/js/Sources/CLOCK_c.js
+++ b/js/Sources/CLOCK_c.js
@@ -1,7 +1,7 @@
/* autogenerated from "macros/Sources/CLOCK_c.sci" */
function CLOCK_c() {
CLOCK_c.prototype.define = function CLOCK_c() {
-evtdly=EVTDLY_c("define");
+evtdly=EVTDLY_c["define"-1];
evtdly.graphics.orig=[320,232];
evtdly.graphics.sz=[40,40];
evtdly.graphics.flip=true;
@@ -47,18 +47,18 @@ x.model.rpar=diagram;
}
CLOCK_c.prototype.set = function CLOCK_c() {
for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
-o=arg1.model.rpar.objs(i);
+o=arg1.model.rpar.objs[i-1];
if (typeof(o)=="Block"&&o.gui=="EVTDLY_c") {
path=i;
break;
}
}
newpar=list();
-xx=arg1.model.rpar.objs(path);
+xx=arg1.model.rpar.objs[path-1];
exprs=xx.graphics.exprs;
model=xx.model;
t0_old=model.firing;
-dt_old=model.rpar(1);
+dt_old=model.rpar[1-1];
model_n=model;
while (true) {
[ok,dt,t0,exprs0]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLOCK_c")],[" "],[gettext("Event clock generator")],[" "],[gettext("&nbsp; Do not start if \'Initialisation Time\' is negative")],[" "]],[[gettext("Period")],[gettext("Initialisation Time")]],list("vec",1,"vec",1),exprs);
diff --git a/js/Sources/CLOCK_f.js b/js/Sources/CLOCK_f.js
index dd3a158a..8afa8368 100644
--- a/js/Sources/CLOCK_f.js
+++ b/js/Sources/CLOCK_f.js
@@ -47,14 +47,14 @@ x.model.rpar=diagram;
}
CLOCK_f.prototype.set = function CLOCK_f() {
for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
-o=arg1.model.rpar.objs(i);
+o=arg1.model.rpar.objs[i-1];
if (typeof(o)=="Block"&&o.gui=="EVTDLY_f") {
path=i;
break;
}
}
newpar=list();
-xx=arg1.model.rpar.objs(path);
+xx=arg1.model.rpar.objs[path-1];
exprs=xx.graphics.exprs;
model=xx.model;
t0_old=model.firing;
diff --git a/js/Sources/CONST_m.js b/js/Sources/CONST_m.js
index f84ab287..e234d175 100644
--- a/js/Sources/CONST_m.js
+++ b/js/Sources/CONST_m.js
@@ -36,8 +36,8 @@ block_parameter_error(msprintf(gettext("Wrong size for \'%s\' parameter"),gettex
} else {
model.sim=list("cstblk4_m",4);
model.opar=list(C);
-if ((type(C)==1)) {
-if (isreal(C)) {
+if ((type[C-1]==1)) {
+if (isreal[C-1]) {
ot=1;
} else {
ot=2;
diff --git a/js/Sources/CURVE_c.js b/js/Sources/CURVE_c.js
index c406b761..f22a2fcf 100644
--- a/js/Sources/CURVE_c.js
+++ b/js/Sources/CURVE_c.js
@@ -1,5 +1,4 @@
-Syntax error in input LexToken(ASSIGNMENT,'=',1,4752)
-Syntax error in input LexToken(VAR,'ixy',1,6611)
+Syntax error in input LexToken(FUNCTION,'function',1,6574)
Syntax error in input LexToken(VAR,'a',1,25132)
Syntax error in input LexToken(VAR,'a',1,26313)
Syntax error in input LexToken(VAR,'a',1,27400)
diff --git a/js/Sources/CURV_f.js b/js/Sources/CURV_f.js
index 396c38b5..05da6a1e 100644
--- a/js/Sources/CURV_f.js
+++ b/js/Sources/CURV_f.js
@@ -28,7 +28,7 @@ model=arg1.model;
graphics=arg1.graphics;
rpar=model.rpar;
ipar=model.ipar;
-n=ipar(1);
+n=ipar[1-1];
xx=rpar.slice(1-1,n);
yy=rpar.slice(n+1-1,2*n);
gc=list(rpar.slice(2*n+1-1,2*n+4),ipar.slice(2-1,5));
@@ -50,9 +50,9 @@ ok=false;
if (ok) {
model.sim="intplt";
model.firing=[];
-rect=gc(1);
+rect=gc[1-1];
model.rpar=[[xx.slice()],[yy.slice()],[rect.slice()]];
-axisdata=gc(2);
+axisdata=gc[2-1];
model.ipar=[[size(xx,"*")],[axisdata.slice()]];
x.graphics=graphics;
x.model=model;
diff --git a/js/Sources/FROMWSB.js b/js/Sources/FROMWSB.js
index 9a1d2288..d7ac7b2a 100644
--- a/js/Sources/FROMWSB.js
+++ b/js/Sources/FROMWSB.js
@@ -16,7 +16,7 @@ x=standard_define([5,2],model,[],gr_i);
}
FROMWSB.prototype.set = function FROMWSB() {
for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
-o=arg1.model.rpar.objs(i);
+o=arg1.model.rpar.objs[i-1];
if (typeof(o)=="Block"&&o.gui=="FROMWS_c") {
ppath=list(i);
break;
@@ -31,11 +31,11 @@ for (k=1;k<=np;k+=1) {
spath[$+1-1]="model";
spath[$+1-1]="rpar";
spath[$+1-1]="objs";
-spath[$+1-1]=path(k);
+spath[$+1-1]=path[k-1];
}
-xx=arg1(spath);
+xx=arg1[spath-1];
execstr("xxn="+xx.gui+"(\'set\',xx)");
-if (!isequalbitwise(xxn,xx)) {
+if (!isequalbitwise[xxn-1][xx-1]) {
model=xx.model;
model_n=xxn.model;
if (!is_modelica_block(xx)) {
@@ -60,9 +60,9 @@ needcompile=4;
if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
needcompile=4;
}
-if (prod(size(model_n.sim))>1) {
-if (model_n.sim(2)>1000) {
-if (model.sim(1)!=model_n.sim(1)) {
+if (prod[size(model_n.sim)-1]>1) {
+if (model_n.sim[2-1]>1000) {
+if (model.sim[1-1]!=model_n.sim[1-1]) {
needcompile=4;
}
}
diff --git a/js/Sources/FROMWS_c.js b/js/Sources/FROMWS_c.js
index caf3a034..a166ca27 100644
--- a/js/Sources/FROMWS_c.js
+++ b/js/Sources/FROMWS_c.js
@@ -10,7 +10,7 @@ model.sim=list("fromws_c",4);
model.out=-1;
model.out2=-2;
model.outtyp=-1;
-model.ipar=[[length(varnam)],[_str2code(varnam)],[Method],[ZC],[OutEnd]];
+model.ipar=[[length(varnam)],[_str2code[varnam-1]],[Method],[ZC],[OutEnd]];
model.evtin=[1];
model.evtout=[1];
model.firing=[0];
@@ -53,7 +53,7 @@ message([["Invalid variable name."],["Please choose another variable name."]]);
ok=false;
}
if (ok) {
-model.ipar=[[length(varnam)],[_str2code(varnam)],[Method],[ZC],[OutEnd]];
+model.ipar=[[length(varnam)],[_str2code[varnam-1]],[Method],[ZC],[OutEnd]];
[model,graphics,ok]=set_io(model,graphics,list(),list([-1,-2],-1),1,1);
if (ok) {
graphics.exprs=exprs;
diff --git a/js/Sources/GENSIN_f.js b/js/Sources/GENSIN_f.js
index b34da787..a7c1378c 100644
--- a/js/Sources/GENSIN_f.js
+++ b/js/Sources/GENSIN_f.js
@@ -11,7 +11,7 @@ model.outtyp=1;
model.rpar=[[1],[1],[0]];
model.blocktype="c";
model.dep_ut=[false,true];
-exprs=[[string(rpar(1))],[string(rpar(2))],[string(rpar(3))]];
+exprs=[[string(rpar[1-1])],[string(rpar[2-1])],[string(rpar[3-1])]];
gr_i=[];
x=standard_define([3,2],model,exprs,gr_i);
}
diff --git a/js/Sources/IN_f.js b/js/Sources/IN_f.js
index 53193f1a..8e7695cb 100644
--- a/js/Sources/IN_f.js
+++ b/js/Sources/IN_f.js
@@ -30,17 +30,17 @@ if (size(exprs,"*")==1) {
exprs=[[exprs[1-1]],["[-1 -2]"],["-1"]];
}
while (true) {
-[ok,prt,otsz,ot,exprs]=getvalue(_("Set Input block parameters"),[[_("Port number")],[_("Outport size ([-1 -2] for inherit)")],[_("Outport Type (-1 for inherit)")]],list("vec",1,"vec",-1,"vec",1),exprs);
+[ok,prt,otsz,ot,exprs]=getvalue(_["Set Input block parameters"-1],[[_["Port number"-1]],[_["Outport size ([-1 -2] for inherit)"-1]],[_["Outport Type (-1 for inherit)"-1]]],list("vec",1,"vec",-1,"vec",1),exprs);
if (!ok) {
break;
}
prt=int(prt);
if (prt<=0) {
-message(_("Port number must be a positive integer"));
+message(_["Port number must be a positive integer"-1]);
} else if (!isequal(size(otsz,"*"),2)) {
-message(_("Outport Size must be a 2 elements vector"));
+message(_["Outport Size must be a 2 elements vector"-1]);
} else if (((ot<1||ot>9)&&(ot!=-1))) {
-message(_("Outport type must be a number between 1 and 9, or -1 for inheritance."));
+message(_["Outport type must be a number between 1 and 9, or -1 for inheritance."-1]);
} else {
if (model.ipar!=prt) {
needcompile=4;
@@ -48,8 +48,8 @@ y=needcompile;
}
model.ipar=prt;
model.firing=[];
-model.out=otsz(1);
-model.out2=otsz(2);
+model.out=otsz[1-1];
+model.out2=otsz[2-1];
model.outtyp=ot;
graphics.exprs=exprs;
x.graphics=graphics;
diff --git a/js/Sources/RAND_f.js b/js/Sources/RAND_f.js
index bf85ac44..c3f8d63e 100644
--- a/js/Sources/RAND_f.js
+++ b/js/Sources/RAND_f.js
@@ -15,7 +15,7 @@ model.rpar=[[a.slice()],[b.slice()]];
model.ipar=flag;
model.blocktype="d";
model.dep_ut=[false,false];
-exprs=[[string(flag)],[sci2exp(a.slice())],[sci2exp(b.slice())],[string(model.dstate(1))]];
+exprs=[[string(flag)],[sci2exp(a.slice())],[sci2exp(b.slice())],[string(model.dstate[1-1])]];
gr_i=[];
x=standard_define([3,2],model,exprs,gr_i);
}
@@ -32,7 +32,7 @@ if (size(exprs,"*")==5) {
exprs=exprs.slice(1-1,3);
}
if (size(exprs,"*")==3) {
-exprs=[[exprs],[string(model.dstate(1))]];
+exprs=[[exprs],[string(model.dstate[1-1])]];
}
while (true) {
[ok,flag,a,b,seed_c,exprs]=scicos_getvalue([["Set Random generator block parameters"],["flag = 0 : Uniform distribution A is min and A+B max"],["flag = 1 : Normal distribution A is mean and B deviation"],[" "],["A and B must be vector with equal sizes"],["seed is the seed of random number generator (integer<2**31)"]],[["flag"],["A"],["B"],["seed"]],list("vec",1,"vec",-1,"vec","size(%2,\'*\')","vec",1),exprs);
diff --git a/js/Sources/RAND_m.js b/js/Sources/RAND_m.js
index 7d9ad0e9..090093cb 100644
--- a/js/Sources/RAND_m.js
+++ b/js/Sources/RAND_m.js
@@ -24,7 +24,7 @@ model.ipar=flag;
model.blocktype="d";
model.firing=[];
model.dep_ut=[false,false];
-exprs=[[sci2exp(1)],[string(flag)],[sci2exp([a])],[sci2exp([b])],[sci2exp([model.dstate(1),int(rand()*(10^7-1))])]];
+exprs=[[sci2exp(1)],[string(flag)],[sci2exp([a])],[sci2exp([b])],[sci2exp([model.dstate[1-1],int(rand()*(10^7-1))])]];
gr_i=[];
x=standard_define([3,2],model,exprs,gr_i);
}
@@ -52,7 +52,7 @@ out=size(a);
if (typ==1) {
function_name="rndblk_m";
model.rpar=[[real(a.slice())],[real(b.slice())]];
-model.dstate=[[seed_c(1)],[0*real(a.slice())]];
+model.dstate=[[seed_c[1-1]],[0*real(a.slice())]];
ot=1;
} else if (typ==2) {
function_name="rndblkz_m";
diff --git a/js/Sources/READAU_f.js b/js/Sources/READAU_f.js
index da984c61..cf1be0d7 100644
--- a/js/Sources/READAU_f.js
+++ b/js/Sources/READAU_f.js
@@ -17,7 +17,7 @@ model.sim=list("readau",2);
model.out=nout;
model.evtin=1;
model.dstate=[[1],[1],[lunit],[zeros(N*M,1)]];
-model.ipar=[[length(fname)],[_str2code(frmt)],[ievt],[N],[M],[swap],[offset],[_str2code(fname)],[tmask],[outmask]];
+model.ipar=[[length(fname)],[_str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[_str2code[fname-1]],[tmask],[outmask]];
model.blocktype="d";
model.dep_ut=[false,false];
exprs=[[fname],[string(N)],[string(swap)]];
@@ -36,9 +36,9 @@ model=arg1.model;
out=model.out;
dstate=model.dstate;
ipar=model.ipar;
-imask=9+ipar(1);
-tmask=ipar(imask);
-lunit=dstate(3);
+imask=9+ipar[1-1];
+tmask=ipar[imask-1];
+lunit=dstate[3-1];
fname=exprs[1-1];
while (true) {
[ok,fname1,N,swap,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"READAU_f")],[" "],[gettext("(Read Audio File)")],[" "],[gettext("Read is done on a binary \'.au\' file")]],[[gettext("Input File Name")],[gettext("Buffer size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("str",1,"vec",1,"vec",1),exprs);
@@ -58,7 +58,7 @@ block_parameter_error(gettext("Simulation running !!! You cannot modify Input fi
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Input File Name")),gettext("You must provide a filename."));
} else if (N<1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer size"),N),msprintf(gettext("Must be greater than %d."),1));
-} else if (alreadyran&&(N!=ipar(6))) {
+} else if (alreadyran&&(N!=ipar[6-1])) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Buffer Size")),gettext("End current simulation first."));
} else if (swap!=0&&swap!=1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
@@ -66,8 +66,8 @@ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),
[model,graphics,ok]=check_io(model,graphics,[],1,1,[]);
frmt1=part(frmt1,1,3);
if (ok) {
-ipar=[[length(fname1)],[_str2code(frmt1)],[0],[N],[M],[swap],[offset,_str2code(fname1)],[tmask1,outmask.slice()]];
-if (prod(size(dstate))!=(N*M)+3) {
+ipar=[[length(fname1)],[_str2code[frmt1-1]],[0],[N],[M],[swap],[offset,_str2code[fname1-1]],[tmask1,outmask.slice()]];
+if (prod[size(dstate)-1]!=(N*M)+3) {
dstate=[[-1],[-1],[lunit],[zeros(N*M,1)]];
}
model.dstate=dstate;
diff --git a/js/Sources/READC_f.js b/js/Sources/READC_f.js
index 8d9ce6f2..778d4051 100644
--- a/js/Sources/READC_f.js
+++ b/js/Sources/READC_f.js
@@ -13,14 +13,14 @@ offset=1;
outmask=1;
ievt=0;
nout=size(outmask,"*");
-ipar=[[length(fname)],[_str2code(frmt)],[ievt],[N],[M],[swap],[offset],[_str2code(fname)],[tmask],[outmask]];
+ipar=[[length(fname)],[_str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[_str2code[fname-1]],[tmask],[outmask]];
model=scicos_model();
model.sim=list("readc",2);
model.out=nout;
model.evtin=1;
model.evtout=[];
model.dstate=[[1],[1],[lunit],[zeros(N*M,1)]];
-model.ipar=[[length(fname)],[_str2code(frmt)],[ievt],[N],[M],[swap],[offset],[_str2code(fname)],[tmask],[outmask]];
+model.ipar=[[length(fname)],[_str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[_str2code[fname-1]],[tmask],[outmask]];
model.blocktype="d";
model.firing=-1;
model.dep_ut=[false,false];
@@ -40,9 +40,9 @@ exprs=graphics.exprs;
out=model.out;
dstate=model.dstate;
ipar=model.ipar;
-imask=9+ipar(1);
-tmask=ipar(imask);
-lunit=dstate(3);
+imask=9+ipar[1-1];
+tmask=ipar[imask-1];
+lunit=dstate[3-1];
fname=exprs[3-1];
frmt=exprs[4-1];
while (true) {
@@ -54,13 +54,13 @@ fname1=pathconvert(stripblanks(fname1),false,true);
frmt1=stripblanks(frmt1);
fmts=["s","l","d","f","c","us","ul","uc","ull","uls","ubl","ubs","dl","fl","ll","sl","db","fb","lb","sb"];
nout=size(outmask,"*");
-if (prod(size(tmask1))>1) {
+if (prod[size(tmask1)-1]>1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Time Record Selection")),gettext("Must be a scalar or an empty matrix."));
} else if (and(frmt1!=fmts)) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Input Format"),frmt1),gettext("Valid formats are: "+strcat(fmts,", ")));
} else if (alreadyran&&fname1!=fname) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running"),gettext("Input File Name")),gettext("End current simulation first."));
-} else if (N!=ipar(6)&&alreadyran) {
+} else if (N!=ipar[6-1]&&alreadyran) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Buffer Size")),gettext("End current simulation first"));
} else if (alreadyran&&size(tmask1)!=size(tmask)) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Time Record Selection")),gettext("End current simulation first."));
@@ -100,8 +100,8 @@ model.firing=-1;
} else {
model.firing=0;
}
-ipar=[[length(fname1)],[_str2code(frmt1)],[ievt],[N],[M],[swap],[offset],[_str2code(fname1)],[tmask1],[outmask.slice()]];
-if (prod(size(dstate))!=(N*M)+3) {
+ipar=[[length(fname1)],[_str2code[frmt1-1]],[ievt],[N],[M],[swap],[offset],[_str2code[fname1-1]],[tmask1],[outmask.slice()]];
+if (prod[size(dstate)-1]!=(N*M)+3) {
dstate=[[-1],[-1],[lunit],[zeros(N*M,1)]];
}
model.dstate=dstate;
diff --git a/js/Sources/RFILE_f.js b/js/Sources/RFILE_f.js
index f844b789..a9fd24e6 100644
--- a/js/Sources/RFILE_f.js
+++ b/js/Sources/RFILE_f.js
@@ -10,14 +10,14 @@ N=2;
rpar=[];
tmask=0;
outmask=1;
-ipar=[[length(fname)],[length(frmt)],[0],[N],[_str2code(fname)],[_str2code(frmt)],[tmask],[outmask]];
+ipar=[[length(fname)],[length(frmt)],[0],[N],[_str2code[fname-1]],[_str2code[frmt-1]],[tmask],[outmask]];
dstate=[[1],[1],[lunit],[zeros((nout)*N,1)]];
model=scicos_model();
model.sim="readf";
model.out=nout;
model.evtin=1;
model.dstate=dstate;
-model.ipar=[[length(fname)],[length(frmt)],[0],[N],[_str2code(fname)],[_str2code(frmt)],[tmask],[outmask]];
+model.ipar=[[length(fname)],[length(frmt)],[0],[N],[_str2code[fname-1]],[_str2code[frmt-1]],[tmask],[outmask]];
model.blocktype="d";
model.dep_ut=[false,false];
exprs=[[sci2exp([])],[sci2exp(outmask)],[fname],[frmt],[string(N)],[sci2exp(out)]];
@@ -35,11 +35,11 @@ exprs=graphics.exprs;
model=arg1.model;
dstate=model.dstate;
ipar=model.ipar;
-ievt=ipar(3);
-N=ipar(4);
-imask=5+ipar(1)+ipar(2);
-tmask=ipar(imask);
-lunit=dstate(3);
+ievt=ipar[3-1];
+N=ipar[4-1];
+imask=5+ipar[1-1]+ipar[2-1];
+tmask=ipar[imask-1];
+lunit=dstate[3-1];
fname=exprs[3-1];
frmt=exprs[4-1];
if (size(exprs,"*")>5) {
@@ -53,7 +53,7 @@ break;
fname1=pathconvert(stripblanks(fname1),false,true);
frmt1=stripblanks(frmt1);
nout=size(outmask,"*");
-if (prod(size(tmask1))>1) {
+if (prod[size(tmask1)-1]>1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Time Record Selection"),strcat(string(tmask1.slice())," ")),gettext("Empty matrix or scalar expected."));
} else if (tmask1!=[]&&tmask1<1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d"),gettext("Time Record Selection"),tmask1),gettext("Strictly positive integer expected."));
@@ -89,8 +89,8 @@ model.firing=[];
} else {
model.firing=0;
}
-ipar=[[length(fname1)],[length(frmt1)],[ievt],[N],[_str2code(fname1)],[_str2code(frmt1)],[tmask1],[outmask.slice()]];
-if (prod(size(dstate))!=(nout+ievt)*N+3) {
+ipar=[[length(fname1)],[length(frmt1)],[ievt],[N],[_str2code[fname1-1]],[_str2code[frmt1-1]],[tmask1],[outmask.slice()]];
+if (prod[size(dstate)-1]!=(nout+ievt)*N+3) {
dstate=[[-1],[-1],[lunit],[zeros((nout+ievt)*N,1)]];
}
model.dstate=dstate;
diff --git a/js/Sources/STEP_FUNCTION.js b/js/Sources/STEP_FUNCTION.js
index 8307e904..3865ec88 100644
--- a/js/Sources/STEP_FUNCTION.js
+++ b/js/Sources/STEP_FUNCTION.js
@@ -2,7 +2,7 @@
function STEP_FUNCTION() {
STEP_FUNCTION.prototype.define = function STEP_FUNCTION() {
scs_m_1=scicos_diagram();
-scs_m_1.objs[1-1]=STEP("define");
+scs_m_1.objs[1-1]=STEP["define"-1];
scs_m_1.objs[2-1]=OUT_f("define");
scs_m_1.objs[3-1]=scicos_link();
scs_m_1.objs[4-1]=scicos_link();
@@ -56,7 +56,7 @@ x=standard_define([2,2],model,[],gr_i);
}
STEP_FUNCTION.prototype.set = function STEP_FUNCTION() {
for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
-o=arg1.model.rpar.objs(i);
+o=arg1.model.rpar.objs[i-1];
if (typeof(o)=="Block"&&o.gui=="STEP") {
ppath=list(i);
break;
@@ -70,9 +70,9 @@ for (k=1;k<=np;k+=1) {
spath[$+1-1]="model";
spath[$+1-1]="rpar";
spath[$+1-1]="objs";
-spath[$+1-1]=path(k);
+spath[$+1-1]=path[k-1];
}
-xx=arg1(spath);
+xx=arg1[spath-1];
execstr("xxn="+xx.gui+"(\'set\',xx)");
if (diffobjs(xxn,xx)) {
model=xx.model;
@@ -96,9 +96,9 @@ needcompile=4;
if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
needcompile=4;
}
-if (prod(size(model_n.sim))>1) {
-if (model_n.sim(2)>1000) {
-if (model.sim(1)!=model_n.sim(1)) {
+if (prod[size(model_n.sim)-1]>1) {
+if (model_n.sim[2-1]>1000) {
+if (model.sim[1-1]!=model_n.sim[1-1]) {
needcompile=4;
}
}