diff options
author | Sunil Shetye | 2018-06-22 15:17:51 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-22 16:38:30 +0530 |
commit | 870479a2e4b932426a904b2ebae7e4ee72037326 (patch) | |
tree | 7e089fd43599783dbddeef0bc7460dd085389b29 /js/Sources/READC_f.js | |
parent | ec185db61d5b6fa65322296e48a983de36436cd0 (diff) | |
download | sci2js-870479a2e4b932426a904b2ebae7e4ee72037326.tar.gz sci2js-870479a2e4b932426a904b2ebae7e4ee72037326.tar.bz2 sci2js-870479a2e4b932426a904b2ebae7e4ee72037326.zip |
save global variables in first pass
read those variables in second pass
Diffstat (limited to 'js/Sources/READC_f.js')
-rw-r--r-- | js/Sources/READC_f.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/Sources/READC_f.js b/js/Sources/READC_f.js index 778d4051..35f1168f 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-1]],[ievt],[N],[M],[swap],[offset],[_str2code[fname-1]],[tmask],[outmask]]; +ipar=[[length(fname)],[this._str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[this._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-1]],[ievt],[N],[M],[swap],[offset],[_str2code[fname-1]],[tmask],[outmask]]; +model.ipar=[[length(fname)],[this._str2code[frmt-1]],[ievt],[N],[M],[swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; model.blocktype="d"; model.firing=-1; model.dep_ut=[false,false]; @@ -54,15 +54,15 @@ 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]>1) { +if (prod(size(tmask1))>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) { +} else if (this.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-1]&&alreadyran) { +} else if (N!=ipar[6-1]&&this.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)) { +} else if (this.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.")); } else if (fname1=="") { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Input File Name")),gettext("You must provide a file name.")); @@ -100,8 +100,8 @@ model.firing=-1; } else { model.firing=0; } -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) { +ipar=[[length(fname1)],[this._str2code[frmt1-1]],[ievt],[N],[M],[swap],[offset],[this._str2code[fname1-1]],[tmask1],[outmask.slice()]]; +if (prod(size(dstate))!=(N*M)+3) { dstate=[[-1],[-1],[lunit],[zeros(N*M,1)]]; } model.dstate=dstate; |