summaryrefslogtreecommitdiff
path: root/js/Sources/PULSE_SC.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Sources/PULSE_SC.js')
-rw-r--r--js/Sources/PULSE_SC.js52
1 files changed, 29 insertions, 23 deletions
diff --git a/js/Sources/PULSE_SC.js b/js/Sources/PULSE_SC.js
index c1bc6b08..f0320ae3 100644
--- a/js/Sources/PULSE_SC.js
+++ b/js/Sources/PULSE_SC.js
@@ -1,7 +1,7 @@
/* autogenerated from "macros/Sources/PULSE_SC.sci" */
function PULSE_SC() {
PULSE_SC.prototype.define = function PULSE_SC() {
- scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[-162.7581,435.54369,67.607292,416.67644,827,479,0,15,827,480,715,167,1.4],Title=["SuperBlock","/home/fady/Scicos_examples/"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=10,context=[["E2=E+W/100*F"],["if (W<0 | W>100) then error(\'Width must be between 0 and 100\');end"],["if (E2 >= F) then error (\'Offset must be lower than (frequency*(1-Width/100))\'); end"]],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=[-162.7581,435.54369,67.607292,416.67644,827,479,0,15,827,480,715,167,1.4],Title=["SuperBlock","/home/fady/Scicos_examples/"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=10,context=[["E2=E+W/100*F"],["if (W<0 | W>100) then error(\'Width must be between 0 and 100\');end"],["if (E2 >= F) then error (\'Offset must be lower than (frequency*(1-Width/100))\'); end"]],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="CONST_m",graphics=scicos_graphics(orig=[30.801202,158.91733],sz=[40,40],flip=true,theta=0,exprs="A",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[2-1] = scicos_block(gui="Ground_g",graphics=scicos_graphics(orig=[31.534535,215.384],sz=[40,40],flip=true,theta=0,exprs=[],pin=[],pout=4,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(0),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="SELECT_m",graphics=scicos_graphics(orig=[106.00652,186.09381],sz=[40,40],flip=true,theta=0,exprs=[["-1"],["2"],["1"]],pin=[[4],[5]],pout=11,pein=[[9],[8]],peout=[],gr_i=[],id="",in_implicit=[["E"],["E"]],out_implicit="E"),model=scicos_model(sim=list("selector_m",4),in1=[[-1],[-1]],in2=[[-2],[-2]],intyp=[[-1],[-1]],out=-1,out2=-2,outtyp=-1,evtin=[[1],[1]],evtout=[],state=[],dstate=1,odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="c",firing=[],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list());
@@ -36,12 +36,12 @@ function PULSE_SC() {
this.model.nzcross = new ScilabDouble([0]);
this.model.nmode = new ScilabDouble([0]);
this.model.equations = list();
- E = 0.1;
- W = 30;
- F = 1;
- A = 1;
- exprs = [sci2exp(E),sci2exp(W),sci2exp(F),sci2exp(A)];
- gr_i = [];
+ var E = 0.1;
+ var W = 30;
+ var F = 1;
+ var A = 1;
+ var exprs = [sci2exp(E),sci2exp(W),sci2exp(F),sci2exp(A)];
+ var gr_i = [];
this.x = standard_define([3,2],this.model,exprs,gr_i);
return new BasicBlock(this.x);
}
@@ -58,30 +58,36 @@ function PULSE_SC() {
scicos_context.W = arguments[0]["scicos_context.W"]
scicos_context.F = arguments[0]["scicos_context.F"]
scicos_context.A = arguments[0]["scicos_context.A"]
- y = this.needcompile;
+ var y = this.needcompile;
arg1.model.ipar = 1;
- typ = list();
- graphics = arg1.graphics;
- exprs = graphics.exprs;
- Btitre = "Set Pulse Generator parameters";
- Exprs0 = [["E"],["W"],["F"],["A"]];
- Bitems = [["Phase delay (secs):"],["Pulse Width (% of period):"],["Period (secs):"],["Amplitude:"]];
- Ss = list("pol",-1,"pol",-1,"pol",-1,"mat",[-1,-1]);
- scicos_context = struct();
+ var typ = list();
+ var graphics = arg1.graphics;
+ var exprs = graphics.exprs;
+ var Btitre = "Set Pulse Generator parameters";
+ var Exprs0 = [["E"],["W"],["F"],["A"]];
+ var Bitems = [["Phase delay (secs):"],["Pulse Width (% of period):"],["Period (secs):"],["Amplitude:"]];
+ var Ss = list("pol",-1,"pol",-1,"pol",-1,"mat",[-1,-1]);
+ var scicos_context = struct();
this.x = arg1;
- ok = false;
+ var ok = false;
while (!ok) {
[ok,scicos_context.E,scicos_context.W,scicos_context.F,scicos_context.A,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;
@@ -90,7 +96,7 @@ function PULSE_SC() {
if ((lasterror()!=[])) {
messagebox(lasterror());
}
- ok = false;
+ var ok = false;
}
}
return new BasicBlock(this.x);