diff options
Diffstat (limited to 'js/Branching')
53 files changed, 805 insertions, 725 deletions
diff --git a/js/Branching/CLKFROM.js b/js/Branching/CLKFROM.js index 3f33b7be..168cf14d 100644 --- a/js/Branching/CLKFROM.js +++ b/js/Branching/CLKFROM.js @@ -9,35 +9,36 @@ function CLKFROM() { model.firing = -1; model.dep_ut = [false,false]; exprs = "A"; - x = standard_define([2,1],model,exprs," "); - x.graphics.id = "From"; + this.x = standard_define([2,1],model,exprs," "); + this.x.graphics.id = "From"; } CLKFROM.prototype.details = function CLKFROM() { + return this.x; } CLKFROM.prototype.get = function CLKFROM() { } CLKFROM.prototype.set = function CLKFROM() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; model = arg1.model; exprs = graphics.exprs; while (true) { - [ok,tag,exprs] = scicos_getvalue("Set block parameters","Tag",list("str",-1),exprs); - if (!ok) { -break; -} - if (model.opar!=list(tag)) { - needcompile = 4; - y = needcompile; -} - model.opar = list(tag); - model.evtout = 1; - model.firing = -1; - graphics.exprs = exprs; - x.graphics = graphics; - x.model = model; -break; -} -needcompile=resume(needcompile) + [ok,tag,exprs] = scicos_getvalue("Set block parameters","Tag",list("str",-1),exprs); + if (!ok) { + break; + } + if (model.opar!=list(tag)) { + needcompile = 4; + y = needcompile; + } + model.opar = list(tag); + model.evtout = 1; + model.firing = -1; + graphics.exprs = exprs; + this.x.graphics = graphics; + this.x.model = model; + break; + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/CLKFROM.pickle b/js/Branching/CLKFROM.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/CLKFROM.pickle +++ b/js/Branching/CLKFROM.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/CLKGOTO.js b/js/Branching/CLKGOTO.js index e3698ab9..79bce050 100644 --- a/js/Branching/CLKGOTO.js +++ b/js/Branching/CLKGOTO.js @@ -10,43 +10,44 @@ function CLKGOTO() { model.firing = -1; model.dep_ut = [false,false]; exprs = [["A"],[sci2exp(1)]]; - x = standard_define([2,1],model,exprs," "); - x.graphics.id = "Goto"; + this.x = standard_define([2,1],model,exprs," "); + this.x.graphics.id = "Goto"; } CLKGOTO.prototype.details = function CLKGOTO() { + return this.x; } CLKGOTO.prototype.get = function CLKGOTO() { } CLKGOTO.prototype.set = function CLKGOTO() { - x = arg1; + this.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 = false; -} - 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) + [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 = false; + } + 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; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/CLKGOTO.pickle b/js/Branching/CLKGOTO.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/CLKGOTO.pickle +++ b/js/Branching/CLKGOTO.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/CLKGotoTagVisibility.js b/js/Branching/CLKGotoTagVisibility.js index 44d58cc1..d9fcb9de 100644 --- a/js/Branching/CLKGotoTagVisibility.js +++ b/js/Branching/CLKGotoTagVisibility.js @@ -16,34 +16,35 @@ function CLKGotoTagVisibility() { model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } CLKGotoTagVisibility.prototype.details = function CLKGotoTagVisibility() { + return this.x; } CLKGotoTagVisibility.prototype.get = function CLKGotoTagVisibility() { } CLKGotoTagVisibility.prototype.set = function CLKGotoTagVisibility() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); - if (!ok) { -break; -} - if (ok) { - if (model.opar!=list(tag)) { - needcompile = 4; - y = needcompile; -} - graphics.exprs = exprs; - model.opar = list(tag); - x.graphics = graphics; - x.model = model; -break; -} -} -needcompile=resume(needcompile) + [ok,tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); + if (!ok) { + break; + } + if (ok) { + if (model.opar!=list(tag)) { + needcompile = 4; + y = needcompile; + } + graphics.exprs = exprs; + model.opar = list(tag); + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/CLKGotoTagVisibility.pickle b/js/Branching/CLKGotoTagVisibility.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/CLKGotoTagVisibility.pickle +++ b/js/Branching/CLKGotoTagVisibility.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/DEMUX.js b/js/Branching/DEMUX.js index 22d11572..1245ea5b 100644 --- a/js/Branching/DEMUX.js +++ b/js/Branching/DEMUX.js @@ -12,52 +12,53 @@ function DEMUX() { model.dep_ut = [true,false]; exprs = string(out); gr_i = []; - x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],model,exprs,gr_i); } DEMUX.prototype.details = function DEMUX() { + return this.x; } DEMUX.prototype.get = function DEMUX() { } DEMUX.prototype.set = function DEMUX() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("intvec",-1),exprs); - if (!ok) { -break; -} - if (size(out,"*")==1) { - if (out<2||out>31) { -message("Block must have at least 2 and at most 31 output ports"); - ok = false; - } else { - [model,graphics,ok] = check_io(model,graphics,0,-transpose([1:out]),[],[]); -} - } else { - if (size(out,"*")<2||or(out==0)||size(out,"*")>31) { -message([["Block must have at least 2 and at most 31 output ports"],["size 0 is not allowed"]]); - ok = false; - } else { - if (min(out)<0) { - nin = 0; - } else { - nin = sum(out); -} - [model,graphics,ok] = check_io(model,graphics,nin,out.slice(),[],[]); - if (ok) { - out = size(out,"*"); -} -} -} - if (ok) { - graphics.exprs = exprs; - model.ipar = out; - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("intvec",-1),exprs); + if (!ok) { + break; + } + if (size(out,"*")==1) { + if (out<2||out>31) { + message("Block must have at least 2 and at most 31 output ports"); + ok = false; + } else { + [model,graphics,ok] = check_io(model,graphics,0,-transpose([1:out]),[],[]); + } + } else { + if (size(out,"*")<2||or(out==0)||size(out,"*")>31) { + message([["Block must have at least 2 and at most 31 output ports"],["size 0 is not allowed"]]); + ok = false; + } else { + if (min(out)<0) { + nin = 0; + } else { + nin = sum(out); + } + [model,graphics,ok] = check_io(model,graphics,nin,out.slice(),[],[]); + if (ok) { + out = size(out,"*"); + } + } + } + if (ok) { + graphics.exprs = exprs; + model.ipar = out; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/DEMUX.pickle b/js/Branching/DEMUX.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/DEMUX.pickle +++ b/js/Branching/DEMUX.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/DEMUX_f.js b/js/Branching/DEMUX_f.js index 8d9cb7eb..77c36dfd 100644 --- a/js/Branching/DEMUX_f.js +++ b/js/Branching/DEMUX_f.js @@ -12,52 +12,53 @@ function DEMUX_f() { model.dep_ut = [true,false]; exprs = string(out); gr_i = []; - x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],model,exprs,gr_i); } DEMUX_f.prototype.details = function DEMUX_f() { + return this.x; } DEMUX_f.prototype.get = function DEMUX_f() { } DEMUX_f.prototype.set = function DEMUX_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("vec",-1),exprs); - if (!ok) { -break; -} - if (size(out,"*")==1) { - if (out<2||out>8) { -message("Block must have at least 2 and at most 8 output ports"); - ok = false; - } else { - [model,graphics,ok] = check_io(model,graphics,0,-transpose([1:out]),[],[]); -} - } else { - if (size(out,"*")<2||size(out,"*")>8||or(out==0)) { -message([["Block must have at least 2 and at most 8 output ports"],["and size 0 is not allowed"]]); - ok = false; - } else { - if (min(out)<0) { - nin = 0; - } else { - nin = sum(out); -} - [model,graphics,ok] = check_io(model,graphics,nin,out.slice(),[],[]); - if (ok) { - out = size(out,"*"); -} -} -} - if (ok) { - graphics.exprs = exprs; - model.ipar = out; - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("vec",-1),exprs); + if (!ok) { + break; + } + if (size(out,"*")==1) { + if (out<2||out>8) { + message("Block must have at least 2 and at most 8 output ports"); + ok = false; + } else { + [model,graphics,ok] = check_io(model,graphics,0,-transpose([1:out]),[],[]); + } + } else { + if (size(out,"*")<2||size(out,"*")>8||or(out==0)) { + message([["Block must have at least 2 and at most 8 output ports"],["and size 0 is not allowed"]]); + ok = false; + } else { + if (min(out)<0) { + nin = 0; + } else { + nin = sum(out); + } + [model,graphics,ok] = check_io(model,graphics,nin,out.slice(),[],[]); + if (ok) { + out = size(out,"*"); + } + } + } + if (ok) { + graphics.exprs = exprs; + model.ipar = out; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/DEMUX_f.pickle b/js/Branching/DEMUX_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/DEMUX_f.pickle +++ b/js/Branching/DEMUX_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/ESELECT_f.js b/js/Branching/ESELECT_f.js index 663b7638..ccfb0fe2 100644 --- a/js/Branching/ESELECT_f.js +++ b/js/Branching/ESELECT_f.js @@ -16,52 +16,53 @@ function ESELECT_f() { model.nzcross = 0; gr_i = []; exprs = [[string(out)],[string(1)],[string(model.nmode)]]; - x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],model,exprs,gr_i); } ESELECT_f.prototype.details = function ESELECT_f() { + return this.x; } ESELECT_f.prototype.get = function ESELECT_f() { } ESELECT_f.prototype.set = function ESELECT_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; if (size(exprs,"*")==1) { - exprs[2-1] = string(1); -} + exprs[2-1] = string(1); + } if (size(exprs,"*")==2) { - exprs[3-1] = string(0); -} + exprs[3-1] = string(0); + } model = arg1.model; while (true) { - [ok,out,inh,nmod,exprs] = scicos_getvalue("Set ESELECT block parameters",[["number of output event ports"],["Inherit (1: no, 0: yes)"],["zero-crossing (0: no, 1: yes)"]],list("vec",1,"vec",1,"vec",1),exprs); - if (!ok) { -break; -} - if (nmod!=0) { - nmod = 1; -} - if (inh==0) { - inh = []; - } else { - inh = 1; -} - out = int(out); - if (out<2) { -message("Block must have at least two output ports"); - } else { - [model,graphics,ok] = check_io(model,graphics,1,[],inh,[ones(out,1)]); - if (ok) { - graphics.exprs = exprs; - model.evtout = ones(out,1); - model.firing = -ones(out,1); - x.graphics = graphics; - model.nmode = nmod; - model.nzcross = nmod; - x.model = model; -break; -} -} -} + [ok,out,inh,nmod,exprs] = scicos_getvalue("Set ESELECT block parameters",[["number of output event ports"],["Inherit (1: no, 0: yes)"],["zero-crossing (0: no, 1: yes)"]],list("vec",1,"vec",1,"vec",1),exprs); + if (!ok) { + break; + } + if (nmod!=0) { + nmod = 1; + } + if (inh==0) { + inh = []; + } else { + inh = 1; + } + out = int(out); + if (out<2) { + message("Block must have at least two output ports"); + } else { + [model,graphics,ok] = check_io(model,graphics,1,[],inh,[ones(out,1)]); + if (ok) { + graphics.exprs = exprs; + model.evtout = ones(out,1); + model.firing = -ones(out,1); + this.x.graphics = graphics; + model.nmode = nmod; + model.nzcross = nmod; + this.x.model = model; + break; + } + } + } } } diff --git a/js/Branching/ESELECT_f.pickle b/js/Branching/ESELECT_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/ESELECT_f.pickle +++ b/js/Branching/ESELECT_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/EXTRACTOR.js b/js/Branching/EXTRACTOR.js index c904bda2..ed4a336f 100644 --- a/js/Branching/EXTRACTOR.js +++ b/js/Branching/EXTRACTOR.js @@ -11,32 +11,33 @@ function EXTRACTOR() { model.ipar = ind; exprs = [sci2exp(ind)]; gr_i = []; - x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],model,exprs,gr_i); } EXTRACTOR.prototype.details = function EXTRACTOR() { + return this.x; } EXTRACTOR.prototype.get = function EXTRACTOR() { } EXTRACTOR.prototype.set = function EXTRACTOR() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,ind,exprs] = scicos_getvalue("Set block parameters",["indices to extract"],list("vec",-1),exprs); - if (!ok) { -break; -} - ind = int(ind); - ind = ind.slice(); - [model,graphics,ok] = check_io(model,graphics,[-1],size(ind,1),[],[]); - if (ok) { - model.ipar = ind; - graphics.exprs = exprs; - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,ind,exprs] = scicos_getvalue("Set block parameters",["indices to extract"],list("vec",-1),exprs); + if (!ok) { + break; + } + ind = int(ind); + ind = ind.slice(); + [model,graphics,ok] = check_io(model,graphics,[-1],size(ind,1),[],[]); + if (ok) { + model.ipar = ind; + graphics.exprs = exprs; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/EXTRACTOR.pickle b/js/Branching/EXTRACTOR.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/EXTRACTOR.pickle +++ b/js/Branching/EXTRACTOR.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/FROM.js b/js/Branching/FROM.js index 3317192f..1f582691 100644 --- a/js/Branching/FROM.js +++ b/js/Branching/FROM.js @@ -15,35 +15,36 @@ function FROM() { model.dep_ut = [false,false]; exprs = ["A"]; gr_i = []; - x = standard_define([2,1],model,exprs,gr_i); - x.graphics.id = "From"; + this.x = standard_define([2,1],model,exprs,gr_i); + this.x.graphics.id = "From"; } FROM.prototype.details = function FROM() { + return this.x; } FROM.prototype.get = function FROM() { } FROM.prototype.set = function FROM() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); - if (!ok) { -break; -} - if (ok) { - if (model.opar!=list(tag)) { - needcompile = 4; - y = needcompile; -} - graphics.exprs = exprs; - model.opar = list(tag); - x.model = model; - x.graphics = graphics; -break; -} -} -needcompile=resume(needcompile) + [ok,tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); + if (!ok) { + break; + } + if (ok) { + if (model.opar!=list(tag)) { + needcompile = 4; + y = needcompile; + } + graphics.exprs = exprs; + model.opar = list(tag); + this.x.model = model; + this.x.graphics = graphics; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/FROM.pickle b/js/Branching/FROM.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/FROM.pickle +++ b/js/Branching/FROM.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/FROMMO.js b/js/Branching/FROMMO.js index c026068b..ac7ed5aa 100644 --- a/js/Branching/FROMMO.js +++ b/js/Branching/FROMMO.js @@ -18,35 +18,36 @@ function FROMMO() { mo.outputs = "n"; exprs = ["A"]; gr_i = []; - x = standard_define([2,1],model,exprs,gr_i); - x.graphics.out_implicit = ["I"]; + this.x = standard_define([2,1],model,exprs,gr_i); + this.x.graphics.out_implicit = ["I"]; } FROMMO.prototype.details = function FROMMO() { + return this.x; } FROMMO.prototype.get = function FROMMO() { } FROMMO.prototype.set = function FROMMO() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); - if (!ok) { -break; -} - if (ok) { - if (model.opar!=list(tag)) { - needcompile = 4; - y = needcompile; -} - graphics.exprs = exprs; - model.opar = list(tag); - x.model = model; - x.graphics = graphics; -break; -} -} -needcompile=resume(needcompile) + [ok,tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); + if (!ok) { + break; + } + if (ok) { + if (model.opar!=list(tag)) { + needcompile = 4; + y = needcompile; + } + graphics.exprs = exprs; + model.opar = list(tag); + this.x.model = model; + this.x.graphics = graphics; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/FROMMO.pickle b/js/Branching/FROMMO.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/FROMMO.pickle +++ b/js/Branching/FROMMO.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/GOTO.js b/js/Branching/GOTO.js index ec23ad47..c7355935 100644 --- a/js/Branching/GOTO.js +++ b/js/Branching/GOTO.js @@ -15,42 +15,43 @@ function GOTO() { model.dep_ut = [false,false]; exprs = [["A"],[sci2exp(1)]]; gr_i = []; - x = standard_define([2,1],model,exprs,gr_i); - x.graphics.id = "Goto"; + this.x = standard_define([2,1],model,exprs,gr_i); + this.x.graphics.id = "Goto"; } GOTO.prototype.details = function GOTO() { + return this.x; } GOTO.prototype.get = function GOTO() { } GOTO.prototype.set = function GOTO() { - x = arg1; + this.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 = false; -} - 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) + [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 = false; + } + if (ok) { + if (((model.ipar!=tagvis)||(model.opar!=list(tag)))) { + needcompile = 4; + y = needcompile; + } + graphics.exprs = exprs; + model.opar = list(tag); + model.ipar = tagvis; + this.x.model = model; + this.x.graphics = graphics; + arg1 = this.x; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/GOTO.pickle b/js/Branching/GOTO.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/GOTO.pickle +++ b/js/Branching/GOTO.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/GOTOMO.js b/js/Branching/GOTOMO.js index 8ab01276..1ed448ab 100644 --- a/js/Branching/GOTOMO.js +++ b/js/Branching/GOTOMO.js @@ -18,42 +18,43 @@ function GOTOMO() { mo.inputs = "p"; exprs = [["A"],[sci2exp(1)]]; gr_i = []; - x = standard_define([2,1],model,exprs,gr_i); - x.graphics.in_implicit = ["I"]; + this.x = standard_define([2,1],model,exprs,gr_i); + this.x.graphics.in_implicit = ["I"]; } GOTOMO.prototype.details = function GOTOMO() { + return this.x; } GOTOMO.prototype.get = function GOTOMO() { } GOTOMO.prototype.set = function GOTOMO() { - x = arg1; + this.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 = false; -} - 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) + [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 = false; + } + if (ok) { + if (((model.ipar!=tagvis)||(model.opar!=list(tag)))) { + needcompile = 4; + y = needcompile; + } + graphics.exprs = exprs; + model.opar = list(tag); + model.ipar = tagvis; + this.x.model = model; + this.x.graphics = graphics; + arg1 = this.x; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/GOTOMO.pickle b/js/Branching/GOTOMO.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/GOTOMO.pickle +++ b/js/Branching/GOTOMO.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/GotoTagVisibility.js b/js/Branching/GotoTagVisibility.js index 445dc9a9..7553f37f 100644 --- a/js/Branching/GotoTagVisibility.js +++ b/js/Branching/GotoTagVisibility.js @@ -16,34 +16,35 @@ function GotoTagVisibility() { model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } GotoTagVisibility.prototype.details = function GotoTagVisibility() { + return this.x; } GotoTagVisibility.prototype.get = function GotoTagVisibility() { } GotoTagVisibility.prototype.set = function GotoTagVisibility() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); - if (!ok) { -break; -} - if (ok) { - if (model.opar!=list(tag)) { - needcompile = 4; - y = needcompile; -} - graphics.exprs = exprs; - model.opar = list(tag); - x.graphics = graphics; - x.model = model; -break; -} -} -needcompile=resume(needcompile) + [ok,tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); + if (!ok) { + break; + } + if (ok) { + if (model.opar!=list(tag)) { + needcompile = 4; + y = needcompile; + } + graphics.exprs = exprs; + model.opar = list(tag); + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/GotoTagVisibility.pickle b/js/Branching/GotoTagVisibility.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/GotoTagVisibility.pickle +++ b/js/Branching/GotoTagVisibility.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/GotoTagVisibilityMO.js b/js/Branching/GotoTagVisibilityMO.js index dce96fa2..03c26ad6 100644 --- a/js/Branching/GotoTagVisibilityMO.js +++ b/js/Branching/GotoTagVisibilityMO.js @@ -16,34 +16,35 @@ function GotoTagVisibilityMO() { model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } GotoTagVisibilityMO.prototype.details = function GotoTagVisibilityMO() { + return this.x; } GotoTagVisibilityMO.prototype.get = function GotoTagVisibilityMO() { } GotoTagVisibilityMO.prototype.set = function GotoTagVisibilityMO() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); - if (!ok) { -break; -} - if (ok) { - if (model.opar!=list(tag)) { - needcompile = 4; - y = needcompile; -} - graphics.exprs = exprs; - model.opar = list(tag); - x.graphics = graphics; - x.model = model; -break; -} -} -needcompile=resume(needcompile) + [ok,tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); + if (!ok) { + break; + } + if (ok) { + if (model.opar!=list(tag)) { + needcompile = 4; + y = needcompile; + } + graphics.exprs = exprs; + model.opar = list(tag); + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/Branching/GotoTagVisibilityMO.pickle b/js/Branching/GotoTagVisibilityMO.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/GotoTagVisibilityMO.pickle +++ b/js/Branching/GotoTagVisibilityMO.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/ISELECT_f.js b/js/Branching/ISELECT_f.js index e991df37..0a1789d5 100644 --- a/js/Branching/ISELECT_f.js +++ b/js/Branching/ISELECT_f.js @@ -14,34 +14,35 @@ function ISELECT_f() { model.dep_ut = [true,false]; exprs = [[string(nout)],[string(z0+1)]]; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } ISELECT_f.prototype.details = function ISELECT_f() { + return this.x; } ISELECT_f.prototype.get = function ISELECT_f() { } ISELECT_f.prototype.set = function ISELECT_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,nout,z0,exprs] = scicos_getvalue("Set parameters",[["number of outputs"],["initial connected output"]],list("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 { - [model,graphics,ok] = check_io(model,graphics,-1,-ones(nout,1),ones(nout,1),[]); - if (ok) { - graphics.exprs = exprs; - model.dstate = z0-1; - x.graphics = graphics; - x.model = model; -break; -} -} -} + [ok,nout,z0,exprs] = scicos_getvalue("Set parameters",[["number of outputs"],["initial connected output"]],list("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 { + [model,graphics,ok] = check_io(model,graphics,-1,-ones(nout,1),ones(nout,1),[]); + if (ok) { + graphics.exprs = exprs; + model.dstate = z0-1; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } } } diff --git a/js/Branching/ISELECT_f.pickle b/js/Branching/ISELECT_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/ISELECT_f.pickle +++ b/js/Branching/ISELECT_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/ISELECT_m.js b/js/Branching/ISELECT_m.js index bf117d9b..20e063a5 100644 --- a/js/Branching/ISELECT_m.js +++ b/js/Branching/ISELECT_m.js @@ -22,43 +22,44 @@ function ISELECT_m() { model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(nout)],[sci2exp(z0)]]; gr_i = []; - x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],model,exprs,gr_i); } ISELECT_m.prototype.details = function ISELECT_m() { + return this.x; } ISELECT_m.prototype.get = function ISELECT_m() { } ISELECT_m.prototype.set = function ISELECT_m() { - x = arg1; + this.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 = false; - } 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; -} -} -} -} + [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 = false; + } 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; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } + } } } diff --git a/js/Branching/ISELECT_m.pickle b/js/Branching/ISELECT_m.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/ISELECT_m.pickle +++ b/js/Branching/ISELECT_m.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/MUX.js b/js/Branching/MUX.js index 1c6c4f75..c1ac2f32 100644 --- a/js/Branching/MUX.js +++ b/js/Branching/MUX.js @@ -11,52 +11,53 @@ function MUX() { model.dep_ut = [true,false]; exprs = string(in1); gr_i = []; - x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],model,exprs,gr_i); } MUX.prototype.details = function MUX() { + return this.x; } MUX.prototype.get = function MUX() { } MUX.prototype.set = function MUX() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("intvec",-1),exprs); - if (!ok) { -break; -} - if (size(in1,"*")==1) { - if (in1<2||in1>31) { -message("Block must have at least two input ports and at most 31"); - ok = false; - } else { - [model,graphics,ok] = check_io(model,graphics,-transpose([1:in1]),0,[],[]); -} - } else { - if (size(in1,"*")<2||or(in1==0)||size(in1,"*")>31) { -message([["Block must have at least two input ports"],["and at most 31. Size 0 is not allowed. "]]); - ok = false; - } else { - if (min(in1)<0) { - nout = 0; - } else { - nout = sum(in1); -} - [model,graphics,ok] = check_io(model,graphics,in1.slice(),nout,[],[]); - if (ok) { - in1 = size(in1,"*"); -} -} -} - if (ok) { - graphics.exprs = exprs; - model.ipar = in1; - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("intvec",-1),exprs); + if (!ok) { + break; + } + if (size(in1,"*")==1) { + if (in1<2||in1>31) { + message("Block must have at least two input ports and at most 31"); + ok = false; + } else { + [model,graphics,ok] = check_io(model,graphics,-transpose([1:in1]),0,[],[]); + } + } else { + if (size(in1,"*")<2||or(in1==0)||size(in1,"*")>31) { + message([["Block must have at least two input ports"],["and at most 31. Size 0 is not allowed. "]]); + ok = false; + } else { + if (min(in1)<0) { + nout = 0; + } else { + nout = sum(in1); + } + [model,graphics,ok] = check_io(model,graphics,in1.slice(),nout,[],[]); + if (ok) { + in1 = size(in1,"*"); + } + } + } + if (ok) { + graphics.exprs = exprs; + model.ipar = in1; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/MUX.pickle b/js/Branching/MUX.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/MUX.pickle +++ b/js/Branching/MUX.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/MUX_f.js b/js/Branching/MUX_f.js index 0bc7f2f7..13cf8462 100644 --- a/js/Branching/MUX_f.js +++ b/js/Branching/MUX_f.js @@ -11,52 +11,53 @@ function MUX_f() { model.dep_ut = [true,false]; exprs = string(in1); gr_i = []; - x = standard_define([0.5,2],model,exprs,gr_i); + this.x = standard_define([0.5,2],model,exprs,gr_i); } MUX_f.prototype.details = function MUX_f() { + return this.x; } MUX_f.prototype.get = function MUX_f() { } MUX_f.prototype.set = function MUX_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("vec",-1),exprs); - if (!ok) { -break; -} - if (size(in1,"*")==1) { - if (in1<2||in1>8) { -message("Block must have at least two input ports and at most eight"); - ok = false; - } else { - [model,graphics,ok] = check_io(model,graphics,-transpose([1:in1]),0,[],[]); -} - } else { - if (size(in1,"*")<2||size(in1,"*")>8||or(in1==0)) { -message([["Block must have at least two input ports"],["and at most eight, and size 0 is not allowed. "]]); - ok = false; - } else { - if (min(in1)<0) { - nout = 0; - } else { - nout = sum(in1); -} - [model,graphics,ok] = check_io(model,graphics,in1.slice(),nout,[],[]); - if (ok) { - in1 = size(in1,"*"); -} -} -} - if (ok) { - graphics.exprs = exprs; - model.ipar = in1; - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("vec",-1),exprs); + if (!ok) { + break; + } + if (size(in1,"*")==1) { + if (in1<2||in1>8) { + message("Block must have at least two input ports and at most eight"); + ok = false; + } else { + [model,graphics,ok] = check_io(model,graphics,-transpose([1:in1]),0,[],[]); + } + } else { + if (size(in1,"*")<2||size(in1,"*")>8||or(in1==0)) { + message([["Block must have at least two input ports"],["and at most eight, and size 0 is not allowed. "]]); + ok = false; + } else { + if (min(in1)<0) { + nout = 0; + } else { + nout = sum(in1); + } + [model,graphics,ok] = check_io(model,graphics,in1.slice(),nout,[],[]); + if (ok) { + in1 = size(in1,"*"); + } + } + } + if (ok) { + graphics.exprs = exprs; + model.ipar = in1; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/MUX_f.pickle b/js/Branching/MUX_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/MUX_f.pickle +++ b/js/Branching/MUX_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/M_SWITCH.js b/js/Branching/M_SWITCH.js index 724ea1f0..80d0d0ca 100644 --- a/js/Branching/M_SWITCH.js +++ b/js/Branching/M_SWITCH.js @@ -13,51 +13,52 @@ function M_SWITCH() { model.dep_ut = [true,false]; exprs = [[string(nin)],[string(ipar)]]; gr_i = []; - x = standard_define([2.5,2],model,exprs,gr_i); + this.x = standard_define([2.5,2],model,exprs,gr_i); } M_SWITCH.prototype.details = function M_SWITCH() { + return this.x; } M_SWITCH.prototype.get = function M_SWITCH() { } M_SWITCH.prototype.set = function M_SWITCH() { - x = arg1; + this.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; -} -} -} + [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]]; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } } } diff --git a/js/Branching/M_SWITCH.pickle b/js/Branching/M_SWITCH.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/M_SWITCH.pickle +++ b/js/Branching/M_SWITCH.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/NRMSOM_f.js b/js/Branching/NRMSOM_f.js index f9fd7ffc..726320a9 100644 --- a/js/Branching/NRMSOM_f.js +++ b/js/Branching/NRMSOM_f.js @@ -11,29 +11,30 @@ function NRMSOM_f() { model.dep_ut = [true,false]; exprs = [string(nin)]; gr_i = []; - x = standard_define([.2,2],model,exprs,gr_i); + this.x = standard_define([.2,2],model,exprs,gr_i); } NRMSOM_f.prototype.details = function NRMSOM_f() { + return this.x; } NRMSOM_f.prototype.get = function NRMSOM_f() { } NRMSOM_f.prototype.set = function NRMSOM_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,nin,exprs] = scicos_getvalue("Set parameters",["number of inputs"],list("vec",1),exprs); - if (!ok) { -break; -} - [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,[],[]); - if (ok) { - graphics.exprs = exprs; - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,nin,exprs] = scicos_getvalue("Set parameters",["number of inputs"],list("vec",1),exprs); + if (!ok) { + break; + } + [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,[],[]); + if (ok) { + graphics.exprs = exprs; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/NRMSOM_f.pickle b/js/Branching/NRMSOM_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/NRMSOM_f.pickle +++ b/js/Branching/NRMSOM_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/RELAY_f.js b/js/Branching/RELAY_f.js index ca190330..71b2d9e7 100644 --- a/js/Branching/RELAY_f.js +++ b/js/Branching/RELAY_f.js @@ -15,35 +15,36 @@ function RELAY_f() { model.dep_ut = [true,true]; exprs = [[string(nin)],[string(i0+1)]]; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } RELAY_f.prototype.details = function RELAY_f() { + return this.x; } RELAY_f.prototype.get = function RELAY_f() { } RELAY_f.prototype.set = function RELAY_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; ipar = model.ipar; while (true) { - [ok,nin,z0,exprs] = scicos_getvalue("Set parameters",[["number of inputs"],["initial connected input"]],list("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 { - [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,ones(nin,1),[]); - if (ok) { - graphics.exprs = exprs; - model.dstate = z0-1; - x.graphics = graphics; - x.model = model; -break; -} -} -} + [ok,nin,z0,exprs] = scicos_getvalue("Set parameters",[["number of inputs"],["initial connected input"]],list("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 { + [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,ones(nin,1),[]); + if (ok) { + graphics.exprs = exprs; + model.dstate = z0-1; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } } } diff --git a/js/Branching/RELAY_f.pickle b/js/Branching/RELAY_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/RELAY_f.pickle +++ b/js/Branching/RELAY_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/SCALAR2VECTOR.js b/js/Branching/SCALAR2VECTOR.js index 867ef489..a1f50ede 100644 --- a/js/Branching/SCALAR2VECTOR.js +++ b/js/Branching/SCALAR2VECTOR.js @@ -10,36 +10,37 @@ function SCALAR2VECTOR() { model.dep_ut = [true,false]; exprs = [string([nout])]; gr_i = []; - x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],model,exprs,gr_i); } SCALAR2VECTOR.prototype.details = function SCALAR2VECTOR() { + return this.x; } SCALAR2VECTOR.prototype.get = function SCALAR2VECTOR() { } SCALAR2VECTOR.prototype.set = function SCALAR2VECTOR() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,nout,exprs] = scicos_getvalue("Set block parameters",["size of output (-1: if don\'t know)"],list("vec",1),exprs); - if (!ok) { -break; -} - nout = int(nout); - if ((nout!=-1&&(nout<=0))) { -message("size of output must be -1 or >0"); - ok = false; -} - if (ok) { - [model,graphics,ok] = check_io(model,graphics,[1],nout,[],[]); -} - if (ok) { - graphics.exprs = exprs; - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,nout,exprs] = scicos_getvalue("Set block parameters",["size of output (-1: if don\'t know)"],list("vec",1),exprs); + if (!ok) { + break; + } + nout = int(nout); + if ((nout!=-1&&(nout<=0))) { + message("size of output must be -1 or >0"); + ok = false; + } + if (ok) { + [model,graphics,ok] = check_io(model,graphics,[1],nout,[],[]); + } + if (ok) { + graphics.exprs = exprs; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/SCALAR2VECTOR.pickle b/js/Branching/SCALAR2VECTOR.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/SCALAR2VECTOR.pickle +++ b/js/Branching/SCALAR2VECTOR.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/SELECT_f.js b/js/Branching/SELECT_f.js index 31515a65..de1fa1fa 100644 --- a/js/Branching/SELECT_f.js +++ b/js/Branching/SELECT_f.js @@ -14,34 +14,35 @@ function SELECT_f() { model.dep_ut = [true,false]; exprs = [[string(nin)],[string(z0+1)]]; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } SELECT_f.prototype.details = function SELECT_f() { + return this.x; } SELECT_f.prototype.get = function SELECT_f() { } SELECT_f.prototype.set = function SELECT_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,nin,z0,exprs] = scicos_getvalue("Set parameters",[["number of inputs"],["initial connected input"]],list("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 { - [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,ones(nin,1),[]); - if (ok) { - graphics.exprs = exprs; - model.dstate = z0-1; - x.graphics = graphics; - x.model = model; -break; -} -} -} + [ok,nin,z0,exprs] = scicos_getvalue("Set parameters",[["number of inputs"],["initial connected input"]],list("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 { + [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,ones(nin,1),[]); + if (ok) { + graphics.exprs = exprs; + model.dstate = z0-1; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } } } diff --git a/js/Branching/SELECT_f.pickle b/js/Branching/SELECT_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/SELECT_f.pickle +++ b/js/Branching/SELECT_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/SELECT_m.js b/js/Branching/SELECT_m.js index 90fb26c3..856e759a 100644 --- a/js/Branching/SELECT_m.js +++ b/js/Branching/SELECT_m.js @@ -22,43 +22,44 @@ function SELECT_m() { model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(nin)],[sci2exp(z0)]]; gr_i = []; - x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],model,exprs,gr_i); } SELECT_m.prototype.details = function SELECT_m() { + return this.x; } SELECT_m.prototype.get = function SELECT_m() { } SELECT_m.prototype.set = function SELECT_m() { - x = arg1; + this.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 = false; - } 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; -} -} -} -} + [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 = false; + } 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; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } + } } } diff --git a/js/Branching/SELECT_m.pickle b/js/Branching/SELECT_m.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/SELECT_m.pickle +++ b/js/Branching/SELECT_m.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/SELF_SWITCH.pickle b/js/Branching/SELF_SWITCH.pickle index ad17cc4d..afd93db5 100644 --- a/js/Branching/SELF_SWITCH.pickle +++ b/js/Branching/SELF_SWITCH.pickle @@ -2,8 +2,10 @@ c__builtin__ set p0 ((lp1 -S'stateOpen' +S'x' p2 -atp3 -Rp4 +aS'stateOpen' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/Branching/SWITCH2.js b/js/Branching/SWITCH2.js index 7d9d8d50..e4e050c8 100644 --- a/js/Branching/SWITCH2.js +++ b/js/Branching/SWITCH2.js @@ -17,42 +17,43 @@ function SWITCH2() { model.dep_ut = [true,false]; exprs = [[string(ipar)],[string(rpar)],[string(nzz)]]; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } SWITCH2.prototype.details = function SWITCH2() { + return this.x; } SWITCH2.prototype.get = function SWITCH2() { } SWITCH2.prototype.set = function SWITCH2() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,rule,thra,nzz,exprs] = scicos_getvalue("Set parameters",[["pass first input if: u2>=a (0), u2>a (1), u2~=a (2)"],["threshold a"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1),exprs); - if (!ok) { -break; -} - rule = int(rule); - if ((rule<0)) { - rule = 0; -} - if ((rule>2)) { - rule = 2; -} - graphics.exprs = exprs; - model.ipar = rule; - model.rpar = thra; - if (nzz!=0) { - model.nmode = 1; - model.nzcross = 1; - } else { - model.nmode = 0; - model.nzcross = 0; -} - x.graphics = graphics; - x.model = model; -break; -} + [ok,rule,thra,nzz,exprs] = scicos_getvalue("Set parameters",[["pass first input if: u2>=a (0), u2>a (1), u2~=a (2)"],["threshold a"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1),exprs); + if (!ok) { + break; + } + rule = int(rule); + if ((rule<0)) { + rule = 0; + } + if ((rule>2)) { + rule = 2; + } + graphics.exprs = exprs; + model.ipar = rule; + model.rpar = thra; + if (nzz!=0) { + model.nmode = 1; + model.nzcross = 1; + } else { + model.nmode = 0; + model.nzcross = 0; + } + this.x.graphics = graphics; + this.x.model = model; + break; + } } } diff --git a/js/Branching/SWITCH2.pickle b/js/Branching/SWITCH2.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/SWITCH2.pickle +++ b/js/Branching/SWITCH2.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/SWITCH2_m.js b/js/Branching/SWITCH2_m.js index de8df531..29643871 100644 --- a/js/Branching/SWITCH2_m.js +++ b/js/Branching/SWITCH2_m.js @@ -20,56 +20,57 @@ function SWITCH2_m() { model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[string(ipar)],[string(rpar)],[string(nzz)]]; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } SWITCH2_m.prototype.details = function SWITCH2_m() { + return this.x; } SWITCH2_m.prototype.get = function SWITCH2_m() { } SWITCH2_m.prototype.set = function SWITCH2_m() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,ot,rule,thra,nzz,exprs] = scicos_getvalue("Set parameters",[["Datatype (1=real double 2=complex 3=int32 ...)"],["pass first input if: u2>=a (0), u2>a (1), u2~=a (2)"],["threshold a"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1,"vec",1),exprs); - if (!ok) { -break; -} - rule = int(rule); - if ((rule<0)) { - rule = 0; -} - if ((rule>2)) { - rule = 2; -} - graphics.exprs = exprs; - model.ipar = rule; - model.rpar = thra; - if (nzz!=0) { - model.nmode = 1; - model.nzcross = 1; - } else { - model.nmode = 0; - model.nzcross = 0; -} - if (((ot<1)||(ot>8))&&(ot!=-1)) { -message("Datatype is not supported"); - ok = false; -} - if (ok) { - it[1-1] = ot; - it[2-1] = 1; - it[3-1] = ot; - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -} - if (ok) { - x.graphics = graphics; - x.model = model; -break; -} -} + [ok,ot,rule,thra,nzz,exprs] = scicos_getvalue("Set parameters",[["Datatype (1=real double 2=complex 3=int32 ...)"],["pass first input if: u2>=a (0), u2>a (1), u2~=a (2)"],["threshold a"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1,"vec",1),exprs); + if (!ok) { + break; + } + rule = int(rule); + if ((rule<0)) { + rule = 0; + } + if ((rule>2)) { + rule = 2; + } + graphics.exprs = exprs; + model.ipar = rule; + model.rpar = thra; + if (nzz!=0) { + model.nmode = 1; + model.nzcross = 1; + } else { + model.nmode = 0; + model.nzcross = 0; + } + if (((ot<1)||(ot>8))&&(ot!=-1)) { + message("Datatype is not supported"); + ok = false; + } + if (ok) { + it[1-1] = ot; + it[2-1] = 1; + it[3-1] = ot; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + } + if (ok) { + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/Branching/SWITCH2_m.pickle b/js/Branching/SWITCH2_m.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/SWITCH2_m.pickle +++ b/js/Branching/SWITCH2_m.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/Branching/SWITCH_f.js b/js/Branching/SWITCH_f.js index 87b1b6e8..397de35c 100644 --- a/js/Branching/SWITCH_f.js +++ b/js/Branching/SWITCH_f.js @@ -14,35 +14,36 @@ function SWITCH_f() { model.dep_ut = [true,true]; exprs = [[string(nin)],[string(i0+1)]]; gr_i = []; - x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],model,exprs,gr_i); } SWITCH_f.prototype.details = function SWITCH_f() { + return this.x; } SWITCH_f.prototype.get = function SWITCH_f() { } SWITCH_f.prototype.set = function SWITCH_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; ipar = model.ipar; while (true) { - [ok,nin,z0,exprs] = scicos_getvalue("Set switch parameters",[["number of inputs"],["connected input"]],list("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 { - [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,[],[]); - if (ok) { - graphics.exprs = exprs; - model.ipar = z0-1; - x.graphics = graphics; - x.model = model; -break; -} -} -} + [ok,nin,z0,exprs] = scicos_getvalue("Set switch parameters",[["number of inputs"],["connected input"]],list("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 { + [model,graphics,ok] = check_io(model,graphics,-ones(nin,1),-1,[],[]); + if (ok) { + graphics.exprs = exprs; + model.ipar = z0-1; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } } } diff --git a/js/Branching/SWITCH_f.pickle b/js/Branching/SWITCH_f.pickle index 154645d8..0d1dde24 100644 --- a/js/Branching/SWITCH_f.pickle +++ b/js/Branching/SWITCH_f.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file |