summaryrefslogtreecommitdiff
path: root/combined.js
diff options
context:
space:
mode:
authorSunil Shetye2018-06-15 23:43:09 +0530
committerSunil Shetye2018-06-15 23:43:09 +0530
commit073f4cb62b331bb437c894e0581126e5d1ef459f (patch)
tree84d6755d231feb9feb2d79a06e0bbe7f784d86fc /combined.js
parenta8e5849586f23ffb1ecd2fe47a636b61c80c2e70 (diff)
downloadsci2js-073f4cb62b331bb437c894e0581126e5d1ef459f.tar.gz
sci2js-073f4cb62b331bb437c894e0581126e5d1ef459f.tar.bz2
sci2js-073f4cb62b331bb437c894e0581126e5d1ef459f.zip
handle space character also
required in lists
Diffstat (limited to 'combined.js')
-rw-r--r--combined.js1838
1 files changed, 1834 insertions, 4 deletions
diff --git a/combined.js b/combined.js
index 5c6094c8..451f3024 100644
--- a/combined.js
+++ b/combined.js
@@ -392,6 +392,66 @@ x=standard_define([2,2],model,exprs,gr_i);
HALT_f.prototype.details = function HALT_f() {
}
}
+/* autogenerated from "macros/Events/IFTHEL_f.sci" */
+function IFTHEL_f() {
+IFTHEL_f.prototype.get = function IFTHEL_f() {
+}
+IFTHEL_f.prototype.set = function IFTHEL_f() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+if (exprs==[]) {
+exprs=string(1);
+}
+if (size(exprs,"*")==1) {
+exprs[2-1]=string(1);
+}
+while (true) {
+[ok,inh,nmod,exprs]=scicos_getvalue("Set parameters",["Inherit (1: no, 0: yes)","zero-crossing (0: no, 1: yes)"],list("vec",1,"vec",1),exprs);
+if (!ok) {
+break
+}
+model.dep_ut=[true,None];
+if (nmod!=0) {
+nmod=1;
+}
+if (inh!=1) {
+inh=[];
+}
+[model,graphics,ok]=check_io(model,graphics,1,[],inh,[1,1]);
+if (ok) {
+graphics.exprs=exprs;
+model.evtin=inh;
+model.sim[2-1]=-1;
+model.nmode=nmod;
+model.nzcross=nmod;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+IFTHEL_f.prototype.define = function IFTHEL_f() {
+model=scicos_model();
+model.sim=list("ifthel",-1);
+model.in=1;
+model.in2=1;
+model.intyp=-1;
+model.evtin=1;
+model.evtout=[1,1];
+model.blocktype="l";
+model.firing=[-1,-1];
+model.dep_ut=[true,None];
+model.nmode=1;
+model.nzcross=1;
+gr_i=[];
+exprs=[string(model.in),string(model.nmode)];
+x=standard_define([3,3],model,exprs,gr_i);
+}
+IFTHEL_f.prototype.details = function IFTHEL_f() {
+}
+}
/* autogenerated from "macros/Events/VirtualCLK0.sci" */
function VirtualCLK0() {
VirtualCLK0.prototype.get = function VirtualCLK0() {
@@ -702,6 +762,143 @@ x=standard_define([2.5,2.5],model,exprs,gr_i);
REGISTER_f.prototype.details = function REGISTER_f() {
}
}
+/* autogenerated from "macros/Linear/SUMMATION.sci" */
+function SUMMATION() {
+SUMMATION.prototype.get = function SUMMATION() {
+}
+SUMMATION.prototype.set = function SUMMATION() {
+x=arg1;
+graphics=arg1.graphics;
+model=arg1.model;
+exprs=graphics.exprs;
+if (size(exprs,1)==1) {
+exprs=[sci2exp(1),exprs,sci2exp(0)];
+} else if (size(exprs,1)==2) {
+exprs=[exprs,sci2exp(0)];
+}
+while (true) {
+[ok,Datatype,sgn,satur,exprs]=scicos_getvalue("Set sum block parameters",["Datatype (1=real double 2=complex 3=int32 ...)","Number of inputs or sign vector (of +1, -1)","Do on Overflow(0=Nothing 1=Saturate 2=Error)"],list("vec",1,"vec",-1,"vec",1),exprs);
+if (!ok) {
+break
+}
+sgn=sgn.slice();
+if ((satur!=0&&satur!=1&&satur!=2)) {
+message("Do on overflow must be 0,1,2");
+ok=None;
+}
+if (size(sgn,1)==1) {
+if (sgn<1) {
+message("Number of inputs must be > 0");
+ok=None;
+} else if (sgn==1) {
+in1=-1;
+in2=-2;
+sgn=[];
+nout=1;
+nout2=1;
+} else {
+in1=-ones(sgn,1);
+in2=2*in1;
+sgn=ones(sgn,1);
+nout=-1;
+nout2=-2;
+}
+} else {
+if (!and(abs(sgn)==1)) {
+message("Signs can only be +1 or -1");
+ok=None;
+} else {
+in1=-ones(size(sgn,1),1);
+in2=2*in1;
+nout=-1;
+nout2=-2;
+}
+}
+it=Datatype*ones(1,size(in1,1));
+ot=Datatype;
+if (Datatype==1) {
+model.sim=list("summation",4);
+} else if (Datatype==2) {
+model.sim=list("summation_z",4);
+} else if (((Datatype<1)||(Datatype>8))) {
+message("Datatype is not supported");
+ok=None;
+} else {
+if (satur==0) {
+if (Datatype==3) {
+model.sim=list("summation_i32n",4);
+} else if (Datatype==4) {
+model.sim=list("summation_i16n",4);
+} else if (Datatype==5) {
+model.sim=list("summation_i8n",4);
+} else if (Datatype==6) {
+model.sim=list("summation_ui32n",4);
+} else if (Datatype==7) {
+model.sim=list("summation_ui16n",4);
+} else if (Datatype==8) {
+model.sim=list("summation_ui8n",4);
+}
+} else if (satur==1) {
+if (Datatype==3) {
+model.sim=list("summation_i32s",4);
+} else if (Datatype==4) {
+model.sim=list("summation_i16s",4);
+} else if (Datatype==5) {
+model.sim=list("summation_i8s",4);
+} else if (Datatype==6) {
+model.sim=list("summation_ui32s",4);
+} else if (Datatype==7) {
+model.sim=list("summation_ui16s",4);
+} else if (Datatype==8) {
+model.sim=list("summation_ui8s",4);
+}
+} else if (satur==2) {
+if (Datatype==3) {
+model.sim=list("summation_i32e",4);
+} else if (Datatype==4) {
+model.sim=list("summation_i16e",4);
+} else if (Datatype==5) {
+model.sim=list("summation_i8e",4);
+} else if (Datatype==6) {
+model.sim=list("summation_ui32e",4);
+} else if (Datatype==7) {
+model.sim=list("summation_ui16e",4);
+} else if (Datatype==8) {
+model.sim=list("summation_ui8e",4);
+}
+}
+}
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list([in1,in2],it),list([nout,nout2],ot),[],[]);
+}
+if (ok) {
+model.rpar=satur;
+model.ipar=sgn;
+graphics.exprs=exprs;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+SUMMATION.prototype.define = function SUMMATION() {
+sgn=[1,-1];
+model=scicos_model();
+model.sim=list("summation",4);
+model.in=[-1,-1];
+model.out=-1;
+model.in2=[-2,-2];
+model.out2=-2;
+model.ipar=sgn;
+model.blocktype="c";
+model.dep_ut=[true,None];
+exprs=sci2exp(sgn);
+gr_i=[];
+x=standard_define([2,3],model,exprs,gr_i);
+}
+SUMMATION.prototype.details = function SUMMATION() {
+}
+}
/* autogenerated from "macros/Linear/SAMPHOLD.sci" */
function SAMPHOLD() {
SAMPHOLD.prototype.get = function SAMPHOLD() {
@@ -1236,6 +1433,158 @@ x=standard_define([2,2],model,exprs,gr_i);
SOM_f.prototype.details = function SOM_f() {
}
}
+/* autogenerated from "macros/Linear/DOLLAR_m.sci" */
+function DOLLAR_m() {
+DOLLAR_m.prototype.get = function DOLLAR_m() {
+}
+DOLLAR_m.prototype.set = function DOLLAR_m() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+if (size(exprs,"*")<2) {
+exprs[2-1]="0";
+}
+while (true) {
+[ok,a,inh,exprs]=scicos_getvalue("Set 1/z block parameters",["initial condition","Inherit (no:0, yes:1)"],list("mat",[-1,-2],"vec",-1),exprs);
+if (!ok) {
+break
+}
+out=[size(a,1),size(a,2)];
+if (out==0) {
+out=[];
+}
+in1=out;
+model.sim=list("dollar4_m",4);
+model.odstate=list(a);
+model.dstate=[];
+if ((type(a)==1)) {
+if (isreal(a)) {
+it=1;
+ot=1;
+if ((size(a,1)==1||size(a,2)==1)) {
+model.sim=list("dollar4",4);
+model.dstate=a.slice();
+model.odstate=list();
+}
+} else {
+it=2;
+ot=2;
+}
+} else if ((typeof(a)=="int32")) {
+it=3;
+ot=3;
+} else if ((typeof(a)=="int16")) {
+it=4;
+ot=4;
+} else if ((typeof(a)=="int8")) {
+it=5;
+ot=5;
+} else if ((typeof(a)=="uint32")) {
+it=6;
+ot=6;
+} else if ((typeof(a)=="uint16")) {
+it=7;
+ot=7;
+} else if ((typeof(a)=="uint8")) {
+it=8;
+ot=8;
+} else {
+message("type is not recognized");
+ok=None;
+}
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ones(1-inh,1),[]);
+}
+if (ok) {
+graphics.exprs=exprs;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+DOLLAR_m.prototype.define = function DOLLAR_m() {
+z=0;
+inh=0;
+in1=1;
+exprs=string([z,inh]);
+model=scicos_model();
+model.sim=list("dollar4",4);
+model.in=in1;
+model.out=in1;
+model.evtin=1-inh;
+model.dstate=z;
+model.blocktype="d";
+model.dep_ut=[None,None];
+gr_i=[];
+x=standard_define([2,2],model,exprs,gr_i);
+}
+DOLLAR_m.prototype.details = function DOLLAR_m() {
+}
+}
+/* autogenerated from "macros/Linear/DELAYV_f.sci" */
+function DELAYV_f() {
+DELAYV_f.prototype.get = function DELAYV_f() {
+}
+DELAYV_f.prototype.set = function DELAYV_f() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+nin=model.in(1);
+z0=model.dstate;
+zz0=z0.slice(1-1,$-1);
+told=z0($);
+while (true) {
+[ok,nin,zz0,T,exprs]=scicos_getvalue("Set delay parameters",["Number of inputs","Register initial condition","Max delay"],list("vec",1,"vec",-1,"vec",1),exprs);
+if (!ok) {
+break
+}
+if (size(zz0,"*")<2) {
+message("Register length must be at least 2");
+ok=None;
+}
+if (T<=0) {
+message("Delay must be positive");
+ok=None;
+}
+if (ok) {
+[model,graphics,ok]=check_io(model,graphics,[nin,1],nin,1,[1,1]);
+}
+if (ok) {
+graphics.exprs=exprs;
+model.dstate=[zz0.slice(),told];
+model.rpar=T/(size(zz0,"*"));
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+DELAYV_f.prototype.define = function DELAYV_f() {
+nin=1;
+z0=zeros(11,1);
+zz0=z0.slice(1-1,$-1);
+T=1;
+model=scicos_model();
+model.sim=list("delayv",1);
+model.in=[nin,1];
+model.out=nin;
+model.evtin=1;
+model.evtout=[1,1];
+model.dstate=z0;
+model.rpar=T/(size(zz0,"*"));
+model.blocktype="d";
+model.firing=[0,-1];
+model.dep_ut=[true,None];
+exprs=[string(nin),strcat(string(z0.slice(1-1,$-1)),";"),string(T)];
+gr_i=[];
+x=standard_define([3,2],model,exprs,gr_i);
+}
+DELAYV_f.prototype.details = function DELAYV_f() {
+}
+}
/* autogenerated from "macros/Linear/SAMPHOLD_m.sci" */
function SAMPHOLD_m() {
SAMPHOLD_m.prototype.get = function SAMPHOLD_m() {
@@ -1344,6 +1693,219 @@ x=standard_define([3.5,2],model,exprs,gr_i);
TIME_DELAY.prototype.details = function TIME_DELAY() {
}
}
+/* autogenerated from "macros/Linear/INTEGRAL_m.sci" */
+function INTEGRAL_m() {
+INTEGRAL_m.prototype.get = function INTEGRAL_m() {
+}
+INTEGRAL_m.prototype.set = function INTEGRAL_m() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,x0,reinit,satur,maxp,lowp,exprs]=scicos_getvalue("Set Integral block parameters",["Initial Condition","With re-intialization (1:yes, 0:no)","With saturation (1:yes, 0:no)","Upper limit","Lower limit"],list("mat",[-1,-1],"vec",1,"vec",1,"mat",[-1,-1],"mat",[-1,-1]),exprs);
+if (!ok) {
+break
+}
+if (isreal(x0)) {
+Datatype=1;
+} else {
+Datatype=2;
+}
+if (reinit!=0) {
+reinit=1;
+}
+if (satur!=0) {
+satur=1;
+if (Datatype==1) {
+if (size(maxp,"*")==1) {
+maxp=maxp*ones(x0);
+}
+if (size(lowp,"*")==1) {
+lowp=lowp*ones(x0);
+}
+if ((size(x0)!=size(maxp)||size(x0)!=size(lowp))) {
+message("x0 and Upper limit and Lower limit must have same size");
+ok=None;
+} else if (or(maxp<=lowp)) {
+message("Upper limits must be > Lower limits");
+ok=None;
+} else if (or(x0>maxp)||or(x0<lowp)) {
+message("Initial condition x0 should be inside the limits");
+ok=None;
+} else {
+rpar=[real(maxp.slice()),real(lowp.slice())];
+model.nzcross=size(x0,"*");
+model.nmode=size(x0,"*");
+}
+} else if ((Datatype==2)) {
+if (size(maxp,"*")==1) {
+maxp=math.complex(maxp*ones(x0),(maxp*ones(x0)));
+}
+if (size(lowp,"*")==1) {
+lowp=math.complex(lowp*ones(x0),(lowp*ones(x0)));
+}
+if ((size(x0)!=size(maxp)||size(x0)!=size(lowp))) {
+message("x0 and Upper limit and Lower limit must have same size");
+ok=None;
+} else if (or(real(maxp)<=real(lowp))||or(imag(maxp)<=imag(lowp))) {
+message("Upper limits must be > Lower limits");
+ok=None;
+} else if (or(real(x0)>real(maxp))||or(real(x0)<real(lowp))||or(imag(x0)>imag(maxp))||or(imag(x0)<imag(lowp))) {
+message("Initial condition x0 should be inside the limits");
+ok=None;
+} else {
+rpar=[real(maxp.slice()),real(lowp.slice()),imag(maxp.slice()),imag(lowp.slice())];
+model.nzcross=2*size(x0,"*");
+model.nmode=2*size(x0,"*");
+}
+}
+} else {
+rpar=[];
+model.nzcross=0;
+model.nmode=0;
+}
+if (ok) {
+model.rpar=rpar;
+if ((Datatype==1)) {
+model.state=real(x0.slice());
+model.sim=list("integral_func",4);
+it=[1,ones(reinit,1)];
+ot=1;
+} else if ((Datatype==2)) {
+model.state=[real(x0.slice()),imag(x0.slice())];
+model.sim=list("integralz_func",4);
+it=[2,2*ones(reinit,1)];
+ot=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+if (ok) {
+in1=[size(x0,1)*[1,ones(reinit,1)],size(x0,2)*[1,ones(reinit,1)]];
+out=size(x0);
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ones(reinit,1),[]);
+}
+}
+if (ok) {
+graphics.exprs=exprs;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+INTEGRAL_m.prototype.define = function INTEGRAL_m() {
+maxp=1;
+minp=-1;
+rpar=[];
+model=scicos_model();
+model.state=0;
+model.sim=list("integral_func",4);
+model.in=1;
+model.out=1;
+model.in2=1;
+model.out2=1;
+model.rpar=rpar;
+model.blocktype="c";
+model.dep_ut=[None,true];
+exprs=string([0,0,0,maxp,minp]);
+gr_i=[];
+x=standard_define([2,2],model,exprs,gr_i);
+}
+INTEGRAL_m.prototype.details = function INTEGRAL_m() {
+}
+}
+/* autogenerated from "macros/Linear/DOLLAR.sci" */
+function DOLLAR() {
+DOLLAR.prototype.get = function DOLLAR() {
+}
+DOLLAR.prototype.set = function DOLLAR() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+if (size(exprs,"*")<2) {
+exprs[2-1]="0";
+}
+while (true) {
+[ok,a,inh,exprs]=scicos_getvalue("Set 1/z block parameters",["initial condition","Inherit (no:0, yes:1)"],list("mat",[-1,-2],"vec",-1),exprs);
+if (!ok) {
+break
+}
+out=[size(a,1),size(a,2)];
+if (out==0) {
+out=[];
+}
+in1=out;
+model.sim=list("dollar4_m",4);
+model.odstate=list(a);
+model.dstate=[];
+if (type((a)==1)) {
+if (isreal(a)) {
+it=1;
+ot=1;
+if ((size(a,1)==1||size(a,2)==1)) {
+model.sim=list("dollar4",4);
+model.dstate=a.slice();
+model.odstate=list();
+}
+} else {
+it=2;
+ot=2;
+}
+} else if ((typeof(a)=="int32")) {
+it=3;
+ot=3;
+} else if ((typeof(a)=="int16")) {
+it=4;
+ot=4;
+} else if ((typeof(a)=="int8")) {
+it=5;
+ot=5;
+} else if ((typeof(a)=="uint32")) {
+it=6;
+ot=6;
+} else if ((typeof(a)=="uint16")) {
+it=7;
+ot=7;
+} else if ((typeof(a)=="uint8")) {
+it=8;
+ot=8;
+} else {
+message("type is not recognized");
+ok=None;
+}
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ones(1-inh,1),[]);
+}
+if (ok) {
+graphics.exprs=exprs;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+DOLLAR.prototype.define = function DOLLAR() {
+z=0;
+inh=0;
+in1=1;
+exprs=string([z,inh]);
+model=scicos_model();
+model.sim=list("dollar4",4);
+model.in=in1;
+model.out=in1;
+model.evtin=1-inh;
+model.dstate=z;
+model.blocktype="d";
+model.dep_ut=[None,None];
+gr_i=[];
+x=standard_define([2,2],model,exprs,gr_i);
+}
+DOLLAR.prototype.details = function DOLLAR() {
+}
+}
/* autogenerated from "macros/Linear/SUM_f.sci" */
function SUM_f() {
SUM_f.prototype.get = function SUM_f() {
@@ -2657,6 +3219,70 @@ x.graphics.id="From";
FROM.prototype.details = function FROM() {
}
}
+/* autogenerated from "macros/Branching/ISELECT_m.sci" */
+function ISELECT_m() {
+ISELECT_m.prototype.get = function ISELECT_m() {
+}
+ISELECT_m.prototype.set = function ISELECT_m() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,typ,nout,z0,exprs]=scicos_getvalue("Set parameters",["Datatype(1= real double 2=Complex 3=int32 ...)","number of outputs","initial connected output"],list("vec",1,"vec",1,"vec",1),exprs);
+if (!ok) {
+break
+}
+if (z0>nout||z0<=0) {
+message("initial connected input is not a valid input port number");
+} else if (((typ<1)||(typ>8))) {
+message("Datatype is not supported");
+ok=None;
+} else {
+it=typ;
+ot=typ*ones(1,nout);
+if (ok) {
+out=[-ones(nout,1),-2*ones(nout,1)];
+in1=[-1,-2];
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ones(nout,1),[]);
+if (ok) {
+graphics.exprs=exprs;
+model.dstate=z0;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+}
+}
+ISELECT_m.prototype.define = function ISELECT_m() {
+z0=1;
+nout=2;
+model=scicos_model();
+model.sim=list("selector_m",4);
+model.out=[-1,-1];
+model.out2=[-2,-2];
+model.outtyp=1;
+model.in=-1;
+model.in2=-2;
+model.intyp=1;
+model.evtout=[];
+model.state=[];
+model.rpar=[];
+model.ipar=[];
+model.firing=[];
+model.evtin=ones(nout,1);
+model.dstate=z0;
+model.blocktype="c";
+model.dep_ut=[true,None];
+exprs=[sci2exp(1),sci2exp(nout),sci2exp(z0)];
+gr_i=[];
+x=standard_define([3,2],model,exprs,gr_i);
+}
+ISELECT_m.prototype.details = function ISELECT_m() {
+}
+}
/* autogenerated from "macros/Branching/SELECT_f.sci" */
function SELECT_f() {
SELECT_f.prototype.get = function SELECT_f() {
@@ -2704,6 +3330,65 @@ x=standard_define([2,2],model,exprs,gr_i);
SELECT_f.prototype.details = function SELECT_f() {
}
}
+/* autogenerated from "macros/Branching/GOTOMO.sci" */
+function GOTOMO() {
+GOTOMO.prototype.get = function GOTOMO() {
+}
+GOTOMO.prototype.set = function GOTOMO() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,tag,tagvis,exprs]=scicos_getvalue("Set parameters",["Tag","Tag Visibility(1=Local 2=scoped 3= global)"],list("str",-1,"vec",1),exprs);
+if (!ok) {
+break
+}
+tagvis=int(tagvis);
+if (((tagvis<1)||(tagvis>3))) {
+message("Tag Visibility must be between 1 and 3");
+ok=None;
+}
+if (ok) {
+if (((model.ipar!=tagvis)||(model.opar!=list(tag)))) {
+needcompile=4;
+y=needcompile;
+}
+graphics.exprs=exprs;
+model.opar=list(tag);
+model.ipar=tagvis;
+x.model=model;
+x.graphics=graphics;
+arg1=x;
+break
+}
+}
+needcompile=resume(needcompile)
+}
+GOTOMO.prototype.define = function GOTOMO() {
+model=scicos_model();
+model.sim="gotomo";
+model.in=-1;
+model.in2=-2;
+model.intyp=[];
+model.out=[];
+model.out2=[];
+model.outtyp=1;
+model.ipar=int(1);
+model.opar=list("A");
+model.blocktype="c";
+model.dep_ut=[None,None];
+mo=modelica();
+mo.model="gotomo";
+mo.inputs="p";
+exprs=["A",sci2exp(1)];
+gr_i=[];
+x=standard_define([2,1],model,exprs,gr_i);
+x.graphics.in_implicit=["I"];
+}
+GOTOMO.prototype.details = function GOTOMO() {
+}
+}
/* autogenerated from "macros/Branching/SWITCH2_m.sci" */
function SWITCH2_m() {
SWITCH2_m.prototype.get = function SWITCH2_m() {
@@ -2821,6 +3506,58 @@ x=standard_define([3,2],model,exprs,gr_i);
EXTRACTOR.prototype.details = function EXTRACTOR() {
}
}
+/* autogenerated from "macros/Branching/CLKGOTO.sci" */
+function CLKGOTO() {
+CLKGOTO.prototype.get = function CLKGOTO() {
+}
+CLKGOTO.prototype.set = function CLKGOTO() {
+x=arg1;
+graphics=arg1.graphics;
+model=arg1.model;
+exprs=graphics.exprs;
+while (true) {
+[ok,tag,tagvis,exprs]=scicos_getvalue("Set block parameters",["Tag","Tag Visibility (1=Local 2=Scoped 3=Global)"],list("str",-1,"vec",1),exprs);
+if (!ok) {
+break
+}
+if (((tagvis<1)||(tagvis>3))) {
+message("Tag Visibility must be between 1 and 3");
+ok=None;
+}
+tagvis=int(tagvis);
+if (ok) {
+if (((model.opar!=list(tag))||(model.ipar!=tagvis))) {
+needcompile=4;
+y=needcompile;
+}
+model.opar=list(tag);
+model.ipar=tagvis;
+model.evtin=1;
+model.firing=-1;
+graphics.exprs=exprs;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+needcompile=resume(needcompile)
+}
+CLKGOTO.prototype.define = function CLKGOTO() {
+model=scicos_model();
+model.sim="clkgoto";
+model.evtin=1;
+model.opar=list("A");
+model.ipar=int(1);
+model.blocktype="d";
+model.firing=-1;
+model.dep_ut=[None,None];
+exprs=["A",sci2exp(1)];
+x=standard_define([2,1],model,exprs," ");
+x.graphics.id="Goto";
+}
+CLKGOTO.prototype.details = function CLKGOTO() {
+}
+}
/* autogenerated from "macros/Branching/CLKFROM.sci" */
function CLKFROM() {
CLKFROM.prototype.get = function CLKFROM() {
@@ -2864,6 +3601,62 @@ x.graphics.id="From";
CLKFROM.prototype.details = function CLKFROM() {
}
}
+/* autogenerated from "macros/Branching/GOTO.sci" */
+function GOTO() {
+GOTO.prototype.get = function GOTO() {
+}
+GOTO.prototype.set = function GOTO() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,tag,tagvis,exprs]=scicos_getvalue("Set parameters",["Tag","Tag Visibility(1=Local 2=scoped 3= global)"],list("str",-1,"vec",1),exprs);
+if (!ok) {
+break
+}
+tagvis=int(tagvis);
+if (((tagvis<1)||(tagvis>3))) {
+message("Tag Visibility must be between 1 and 3");
+ok=None;
+}
+if (ok) {
+if (((model.ipar!=tagvis)||(model.opar!=list(tag)))) {
+needcompile=4;
+y=needcompile;
+}
+graphics.exprs=exprs;
+model.opar=list(tag);
+model.ipar=tagvis;
+x.model=model;
+x.graphics=graphics;
+arg1=x;
+break
+}
+}
+needcompile=resume(needcompile)
+}
+GOTO.prototype.define = function GOTO() {
+model=scicos_model();
+model.sim="goto";
+model.in=-1;
+model.in2=-2;
+model.intyp=-1;
+model.out=[];
+model.out2=[];
+model.outtyp=1;
+model.ipar=int(1);
+model.opar=list("A");
+model.blocktype="c";
+model.dep_ut=[None,None];
+exprs=["A",sci2exp(1)];
+gr_i=[];
+x=standard_define([2,1],model,exprs,gr_i);
+x.graphics.id="Goto";
+}
+GOTO.prototype.details = function GOTO() {
+}
+}
/* autogenerated from "macros/Branching/SCALAR2VECTOR.sci" */
function SCALAR2VECTOR() {
SCALAR2VECTOR.prototype.get = function SCALAR2VECTOR() {
@@ -3130,6 +3923,70 @@ x=standard_define([2,2],model,exprs,gr_i);
ISELECT_f.prototype.details = function ISELECT_f() {
}
}
+/* autogenerated from "macros/Branching/SELECT_m.sci" */
+function SELECT_m() {
+SELECT_m.prototype.get = function SELECT_m() {
+}
+SELECT_m.prototype.set = function SELECT_m() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,typ,nin,z0,exprs]=scicos_getvalue("Set parameters",["Datatype(1= real double 2=Complex 3=int32 ..)","number of inputs","initial connected input"],list("vec",1,"vec",1,"vec",1),exprs);
+if (!ok) {
+break
+}
+if (z0>nin||z0<=0) {
+message("initial connected input is not a valid input port number");
+} else if (((typ<1)||(typ>8))&&(typ!=-1)) {
+message("Datatype is not supported");
+ok=None;
+} else {
+it=typ*ones(1,nin);
+ot=typ;
+if (ok) {
+in1=[-ones(nin,1),-2*ones(nin,1)];
+out=[-1,-2];
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ones(nin,1),[]);
+if (ok) {
+graphics.exprs=exprs;
+model.dstate=z0;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+}
+}
+SELECT_m.prototype.define = function SELECT_m() {
+z0=1;
+nin=2;
+model=scicos_model();
+model.sim=list("selector_m",4);
+model.in=[-1,-1];
+model.in2=[-2,-2];
+model.intyp=1;
+model.out=-1;
+model.out2=-2;
+model.outtyp=1;
+model.evtout=[];
+model.state=[];
+model.rpar=[];
+model.ipar=[];
+model.firing=[];
+model.evtin=ones(nin,1);
+model.dstate=z0;
+model.blocktype="c";
+model.dep_ut=[true,None];
+exprs=[sci2exp(1),sci2exp(nin),sci2exp(z0)];
+gr_i=[];
+x=standard_define([3,2],model,exprs,gr_i);
+}
+SELECT_m.prototype.details = function SELECT_m() {
+}
+}
/* autogenerated from "macros/Branching/CLKGotoTagVisibility.sci" */
function CLKGotoTagVisibility() {
CLKGotoTagVisibility.prototype.get = function CLKGotoTagVisibility() {
@@ -3179,6 +4036,69 @@ x=standard_define([2,2],model,exprs,gr_i);
CLKGotoTagVisibility.prototype.details = function CLKGotoTagVisibility() {
}
}
+/* autogenerated from "macros/Branching/M_SWITCH.sci" */
+function M_SWITCH() {
+M_SWITCH.prototype.get = function M_SWITCH() {
+}
+M_SWITCH.prototype.set = function M_SWITCH() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,nin,base,rule,exprs]=scicos_getvalue("Set parameters",["number of inputs","zero base indexing (0), otherwise 1","rounding rule: int (0), round (1), ceil (2), floor (3)"],list("vec",1,"vec",1,"vec",1),exprs);
+if (!ok) {
+break
+}
+nin=int(nin);
+base=int(base);
+if (nin<1) {
+message("Number of inputs must be >=1 ");
+} else if (!((base==1)||(base==0))) {
+message("base indexing must be 1 or 0");
+} else if (!((rule==1)||(rule==0)||(rule==2)||(rule==3))) {
+message("incorrect rounding rule");
+} else {
+if (nin==1) {
+in1=[1,1,-1,1];
+out=[1,1];
+} else {
+in1=[1,-ones(nin,1)];
+in2=[1,-2*ones(nin,1)];
+in1=[in1,in2];
+out=[-1,-2];
+}
+it=[-1,-2*ones(nin,1)];
+ot=-2;
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+if (ok) {
+graphics.exprs=exprs;
+model.ipar=[base,rule];
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+}
+M_SWITCH.prototype.define = function M_SWITCH() {
+in1=[1,-1,-1];
+ipar=[1,3];
+nin=2;
+model=scicos_model();
+model.sim=list("mswitch",4);
+model.in=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.5,2],model,exprs,gr_i);
+}
+M_SWITCH.prototype.details = function M_SWITCH() {
+}
+}
/* autogenerated from "macros/Branching/FROMMO.sci" */
function FROMMO() {
FROMMO.prototype.get = function FROMMO() {
@@ -3422,6 +4342,86 @@ x.graphics.out_implicit=["I"];
INIMPL_f.prototype.details = function INIMPL_f() {
}
}
+/* autogenerated from "macros/Sources/RAND_m.sci" */
+function RAND_m() {
+RAND_m.prototype.get = function RAND_m() {
+}
+RAND_m.prototype.set = function RAND_m() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+if (size(exprs,"*")==14) {
+exprs[9-1]=[];
+}
+while (true) {
+[ok,typ,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 matrix with equal sizes"],["Datatype(1=real double 2=complex)","flag","A","B","SEED"],list("vec",1,"vec",1,"mat",[-1,-2],"mat","[-1 -2]","mat",[1,2]),exprs);
+if (!ok) {
+break
+}
+if (flag!=0&&flag!=1) {
+message("flag must be equal to 1 or 0");
+} else {
+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())];
+ot=1;
+} else if (typ==2) {
+function_name="rndblkz_m";
+ot=2;
+model.rpar=[real(a.slice()),imag(a.slice()),real(b.slice()),imag(b.slice())];
+model.dstate=[seed_c.slice(),0*[real(a.slice()),imag(a.slice())]];
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list([],[]),list(out,ot),1,[]);
+if (ok) {
+model.sim=list(function_name,4);
+graphics.exprs=exprs;
+model.ipar=flag;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+}
+}
+RAND_m.prototype.define = function RAND_m() {
+a=0;
+b=1;
+dt=0;
+flag=0;
+function_name="rndblk_m";
+funtyp=4;
+model=scicos_model();
+model.sim=list(function_name,funtyp);
+model.in=[];
+model.in2=[];
+model.intyp=[];
+model.out=1;
+model.out2=1;
+model.outtyp=1;
+model.evtin=1;
+model.evtout=[];
+model.state=[];
+model.dstate=[int(rand()*(10^7-1)),0*a.slice()];
+model.rpar=[a.slice(),b.slice()];
+model.ipar=flag;
+model.blocktype="d";
+model.firing=[];
+model.dep_ut=[None,None];
+exprs=[sci2exp(1),string(flag),sci2exp([a]),sci2exp([b]),sci2exp([model.dstate(1),int(rand()*(10^7-1))])];
+gr_i=[];
+x=standard_define([3,2],model,exprs,gr_i);
+}
+RAND_m.prototype.details = function RAND_m() {
+}
+}
/* autogenerated from "macros/Sources/GENSQR_f.sci" */
function GENSQR_f() {
GENSQR_f.prototype.get = function GENSQR_f() {
@@ -3435,7 +4435,8 @@ if (size(exprs,"*")==2) {
exprs=exprs(2);
}
while (true) {
-[ok,Amplitude,exprs]=scicos_getvalue(["Set Square generator block parameters"],["Amplitude"],list("vec",1),exprs);
+[ok,Amplitude,exprs]=scicos_getvalue([
+ "Set Square generator block parameters"],["Amplitude"],list("vec",1),exprs);
if (!ok) {
break
}
@@ -4153,7 +5154,7 @@ lunit=dstate(3);
fname=exprs(3);
frmt=exprs(4);
while (true) {
-[ok,tmask1,outmask,fname1,frmt1,M,N,offset,swap,exprs]=scicos_getvalue([msprintf(gettext("Set %s block parameters"),"READC_f")," ",gettext("Read from C binary file")],[gettext("Time Record Selection"),gettext("Outputs Record Selection"),gettext("Input File Name"),gettext("Input Format"),gettext("Record Size"),gettext("Buffer Size"),gettext("Initial Record Index"),gettext("Swap Mode (0:No, 1:Yes)")],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+[ok,tmask1,outmask,fname1,frmt1,M,N,offset,swap,exprs]=scicos_getvalue([msprintf(gettext("Set %s block parameters"),"READC_f" )," ",gettext("Read from C binary file")],[gettext("Time Record Selection"),gettext("Outputs Record Selection"),gettext("Input File Name"),gettext("Input Format"),gettext("Record Size"),gettext("Buffer Size"),gettext("Initial Record Index"),gettext("Swap Mode (0:No, 1:Yes)")],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
if (!ok) {
break
}
@@ -4511,6 +5512,81 @@ x=standard_define([3,2],model,exprs,gr_i);
GENSIN_f.prototype.details = function GENSIN_f() {
}
}
+/* autogenerated from "macros/MatrixOp/MATMAGPHI.sci" */
+function MATMAGPHI() {
+MATMAGPHI.prototype.get = function MATMAGPHI() {
+}
+MATMAGPHI.prototype.set = function MATMAGPHI() {
+x=arg1;
+model=arg1.model;
+graphics=arg1.graphics;
+label=graphics.exprs;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,decomptyp,lab]=scicos_getvalue("Set MATMAGPHI block parameters",["decomposition type (1=Complex2MAG&PHI 2=MAG&PHI2Complex)"],list("vec",1),label);
+if (!ok) {
+break
+}
+label=lab;
+if ((decomptyp==1)) {
+function_name="matz_abs";
+in1=[-1,-2];
+it=2;
+out=[-1,-2,-1,-2];
+ot=[1,1];
+} else if ((decomptyp==2)) {
+function_name="matz_absc";
+in1=[-1,-2,-1,-2];
+it=[1,1];
+out=[-1,-2];
+ot=2;
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+funtyp=4;
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+}
+if (ok) {
+model.sim=list(function_name,funtyp);
+arg1.model=model;
+graphics.exprs=label;
+arg1.graphics=graphics;
+x=arg1;
+break
+}
+}
+}
+MATMAGPHI.prototype.define = function MATMAGPHI() {
+model=scicos_model();
+function_name="matz_abs";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-2;
+model.intyp=2;
+model.out=[-1,-1];
+model.out2=[-2,-2];
+model.outtyp=[1,1];
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+MATMAGPHI.prototype.details = function MATMAGPHI() {
+}
+}
/* autogenerated from "macros/MatrixOp/SQRT.sci" */
function SQRT() {
SQRT.prototype.get = function SQRT() {
@@ -4954,6 +6030,102 @@ x=standard_define([2,2],model,label,gr_i);
MATLU.prototype.details = function MATLU() {
}
}
+/* autogenerated from "macros/MatrixOp/MATSUM.sci" */
+function MATSUM() {
+MATSUM.prototype.get = function MATSUM() {
+}
+MATSUM.prototype.set = function MATSUM() {
+x=arg1;
+model=arg1.model;
+graphics=arg1.graphics;
+label=graphics.exprs;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,typ,decomptyp,lab]=scicos_getvalue("Set MATSUM block parameters",["Datatype(1=real double 2=Complex)","Sum along (0=all 1=lines 2=Columns)"],list("vec",1,"vec",1),label);
+if (!ok) {
+break
+}
+label=lab;
+if ((typ==1)) {
+if ((decomptyp==0)) {
+function_name="mat_sum";
+out=[1,1];
+} else if ((decomptyp==2)) {
+function_name="mat_suml";
+out=[-1,1];
+} else if ((decomptyp==1)) {
+function_name="mat_sumc";
+out=[1,-2];
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=1;
+ot=1;
+} else if ((typ==2)) {
+if ((decomptyp==0)) {
+function_name="matz_sum";
+out=[1,1];
+} else if ((decomptyp==2)) {
+function_name="matz_suml";
+out=[-1,1];
+} else if ((decomptyp==1)) {
+function_name="matz_sumc";
+out=[1,-2];
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=2;
+ot=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+in1=[model.in,model.in2];
+funtyp=4;
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+}
+if (ok) {
+model.sim=list(function_name,funtyp);
+arg1.model=model;
+graphics.exprs=label;
+arg1.graphics=graphics;
+x=arg1;
+break
+}
+}
+}
+MATSUM.prototype.define = function MATSUM() {
+model=scicos_model();
+function_name="mat_sum";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-2;
+model.intyp=1;
+model.out=1;
+model.out2=1;
+model.outtyp=1;
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1),sci2exp(0)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+MATSUM.prototype.details = function MATSUM() {
+}
+}
/* autogenerated from "macros/MatrixOp/MATBKSL.sci" */
function MATBKSL() {
MATBKSL.prototype.get = function MATBKSL() {
@@ -5244,6 +6416,176 @@ x=standard_define([2,2],model,label,gr_i);
RICC.prototype.details = function RICC() {
}
}
+/* autogenerated from "macros/MatrixOp/MATZREIM.sci" */
+function MATZREIM() {
+MATZREIM.prototype.get = function MATZREIM() {
+}
+MATZREIM.prototype.set = function MATZREIM() {
+x=arg1;
+model=arg1.model;
+graphics=arg1.graphics;
+label=graphics.exprs;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,decomptyp,lab]=scicos_getvalue("Set MATZREIM block parameters",["decomposition type (1=Complex2Real&Imag 2=Real&Imag2Complex)"],list("vec",1),label);
+if (!ok) {
+break
+}
+label=lab;
+if ((decomptyp==1)) {
+function_name="matz_reim";
+in1=[-1,-2];
+it=2;
+out=[-1,-2,-1,-2];
+ot=[1,1];
+} else if ((decomptyp==2)) {
+function_name="matz_reimc";
+in1=[-1,-2,-1,-2];
+it=[1,1];
+out=[-1,-2];
+ot=2;
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+funtyp=4;
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+}
+if (ok) {
+model.sim=list(function_name,funtyp);
+arg1.model=model;
+graphics.exprs=label;
+arg1.graphics=graphics;
+x=arg1;
+break
+}
+}
+}
+MATZREIM.prototype.define = function MATZREIM() {
+model=scicos_model();
+function_name="matz_reim";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-2;
+model.intyp=2;
+model.out=[-1,-1];
+model.out2=[-2,-2];
+model.outtyp=[1,1];
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=sci2exp(1);
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+MATZREIM.prototype.details = function MATZREIM() {
+}
+}
+/* autogenerated from "macros/MatrixOp/MATSING.sci" */
+function MATSING() {
+MATSING.prototype.get = function MATSING() {
+}
+MATSING.prototype.set = function MATSING() {
+x=arg1;
+model=arg1.model;
+graphics=arg1.graphics;
+label=graphics.exprs;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,typ,decomptyp,lab]=scicos_getvalue("Set MATSVD block parameters",["Datatype(1=real double 2=Complex)","decomposition type (1=singular values 2=sing values+matrix U & V)"],list("vec",1,"vec",1),label);
+if (!ok) {
+break
+}
+label=lab;
+if ((typ==1)) {
+if ((decomptyp==1)) {
+function_name="mat_sing";
+in1=[-1,-2];
+out=[-1,1];
+ot=1;
+} else if ((decomptyp==2)) {
+function_name="mat_svd";
+in1=[-1,-2];
+out=[-1,-1,-1,-2,-2,-2];
+ot=[1,1,1];
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=1;
+} else if ((typ==2)) {
+if ((decomptyp==1)) {
+function_name="matz_sing";
+in1=[-1,-2];
+out=[-1,1];
+ot=1;
+} else if ((decomptyp==2)) {
+function_name="matz_svd";
+in1=[-1,-2];
+out=[-1,-1,-1,-2,-2,-2];
+ot=[2,1,2];
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+funtyp=4;
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+}
+if (ok) {
+model.sim=list(function_name,funtyp);
+arg1.model=model;
+graphics.exprs=label;
+arg1.graphics=graphics;
+x=arg1;
+break
+}
+}
+}
+MATSING.prototype.define = function MATSING() {
+model=scicos_model();
+function_name="mat_sing";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-2;
+model.intyp=1;
+model.out=-1;
+model.out2=1;
+model.outtyp=1;
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1),sci2exp(1)];
+gr_i=[];
+x=standard_define([2,2],model,label,gr_i);
+}
+MATSING.prototype.details = function MATSING() {
+}
+}
/* autogenerated from "macros/MatrixOp/MATDET.sci" */
function MATDET() {
MATDET.prototype.get = function MATDET() {
@@ -5315,6 +6657,447 @@ x=standard_define([2,2],model,label,gr_i);
MATDET.prototype.details = function MATDET() {
}
}
+/* autogenerated from "macros/MatrixOp/SUBMAT.sci" */
+function SUBMAT() {
+SUBMAT.prototype.get = function SUBMAT() {
+}
+SUBMAT.prototype.set = function SUBMAT() {
+x=arg1;
+graphics=arg1.graphics;
+label=graphics.exprs;
+model=arg1.model;
+if (size(label,"*")==5) {
+label[6-1]=sci2exp([1,1]);
+}
+while (true) {
+[ok,typ,a,b,c,d,inp,exprs]=scicos_getvalue("Set SUBMAT Block",["Datatype (1=real double 2=Complex)","Starting Row Index","Ending Row Index","Starting Column Index","Ending Column Index","Input Dimensions"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",2),label);
+if (!ok) {
+break
+}
+if ((typ==1)) {
+function_name="submat";
+ot=1;
+it=1;
+} else if ((typ==2)) {
+function_name="submatz";
+ot=2;
+it=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+if ((a<=0)||(b<=0)||(c<=0)||(d<=0)) {
+message("invalid index");
+ok=None;
+}
+if (b<a) {
+message("ending row must be greater than starting row");
+ok=None;
+}
+if (d<c) {
+message("ending column must be greater than starting column");
+ok=None;
+}
+if (b>inp(1)) {
+message("index of ending row is out of range");
+ok=None;
+}
+if (d>inp(2)) {
+message("index of ending column is out of range");
+ok=None;
+}
+model.ipar=[a,b,c,d];
+in1=[inp(1),inp(2)];
+out=[(b-a)+1,(d-c)+1];
+funtyp=4;
+label=exprs;
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+model.sim=list(function_name,funtyp);
+graphics.exprs=label;
+arg1.graphics=graphics;
+arg1.model=model;
+x=arg1;
+break
+}
+}
+}
+SUBMAT.prototype.define = function SUBMAT() {
+model=scicos_model();
+function_name="submat";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-2;
+model.intyp=1;
+model.out=-1;
+model.out2=-2;
+model.outtyp=1;
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[1,1,1,1];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1),sci2exp(1),sci2exp(1),sci2exp(1),sci2exp(1)];
+gr_i=[];
+x=standard_define([2.5,2],model,label,gr_i);
+}
+SUBMAT.prototype.details = function SUBMAT() {
+}
+}
+/* autogenerated from "macros/MatrixOp/ROOTCOEF.sci" */
+function ROOTCOEF() {
+ROOTCOEF.prototype.get = function ROOTCOEF() {
+}
+ROOTCOEF.prototype.set = function ROOTCOEF() {
+x=arg1;
+graphics=arg1.graphics;
+label=graphics.exprs;
+model=arg1.model;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,typ,inp,exprs]=scicos_getvalue("Set ROOTCOEF Block",["Datatype(1=real double 2=Complex)","input row size"],list("vec",1,"vec",1),label);
+if (!ok) {
+break
+}
+if ((typ==1)) {
+function_name="root_coef";
+ot=1;
+it=1;
+} else if ((typ==2)) {
+function_name="rootz_coef";
+ot=2;
+it=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+in1=[inp,model.in2];
+out=[inp+1,model.out2];
+funtyp=4;
+if (ok) {
+label=exprs;
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+model.sim=list(function_name,funtyp);
+graphics.exprs=label;
+arg1.graphics=graphics;
+arg1.model=model;
+x=arg1;
+break
+}
+}
+}
+ROOTCOEF.prototype.define = function ROOTCOEF() {
+model=scicos_model();
+function_name="root_coef";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=1;
+model.intyp=1;
+model.out=-2;
+model.out2=1;
+model.outtyp=1;
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1),sci2exp(1)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+ROOTCOEF.prototype.details = function ROOTCOEF() {
+}
+}
+/* autogenerated from "macros/MatrixOp/EXTRACT.sci" */
+function EXTRACT() {
+EXTRACT.prototype.get = function EXTRACT() {
+}
+EXTRACT.prototype.set = function EXTRACT() {
+x=arg1;
+graphics=arg1.graphics;
+label=graphics.exprs;
+model=arg1.model;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,typ,a,b,exprs]=scicos_getvalue("Set EXTRACT Block",["Datatype (1=real double 2=Complex)","Lines to extract","Columns to extract"],list("vec",1,"mat",[1,-1],"mat",[1,-1]),label);
+a=a.slice();
+b=b.slice();
+if (!ok) {
+break
+}
+if ((typ==1)) {
+function_name="extract";
+ot=1;
+it=1;
+} else if ((typ==2)) {
+function_name="extractz";
+ot=2;
+it=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+ma=size(a,1);
+mb=size(b,1);
+if ((ma==0||mb==0)) {
+message("empty field");
+ok=None;
+}
+for(i=1;i<=ma;i+=1) {
+if ((a(i)<=0)) {
+message("invalid index");
+ok=None;
+}
+}
+for(j=1;j<=mb;j+=1) {
+if ((b(j)<=0)) {
+message("invalid index");
+ok=None;
+}
+}
+model.ipar=[a,b,ma,mb];
+in1=[model.in,model.in2];
+out=[ma,mb];
+funtyp=4;
+if (ok) {
+label=exprs;
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+model.sim=list(function_name,funtyp);
+graphics.exprs=label;
+arg1.graphics=graphics;
+arg1.model=model;
+x=arg1;
+break
+}
+}
+}
+EXTRACT.prototype.define = function EXTRACT() {
+model=scicos_model();
+function_name="extract";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-2;
+model.intyp=1;
+model.out=1;
+model.out2=1;
+model.outtyp=1;
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[1,1,1,1];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1),sci2exp([1]),sci2exp([1])];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+EXTRACT.prototype.details = function EXTRACT() {
+}
+}
+/* autogenerated from "macros/MatrixOp/MATEIG.sci" */
+function MATEIG() {
+MATEIG.prototype.get = function MATEIG() {
+}
+MATEIG.prototype.set = function MATEIG() {
+x=arg1;
+model=arg1.model;
+graphics=arg1.graphics;
+label=graphics.exprs;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,typ,decomptyp,lab]=scicos_getvalue("Set MATEIG block parameters",["Datatype(1=real double 2=Complex)","decomposition type (1=eig values 2=eig values+eig vectors"],list("vec",1,"vec",1),label);
+if (!ok) {
+break
+}
+label=lab;
+if ((typ==1)) {
+if ((decomptyp==1)) {
+function_name="mat_vps";
+out=[-1,1];
+ot=2;
+} else if ((decomptyp==2)) {
+function_name="mat_vpv";
+out=[-1,-1,-1,-1];
+ot=[2,2];
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=1;
+} else if ((typ==2)) {
+if ((decomptyp==1)) {
+function_name="matz_vps";
+out=[-1,1];
+ot=2;
+} else if ((decomptyp==2)) {
+function_name="matz_vpv";
+out=[-1,-1,-1,-1];
+ot=[2,2];
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+in1=[-1,-1];
+funtyp=4;
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+}
+if (ok) {
+model.sim=list(function_name,funtyp);
+arg1.model=model;
+graphics.exprs=label;
+arg1.graphics=graphics;
+x=arg1;
+break
+}
+}
+}
+MATEIG.prototype.define = function MATEIG() {
+model=scicos_model();
+function_name="mat_vps";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-1;
+model.intyp=1;
+model.out=-1;
+model.out2=1;
+model.outtyp=2;
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1),sci2exp(1)];
+gr_i=[];
+x=standard_define([2,2],model,label,gr_i);
+}
+MATEIG.prototype.details = function MATEIG() {
+}
+}
+/* autogenerated from "macros/MatrixOp/CUMSUM.sci" */
+function CUMSUM() {
+CUMSUM.prototype.get = function CUMSUM() {
+}
+CUMSUM.prototype.set = function CUMSUM() {
+x=arg1;
+model=arg1.model;
+graphics=arg1.graphics;
+label=graphics.exprs;
+if (size(label,"*")==14) {
+label[9-1]=[];
+}
+while (true) {
+[ok,typ,decomptyp,lab]=scicos_getvalue("Set CUMSUM block parameters",["Datatype(1=real double 2=Complex)","Sum along (0=the first non singleton dimension 1=Rows 2=Columns)"],list("vec",1,"vec",1),label);
+if (!ok) {
+break
+}
+label=lab;
+if ((typ==1)) {
+if ((decomptyp==0)) {
+function_name="cumsum_m";
+out=[-1,-2];
+} else if ((decomptyp==1)) {
+function_name="cumsum_r";
+out=[-1,1];
+} else if ((decomptyp==2)) {
+function_name="cumsum_c";
+out=[1,-2];
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=1;
+ot=1;
+} else if ((typ==2)) {
+if ((decomptyp==0)) {
+function_name="cumsumz_m";
+} else if ((decomptyp==1)) {
+function_name="cumsumz_r";
+} else if ((decomptyp==2)) {
+function_name="cumsumz_c";
+} else {
+message("decomposition type is not supported");
+ok=None;
+}
+it=2;
+ot=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+in1=[model.in,model.in2];
+out=[model.out,model.out2];
+funtyp=4;
+if (ok) {
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+}
+if (ok) {
+model.sim=list(function_name,funtyp);
+arg1.model=model;
+graphics.exprs=label;
+arg1.graphics=graphics;
+x=arg1;
+break
+}
+}
+}
+CUMSUM.prototype.define = function CUMSUM() {
+model=scicos_model();
+function_name="cumsum_m";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-1;
+model.in2=-2;
+model.intyp=1;
+model.out=-1;
+model.out2=-2;
+model.outtyp=1;
+model.evtin=[];
+model.evtout=[];
+model.state=[];
+model.dstate=[];
+model.rpar=[];
+model.ipar=[];
+model.blocktype="c";
+model.firing=[];
+model.dep_ut=[true,None];
+label=[sci2exp(1),sci2exp(0)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+CUMSUM.prototype.details = function CUMSUM() {
+}
+}
/* autogenerated from "macros/MatrixOp/MATDIV.sci" */
function MATDIV() {
MATDIV.prototype.get = function MATDIV() {
@@ -6367,6 +8150,53 @@ x.graphics.out_implicit=["I"];
OpAmp.prototype.details = function OpAmp() {
}
}
+/* autogenerated from "macros/Electrical/Capacitor.sci" */
+function Capacitor() {
+Capacitor.prototype.get = function Capacitor() {
+}
+Capacitor.prototype.set = function Capacitor() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,C,v,exprs]=scicos_getvalue("Set Capacitor block parameter",["C (F)","Initial Voltage"],list("vec",1,"vec",1),exprs);
+if (!ok) {
+break
+}
+model.rpar=C;
+model.equations.parameters[2-1]=list(C,v);
+graphics.exprs=exprs;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+Capacitor.prototype.define = function Capacitor() {
+model=scicos_model();
+C=0.01;
+v=0;
+model.rpar=[C,v];
+model.sim="Capacitor";
+model.blocktype="c";
+model.dep_ut=[true,None];
+mo=modelica();
+mo.model="Capacitor";
+mo.inputs="p";
+mo.outputs="n";
+mo.parameters=list(["C","v"],list(C,v),[0,1]);
+model.equations=mo;
+model.in=ones(size(mo.inputs,"*"),1);
+model.out=ones(size(mo.outputs,"*"),1);
+exprs=string([C,v]);
+gr_i=[];
+x=standard_define([2,1.1],model,exprs,list(gr_i,0));
+x.graphics.in_implicit=["I"];
+x.graphics.out_implicit=["I"];
+}
+Capacitor.prototype.details = function Capacitor() {
+}
+}
/* autogenerated from "macros/Electrical/Gyrator.sci" */
function Gyrator() {
Gyrator.prototype.get = function Gyrator() {
@@ -7496,14 +9326,14 @@ graphics=arg1.graphics;
model=arg1.model;
exprs=graphics.exprs;
while (true) {
-[ok,Datatype,np,exprs]=scicos_getvalue([msprintf(gettext("Set %s block parameters"),"INTMUL")," ",gettext("Integer matrix multiplication")," "],[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)"),gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")],list("vec",1,"vec",1),exprs);
+[ok,Datatype,np,exprs]=scicos_getvalue( [msprintf(gettext("Set %s block parameters"),"INTMUL")," ",gettext("Integer matrix multiplication")," "],[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)"),gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")],list("vec",1,"vec",1),exprs);
if (!ok) {
break
}
it=Datatype*ones(1,2);
ot=Datatype;
if ((np!=0&&np!=1&&np!=2)) {
-block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Do on Overflow"),np),msprintf(gettext("Must be in the interval %s."),"[0, 2]"));
+block_parameter_error(msprintf( gettext("Wrong value for \'%s\' parameter: %d."),gettext("Do on Overflow"),np),msprintf( gettext("Must be in the interval %s."),"[0, 2]"));
ok=None;
} else if (Datatype==3) {
if (np==0) {