diff options
Diffstat (limited to 'js/Misc')
-rw-r--r-- | js/Misc/AUTOMAT.js | 2 | ||||
-rw-r--r-- | js/Misc/DEBUG.js | 2 | ||||
-rw-r--r-- | js/Misc/LOGICAL_OP.js | 113 | ||||
-rw-r--r-- | js/Misc/MBLOCK.js | 2 | ||||
-rw-r--r-- | js/Misc/MPBLOCK.js | 2 | ||||
-rw-r--r-- | js/Misc/TEXT_f.js | 2 | ||||
-rw-r--r-- | js/Misc/scifunc_block_m.js | 2 |
7 files changed, 117 insertions, 8 deletions
diff --git a/js/Misc/AUTOMAT.js b/js/Misc/AUTOMAT.js index 182b7a17..cd27f093 100644 --- a/js/Misc/AUTOMAT.js +++ b/js/Misc/AUTOMAT.js @@ -1,3 +1,3 @@ -Syntax error in input LexToken(EOL,'\n ',1,2967) +Syntax error in input LexToken(COLON,':',1,3221) /* autogenerated from "macros/Misc/AUTOMAT.sci" */ None diff --git a/js/Misc/DEBUG.js b/js/Misc/DEBUG.js index 8f37e923..7a36654c 100644 --- a/js/Misc/DEBUG.js +++ b/js/Misc/DEBUG.js @@ -6,7 +6,7 @@ DEBUG.prototype.set = function DEBUG() { x=arg1; graphics=arg1.graphics; exprs=graphics.exprs; -textmp=exprs(2); +textmp=exprs[2-1]; ok=true; while (1==1) { [txt]=dialog(["Enter scilab instructions for debugging."," Inputs are block and flag, output is block"],textmp); diff --git a/js/Misc/LOGICAL_OP.js b/js/Misc/LOGICAL_OP.js index bc75d35e..ec4fd20d 100644 --- a/js/Misc/LOGICAL_OP.js +++ b/js/Misc/LOGICAL_OP.js @@ -1,3 +1,112 @@ -Syntax error in input LexToken(EOL,'\n ',1,2070) /* autogenerated from "macros/Misc/LOGICAL_OP.sci" */ -None +function LOGICAL_OP() { +LOGICAL_OP.prototype.get = function LOGICAL_OP() { +} +LOGICAL_OP.prototype.set = function LOGICAL_OP() { +x=arg1; +graphics=arg1.graphics; +exprs=graphics.exprs; +model=arg1.model; +if (size(exprs,1)==2) { +exprs=[exprs,sci2exp(1),sci2exp(0)]; +} +while (true) { +[ok,nin,rule,Datatype,tp,exprs]=scicos_getvalue("Set parameters",["number of inputs","Operator: AND (0), OR (1), NAND (2), NOR (3), XOR (4), NOT (5)","Datatype (1=double 3=int32 ...)","Bitwise Rule(0=No 1=yes)"],list("vec",1,"vec",1,"vec",1,"vec",1),exprs); +if (!ok) { +break +} +nin=int(nin); +rule=int(rule); +tp=int(tp); +if (nin<1) { +message("Number of inputs must be >=1 "); +ok=None; +} else if ((rule<0)||(rule>5)) { +message("Incorrect operator "+string(rule)+" ; must be 0 to 5."); +ok=None; +} else if ((rule==5)&&(nin>1)) { +message("Only one input allowed for NOT operation"); +nin=1; +} else if (((Datatype==1)&&(tp!=0))) { +message("Bitwise Rule is only activated when Data type is integer"); +ok=None; +} +if (ok) { +if ((tp!=0)) { +tp=1; +} +if (Datatype==1) { +model.sim=list("logicalop",4); +model.ipar=[rule]; +} else { +if (Datatype==3) { +model.sim=list("logicalop_i32",4); +} else if (Datatype==4) { +model.sim=list("logicalop_i16",4); +} else if (Datatype==5) { +model.sim=list("logicalop_i8",4); +} else if (Datatype==6) { +model.sim=list("logicalop_ui32",4); +} else if (Datatype==7) { +model.sim=list("logicalop_ui16",4); +} else if (Datatype==8) { +model.sim=list("logicalop_ui8",4); +} else { +message("Datatype is not supported"); +ok=None; +} +model.ipar=[rule,tp]; +} +if (ok) { +it=Datatype*ones(nin,1); +ot=Datatype; +in1=[-ones(nin,1),-2*ones(nin,1)]; +if ((rule!=5)&&(nin==1)) { +out=[1,1]; +[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); +} else { +out=[-1,-2]; +[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); +} +} +if (ok) { +if (rule==0) { +label="AND"; +} else if (rule==1) { +label="OR"; +} else if (rule==2) { +label="NAND"; +} else if (rule==3) { +label="NOR"; +} else if (rule==4) { +label="XOR"; +} else if (rule==5) { +label="NOT"; +} +graphics.exprs=exprs; +graphics.style=["blockWithLabel;displayedLabel="+label]; +x.graphics=graphics; +x.model=model; +break +} +} +} +} +LOGICAL_OP.prototype.define = function LOGICAL_OP() { +in1=[-1,-1]; +ipar=[0]; +nin=2; +model=scicos_model(); +model.sim=list("logicalop",4); +model.in1=in1; +model.out=-1; +model.ipar=ipar; +model.blocktype="c"; +model.dep_ut=[true,None]; +exprs=[string(nin),string(ipar)]; +gr_i=[]; +x=standard_define([2,2],model,exprs,gr_i); +} +LOGICAL_OP.prototype.details = function LOGICAL_OP() { +} +} diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index 43af51df..b5741088 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -1,3 +1,3 @@ -Syntax error in input LexToken(OPENBRACKET,'(',1,1518) +Syntax error in input LexToken(COLON,':',1,14003) /* autogenerated from "macros/Misc/MBLOCK.sci" */ None diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index a72e1990..dfd5f058 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -1,3 +1,3 @@ -Syntax error in input LexToken(OPENBRACKET,'(',1,1559) +Syntax error in input LexToken(COLON,':',1,13483) /* autogenerated from "macros/Misc/MPBLOCK.sci" */ None diff --git a/js/Misc/TEXT_f.js b/js/Misc/TEXT_f.js index d997af37..99eac7bb 100644 --- a/js/Misc/TEXT_f.js +++ b/js/Misc/TEXT_f.js @@ -32,7 +32,7 @@ default_font_size=gh_winpal.font_size; default_font_color=gh_winpal.font_color; gh_winpal.font_style=font; gh_winpal.font_size=siz; -r=xstringl(0,0,exprs(1),evstr(exprs(2)),evstr(exprs(3))); +r=xstringl(0,0,exprs[1-1],evstr(exprs[2-1]),evstr(exprs[3-1])); gh_winpal.font_style=default_font_style; gh_winpal.font_size=default_font_size; gh_winpal.font_color=default_font_color; diff --git a/js/Misc/scifunc_block_m.js b/js/Misc/scifunc_block_m.js index 0c0c8f3c..18ee889b 100644 --- a/js/Misc/scifunc_block_m.js +++ b/js/Misc/scifunc_block_m.js @@ -9,7 +9,7 @@ model=arg1.model; graphics=arg1.graphics; exprs=graphics.exprs; while (true) { -[ok,i,o,ci,co,xx,z,rpar,auto0,deptime,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("mat",[-1,2],"mat",[-2,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs(1)); +[ok,i,o,ci,co,xx,z,rpar,auto0,deptime,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("mat",[-1,2],"mat",[-2,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs[1-1]); if (!ok) { break } |