summaryrefslogtreecommitdiff
path: root/js/Sources/GEN_SQR.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Sources/GEN_SQR.js')
-rw-r--r--js/Sources/GEN_SQR.js52
1 files changed, 29 insertions, 23 deletions
diff --git a/js/Sources/GEN_SQR.js b/js/Sources/GEN_SQR.js
index 0f2bed09..29b8af91 100644
--- a/js/Sources/GEN_SQR.js
+++ b/js/Sources/GEN_SQR.js
@@ -1,7 +1,7 @@
/* autogenerated from "macros/Sources/GEN_SQR.sci" */
function GEN_SQR() {
GEN_SQR.prototype.define = function GEN_SQR() {
- scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[-176.97473,421.18646,173.61587,524.41503,827,480,0,15,827,480,755,614,1.4],Title="SuperBlock",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=[["if typeof(Amin)<>typeof(Amax) then error(\'Minimum value and Maximum value must have the same type\');end"],["if and(rule<>[1;2]) then error(\'Initial Value must be 1 (for Min) or 2 (for Max)\');end"],["if Amin>Amax then error(\'Maximum value must be greater than the Minimum Value\');end"],["P=%pi/F"],[""]],void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list()));
+ var scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[-176.97473,421.18646,173.61587,524.41503,827,480,0,15,827,480,755,614,1.4],Title="SuperBlock",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=[["if typeof(Amin)<>typeof(Amax) then error(\'Minimum value and Maximum value must have the same type\');end"],["if and(rule<>[1;2]) then error(\'Initial Value must be 1 (for Min) or 2 (for Max)\');end"],["if Amin>Amax then error(\'Maximum value must be greater than the Minimum Value\');end"],["P=%pi/F"],[""]],void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list()));
scs_m_1.objs[1-1] = scicos_block(gui="Counter",graphics=scicos_graphics(orig=[18.229901,339.5057],sz=[60,40],flip=true,theta=0,exprs=[["1"],["2"],["rule"]],pin=[],pout=8,pein=16,peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim=list("counter",4),in1=[],in2=[],intyp=1,out=1,out2=1,outtyp=1,evtin=1,evtout=[],state=[],dstate=0,odstate=list(),rpar=[],ipar=[[1],[2],[1]],opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list());
scs_m_1.objs[2-1] = scicos_block(gui="CONST_m",graphics=scicos_graphics(orig=[38.096074,293.82198],sz=[40,40],flip=true,theta=0,exprs="Amin",pin=[],pout=5,pein=[],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim=list("cstblk4_m",4),in1=[],in2=[],intyp=1,out=1,out2=1,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(-1),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list());
scs_m_1.objs[3-1] = scicos_block(gui="CONST_m",graphics=scicos_graphics(orig=[37.378886,245.02389],sz=[40,40],flip=true,theta=0,exprs="Amax",pin=[],pout=6,pein=[],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim=list("cstblk4_m",4),in1=[],in2=[],intyp=1,out=1,out2=1,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(1),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list());
@@ -41,12 +41,12 @@ function GEN_SQR() {
this.model.nzcross = new ScilabDouble([0]);
this.model.nmode = new ScilabDouble([0]);
this.model.equations = list();
- Amin = -1;
- Amax = 1;
- rule = 1;
- F = 1;
- exprs = [sci2exp(Amin),sci2exp(Amax),sci2exp(rule),sci2exp(F)];
- gr_i = [];
+ var Amin = -1;
+ var Amax = 1;
+ var rule = 1;
+ var F = 1;
+ var exprs = [sci2exp(Amin),sci2exp(Amax),sci2exp(rule),sci2exp(F)];
+ var gr_i = [];
this.x = standard_define([3,2],this.model,exprs,gr_i);
return new BasicBlock(this.x);
}
@@ -63,37 +63,43 @@ function GEN_SQR() {
scicos_context.Amax = arguments[0]["scicos_context.Amax"]
scicos_context.rule = arguments[0]["scicos_context.rule"]
scicos_context.F = arguments[0]["scicos_context.F"]
- y = this.needcompile;
+ var y = this.needcompile;
arg1.model.ipar = 1;
- typ = list();
- graphics = arg1.graphics;
- exprs = graphics.exprs;
- Btitre = "Set GEN_SQR parameters";
- Exprs0 = [["Amin"],["Amax"],["rule"],["F"]];
- Bitems = [["Minimum Value"],["Maximum Value"],["Initial Value( 1= Minimum Value 2= Maximum Value)"],["Period (sec)"]];
- Ss = list("mat",[-1,-1],"mat",[-1,-1],"pol",-1,"pol",-1);
- scicos_context = struct();
+ var typ = list();
+ var graphics = arg1.graphics;
+ var exprs = graphics.exprs;
+ var Btitre = "Set GEN_SQR parameters";
+ var Exprs0 = [["Amin"],["Amax"],["rule"],["F"]];
+ var Bitems = [["Minimum Value"],["Maximum Value"],["Initial Value( 1= Minimum Value 2= Maximum Value)"],["Period (sec)"]];
+ var Ss = list("mat",[-1,-1],"mat",[-1,-1],"pol",-1,"pol",-1);
+ var scicos_context = struct();
this.x = arg1;
- ok = false;
+ var ok = false;
while (!ok) {
[ok,scicos_context.Amin,scicos_context.Amax,scicos_context.rule,scicos_context.F,exprs] = scicos_getvalue(Btitre,Bitems,Ss,exprs);
if (!ok) {
return;
}
- PREVAR_scicos_context = scicos_context;
- sblock = this.x.model.rpar;
- [PREVAR_scicos_context,ierr] = script2var(sblock.props.context,PREVAR_scicos_context);
+ var PREVAR_scicos_context = scicos_context;
+ var sblock = this.x.model.rpar;
+ var tmpvar0 = script2var(sblock.props.context,PREVAR_scicos_context)
+ var PREVAR_scicos_context = tmpvar0[0]
+ var ierr = tmpvar0[1];
if (ierr==0) {
- [sblock,%w,needcompile2,ok] = do_eval(sblock,list());
+ var tmpvar1 = do_eval(sblock,list())
+ var sblock = tmpvar1[0]
+ %w = tmpvar1[1]
+ var needcompile2 = tmpvar1[2]
+ var ok = tmpvar1[3];
if (ok) {
- y = max(2,this.needcompile,needcompile2);
+ var y = max(2,this.needcompile,needcompile2);
this.x.graphics.exprs = exprs;
this.x.model.rpar = sblock;
break;
}
} else {
message(lasterror());
- ok = false;
+ var ok = false;
}
}
return new BasicBlock(this.x);