summaryrefslogtreecommitdiff
path: root/js/Sources/RFILE_f.js
diff options
context:
space:
mode:
authorSunil Shetye2018-06-19 23:23:04 +0530
committerSunil Shetye2018-06-21 18:33:20 +0530
commit8cf65fe92b28b8809abcb0eb59f951d26f30792f (patch)
treed9509c35b6a4c3096d4be449935f88af5568276a /js/Sources/RFILE_f.js
parent3f563b9e29d42266d6680229da5c29f847804834 (diff)
downloadsci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.tar.gz
sci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.tar.bz2
sci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.zip
distinguish between functions and arrays
maintain a list of functions
Diffstat (limited to 'js/Sources/RFILE_f.js')
-rw-r--r--js/Sources/RFILE_f.js20
1 files changed, 10 insertions, 10 deletions
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;