diff options
536 files changed, 10600 insertions, 10009 deletions
diff --git a/combined.js b/combined.js index 501ade1a..51c461cc 100644 --- a/combined.js +++ b/combined.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Branching/CLKFROM.sci" */ function CLKFROM() { CLKFROM.prototype.define = function CLKFROM() { - model = scicos_model(); - model.sim = "clkfrom"; - model.evtout = 1; - model.opar = list("A"); - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("clkfrom"); + this.model.evtout = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = "A"; - this.x = standard_define([2,1],model,exprs," "); + this.x = standard_define([2,1],this.model,exprs," "); this.x.graphics.id = "From"; return new BasicBlock(this.x); } @@ -25,23 +25,23 @@ function CLKFROM() { this.tag = arguments[0]["tag"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set block parameters","Tag",list("str",-1),exprs); if (!ok) { break; } - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } - model.opar = list(this.tag); - model.evtout = 1; - model.firing = -1; + this.model.opar = list(this.tag); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } needcompile = resume(needcompile) @@ -51,16 +51,16 @@ function CLKFROM() { /* autogenerated from "macros/Branching/CLKGOTO.sci" */ function CLKGOTO() { 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 = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("clkgoto"); + this.model.evtin = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.ipar = new ScilabDouble(int(1)); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = [["A"],[sci2exp(1)]]; - this.x = standard_define([2,1],model,exprs," "); + this.x = standard_define([2,1],this.model,exprs," "); this.x.graphics.id = "Goto"; return new BasicBlock(this.x); } @@ -79,7 +79,7 @@ function CLKGOTO() { this.tagvis = parseFloat(arguments[0]["tagvis"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.tag,this.tagvis,exprs] = scicos_getvalue("Set block parameters",["Tag","Tag Visibility (1=Local 2=Scoped 3=Global)"],list("str",-1,"vec",1),exprs); @@ -92,17 +92,17 @@ function CLKGOTO() { } this.tagvis = int(this.tagvis); if (ok) { - if (((model.opar!=list(this.tag))||(model.ipar!=this.tagvis))) { + if (((this.model.opar!=list(this.tag))||(this.model.ipar!=this.tagvis))) { needcompile = 4; y = needcompile; } - model.opar = list(this.tag); - model.ipar = this.tagvis; - model.evtin = 1; - model.firing = -1; + this.model.opar = list(this.tag); + this.model.ipar = new ScilabDouble(this.tagvis); + this.model.evtin = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -113,22 +113,22 @@ function CLKGOTO() { /* autogenerated from "macros/Branching/CLKGotoTagVisibility.sci" */ function CLKGotoTagVisibility() { CLKGotoTagVisibility.prototype.define = function CLKGotoTagVisibility() { - model = scicos_model(); - model.sim = "clkgototagvisibility"; - model.in1 = []; - model.in2 = []; - model.out = []; - model.out2 = []; - model.evtin = []; - model.intyp = 1; - model.outtyp = 1; - model.opar = list("A"); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("clkgototagvisibility"); + this.model.in1 = []; + this.model.in2 = []; + this.model.out = []; + this.model.out2 = []; + this.model.evtin = []; + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLKGotoTagVisibility.prototype.details = function CLKGotoTagVisibility() { @@ -145,21 +145,21 @@ function CLKGotoTagVisibility() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); + this.model.opar = list(this.tag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -171,17 +171,17 @@ function CLKGotoTagVisibility() { function DEMUX() { DEMUX.prototype.define = function DEMUX() { this.out = 2; - model = scicos_model(); - model.sim = list("multiplex",4); - model.in1 = 0; - model.out = -transpose([1:this.out]); - model.ipar = this.out; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("multiplex",4); + this.model.in1 = new ScilabDouble(0); + this.model.out = -transpose([1:this.out]); + this.model.ipar = new ScilabDouble(this.out); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; exprs = string(this.out); gr_i = []; - this.x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEMUX.prototype.details = function DEMUX() { @@ -198,7 +198,7 @@ function DEMUX() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("intvec",-1),exprs); if (!ok) { @@ -209,7 +209,7 @@ function DEMUX() { 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:this.out]),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,0,-transpose([1:this.out]),[],[]); } } else { if (size(this.out,"*")<2||or(this.out==0)||size(this.out,"*")>31) { @@ -221,7 +221,7 @@ function DEMUX() { } else { nin = sum(this.out); } - [model,graphics,ok] = check_io(model,graphics,nin,this.out.slice(),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,nin,this.out.slice(),[],[]); if (ok) { this.out = size(this.out,"*"); } @@ -229,9 +229,9 @@ function DEMUX() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.out; + this.model.ipar = new ScilabDouble(this.out); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -242,17 +242,17 @@ function DEMUX() { function DEMUX_f() { DEMUX_f.prototype.define = function DEMUX_f() { this.out = 2; - model = scicos_model(); - model.sim = list("demux",1); - model.in1 = 0; - model.out = -transpose([1:this.out]); - model.ipar = this.out; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("demux",1); + this.model.in1 = new ScilabDouble(0); + this.model.out = -transpose([1:this.out]); + this.model.ipar = new ScilabDouble(this.out); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; exprs = string(this.out); gr_i = []; - this.x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEMUX_f.prototype.details = function DEMUX_f() { @@ -269,7 +269,7 @@ function DEMUX_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("vec",-1),exprs); if (!ok) { @@ -280,7 +280,7 @@ function DEMUX_f() { 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:this.out]),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,0,-transpose([1:this.out]),[],[]); } } else { if (size(this.out,"*")<2||size(this.out,"*")>8||or(this.out==0)) { @@ -292,7 +292,7 @@ function DEMUX_f() { } else { nin = sum(this.out); } - [model,graphics,ok] = check_io(model,graphics,nin,this.out.slice(),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,nin,this.out.slice(),[],[]); if (ok) { this.out = size(this.out,"*"); } @@ -300,9 +300,9 @@ function DEMUX_f() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.out; + this.model.ipar = new ScilabDouble(this.out); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -313,21 +313,21 @@ function DEMUX_f() { function ESELECT_f() { ESELECT_f.prototype.define = function ESELECT_f() { this.out = 2; - model = scicos_model(); - model.sim = list("eselect",-2); - model.in1 = 1; - model.in2 = 1; - model.intyp = -1; - model.evtin = 1; - model.evtout = ones(this.out,1); - model.blocktype = "l"; - model.firing = -ones(this.out,1); - model.dep_ut = [true,false]; - model.nmode = 0; - model.nzcross = 0; + this.model = scicos_model(); + this.model.sim = list("eselect",-2); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(ones(this.out,1)); + this.model.blocktype = new ScilabString("l"); + this.model.firing = new ScilabDouble(-ones(this.out,1)); + this.model.dep_ut = [true,false]; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); gr_i = []; - exprs = [[string(this.out)],[string(1)],[string(model.nmode)]]; - this.x = standard_define([4,2],model,exprs,gr_i); + exprs = [[string(this.out)],[string(1)],[string(this.model.nmode)]]; + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ESELECT_f.prototype.details = function ESELECT_f() { @@ -354,7 +354,7 @@ function ESELECT_f() { if (size(exprs,"*")==2) { exprs[3-1] = string(0); } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.out,this.inh,this.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) { @@ -372,15 +372,15 @@ function ESELECT_f() { if (this.out<2) { message("Block must have at least two output ports"); } else { - [model,graphics,ok] = check_io(model,graphics,1,[],this.inh,[ones(this.out,1)]); + [model,graphics,ok] = check_io(this.model,graphics,1,[],this.inh,[ones(this.out,1)]); if (ok) { graphics.exprs = exprs; - model.evtout = ones(this.out,1); - model.firing = -ones(this.out,1); + this.model.evtout = new ScilabDouble(ones(this.out,1)); + this.model.firing = new ScilabDouble(-ones(this.out,1)); this.x.graphics = graphics; - model.nmode = this.nmod; - model.nzcross = this.nmod; - this.x.model = model; + this.model.nmode = new ScilabDouble(this.nmod); + this.model.nzcross = new ScilabDouble(this.nmod); + this.x.model = this.model; break; } } @@ -392,16 +392,16 @@ function ESELECT_f() { function EXTRACTOR() { EXTRACTOR.prototype.define = function EXTRACTOR() { this.ind = 1; - model = scicos_model(); - model.sim = list("extractor",4); - model.in1 = -1; - model.out = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - model.ipar = this.ind; + this.model = scicos_model(); + this.model.sim = list("extractor",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.model.ipar = new ScilabDouble(this.ind); exprs = [sci2exp(this.ind)]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXTRACTOR.prototype.details = function EXTRACTOR() { @@ -418,7 +418,7 @@ function EXTRACTOR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.ind,exprs] = scicos_getvalue("Set block parameters",["indices to extract"],list("vec",-1),exprs); if (!ok) { @@ -426,12 +426,12 @@ function EXTRACTOR() { } this.ind = int(this.ind); this.ind = this.ind.slice(); - [model,graphics,ok] = check_io(model,graphics,[-1],size(this.ind,1),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[-1],size(this.ind,1),[],[]); if (ok) { - model.ipar = this.ind; + this.model.ipar = this.ind; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -441,21 +441,21 @@ function EXTRACTOR() { /* autogenerated from "macros/Branching/FROM.sci" */ function FROM() { FROM.prototype.define = function FROM() { - model = scicos_model(); - model.sim = "from"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = []; - model.opar = list("A"); - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("from"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = []; + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = ["A"]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.id = "From"; return new BasicBlock(this.x); } @@ -473,20 +473,20 @@ function FROM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - this.x.model = model; + this.model.opar = list(this.tag); + this.x.model = this.model; this.x.graphics = graphics; break; } @@ -498,24 +498,24 @@ function FROM() { /* autogenerated from "macros/Branching/FROMMO.sci" */ function FROMMO() { FROMMO.prototype.define = function FROMMO() { - model = scicos_model(); - model.sim = "frommo"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = []; - model.opar = list("A"); - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("frommo"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = []; + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "frommo"; mo.outputs = "n"; exprs = ["A"]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); } @@ -533,20 +533,20 @@ function FROMMO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - this.x.model = model; + this.model.opar = list(this.tag); + this.x.model = this.model; this.x.graphics = graphics; break; } @@ -558,21 +558,21 @@ function FROMMO() { /* autogenerated from "macros/Branching/GOTO.sci" */ function GOTO() { GOTO.prototype.define = function GOTO() { - model = scicos_model(); - model.sim = "goto"; - model.in1 = -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 = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("goto"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(-1); + this.model.out = []; + this.model.out2 = []; + this.model.outtyp = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(int(1)); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [["A"],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.id = "Goto"; return new BasicBlock(this.x); } @@ -592,7 +592,7 @@ function GOTO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,this.tagvis,exprs] = scicos_getvalue("Set parameters",["Tag","Tag Visibility(1=Local 2=scoped 3= global)"],list("str",-1,"vec",1),exprs); if (!ok) { @@ -604,14 +604,14 @@ function GOTO() { ok = false; } if (ok) { - if (((model.ipar!=this.tagvis)||(model.opar!=list(this.tag)))) { + if (((this.model.ipar!=this.tagvis)||(this.model.opar!=list(this.tag)))) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - model.ipar = this.tagvis; - this.x.model = model; + this.model.opar = list(this.tag); + this.model.ipar = new ScilabDouble(this.tagvis); + this.x.model = this.model; this.x.graphics = graphics; arg1 = this.x; break; @@ -624,24 +624,24 @@ function GOTO() { /* autogenerated from "macros/Branching/GOTOMO.sci" */ function GOTOMO() { GOTOMO.prototype.define = function GOTOMO() { - model = scicos_model(); - model.sim = "gotomo"; - model.in1 = -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 = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gotomo"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = []; + this.model.out = []; + this.model.out2 = []; + this.model.outtyp = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(int(1)); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "gotomo"; mo.inputs = "p"; exprs = [["A"],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); } @@ -661,7 +661,7 @@ function GOTOMO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,this.tagvis,exprs] = scicos_getvalue("Set parameters",["Tag","Tag Visibility(1=Local 2=scoped 3= global)"],list("str",-1,"vec",1),exprs); if (!ok) { @@ -673,14 +673,14 @@ function GOTOMO() { ok = false; } if (ok) { - if (((model.ipar!=this.tagvis)||(model.opar!=list(this.tag)))) { + if (((this.model.ipar!=this.tagvis)||(this.model.opar!=list(this.tag)))) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - model.ipar = this.tagvis; - this.x.model = model; + this.model.opar = list(this.tag); + this.model.ipar = new ScilabDouble(this.tagvis); + this.x.model = this.model; this.x.graphics = graphics; arg1 = this.x; break; @@ -693,22 +693,22 @@ function GOTOMO() { /* autogenerated from "macros/Branching/GotoTagVisibility.sci" */ function GotoTagVisibility() { GotoTagVisibility.prototype.define = function GotoTagVisibility() { - model = scicos_model(); - model.sim = "gototagvisibility"; - model.in1 = []; - model.in2 = []; - model.out = []; - model.out2 = []; - model.evtin = []; - model.intyp = 1; - model.outtyp = 1; - model.opar = list("A"); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gototagvisibility"); + this.model.in1 = []; + this.model.in2 = []; + this.model.out = []; + this.model.out2 = []; + this.model.evtin = []; + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GotoTagVisibility.prototype.details = function GotoTagVisibility() { @@ -725,21 +725,21 @@ function GotoTagVisibility() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); + this.model.opar = list(this.tag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -750,22 +750,22 @@ function GotoTagVisibility() { /* autogenerated from "macros/Branching/GotoTagVisibilityMO.sci" */ function GotoTagVisibilityMO() { GotoTagVisibilityMO.prototype.define = function GotoTagVisibilityMO() { - model = scicos_model(); - model.sim = "gototagvisibilitymo"; - model.in1 = []; - model.in2 = []; - model.out = []; - model.out2 = []; - model.evtin = []; - model.intyp = 1; - model.outtyp = 1; - model.opar = list("A"); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gototagvisibilitymo"); + this.model.in1 = []; + this.model.in2 = []; + this.model.out = []; + this.model.out2 = []; + this.model.evtin = []; + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GotoTagVisibilityMO.prototype.details = function GotoTagVisibilityMO() { @@ -782,21 +782,21 @@ function GotoTagVisibilityMO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); + this.model.opar = list(this.tag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -810,17 +810,17 @@ function ISELECT_f() { this.z0 = 0; out = [[-1],[-1]]; this.nout = 2; - model = scicos_model(); - model.sim = list("selector",2); - model.in1 = -1; - model.out = out; - model.evtin = ones(out); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector",2); + this.model.in1 = new ScilabDouble(-1); + this.model.out = out; + this.model.evtin = new ScilabDouble(ones(out)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nout)],[string(this.z0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ISELECT_f.prototype.details = function ISELECT_f() { @@ -839,7 +839,7 @@ function ISELECT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nout,this.z0,exprs] = scicos_getvalue("Set parameters",["number of outputs","initial connected output"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -848,12 +848,12 @@ function ISELECT_f() { if (this.z0>this.nout||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-1,-ones(this.nout,1),ones(this.nout,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,-ones(this.nout,1),ones(this.nout,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0-1; + this.model.dstate = new ScilabDouble(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -866,26 +866,26 @@ function ISELECT_m() { ISELECT_m.prototype.define = function ISELECT_m() { this.z0 = 1; this.nout = 2; - model = scicos_model(); - model.sim = list("selector_m",4); - model.out = [[-1],[-1]]; - model.out2 = [[-2],[-2]]; - model.outtyp = 1; - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.evtout = []; - model.state = []; - model.rpar = []; - model.ipar = []; - model.firing = []; - model.evtin = ones(this.nout,1); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector_m",4); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-2],[-2]]; + this.model.outtyp = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.evtout = []; + this.model.state = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.firing = []; + this.model.evtin = new ScilabDouble(ones(this.nout,1)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(this.nout)],[sci2exp(this.z0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ISELECT_m.prototype.details = function ISELECT_m() { @@ -906,7 +906,7 @@ function ISELECT_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.typ,this.nout,this.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) { @@ -923,12 +923,12 @@ function ISELECT_m() { if (ok) { out = [-ones(this.nout,1),-2*ones(this.nout,1)]; in1 = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(this.nout,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.nout,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0; + this.model.dstate = new ScilabDouble(this.z0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -941,16 +941,16 @@ function ISELECT_m() { function MUX() { MUX.prototype.define = function MUX() { this.in1 = 2; - model = scicos_model(); - model.sim = list("multiplex",4); - model.in1 = -transpose([1:this.in1]); - model.out = 0; - model.ipar = this.in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("multiplex",4); + this.model.in1 = -transpose([1:this.in1]); + this.model.out = new ScilabDouble(0); + this.model.ipar = new ScilabDouble(this.in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = string(this.in1); gr_i = []; - this.x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MUX.prototype.details = function MUX() { @@ -966,7 +966,7 @@ function MUX() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("intvec",-1),exprs); if (!ok) { @@ -977,7 +977,7 @@ function MUX() { 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:this.in1]),0,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-transpose([1:this.in1]),0,[],[]); } } else { if (size(this.in1,"*")<2||or(this.in1==0)||size(this.in1,"*")>31) { @@ -989,7 +989,7 @@ function MUX() { } else { nout = sum(this.in1); } - [model,graphics,ok] = check_io(model,graphics,this.in1.slice(),nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.in1.slice(),nout,[],[]); if (ok) { this.in1 = size(this.in1,"*"); } @@ -997,9 +997,9 @@ function MUX() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.in1; + this.model.ipar = new ScilabDouble(this.in1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1010,16 +1010,16 @@ function MUX() { function MUX_f() { MUX_f.prototype.define = function MUX_f() { this.in1 = 2; - model = scicos_model(); - model.sim = list("mux",1); - model.in1 = -transpose([1:this.in1]); - model.out = 0; - model.ipar = this.in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mux",1); + this.model.in1 = -transpose([1:this.in1]); + this.model.out = new ScilabDouble(0); + this.model.ipar = new ScilabDouble(this.in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = string(this.in1); gr_i = []; - this.x = standard_define([0.5,2],model,exprs,gr_i); + this.x = standard_define([0.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MUX_f.prototype.details = function MUX_f() { @@ -1035,7 +1035,7 @@ function MUX_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("vec",-1),exprs); if (!ok) { @@ -1046,7 +1046,7 @@ function MUX_f() { 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:this.in1]),0,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-transpose([1:this.in1]),0,[],[]); } } else { if (size(this.in1,"*")<2||size(this.in1,"*")>8||or(this.in1==0)) { @@ -1058,7 +1058,7 @@ function MUX_f() { } else { nout = sum(this.in1); } - [model,graphics,ok] = check_io(model,graphics,this.in1.slice(),nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.in1.slice(),nout,[],[]); if (ok) { this.in1 = size(this.in1,"*"); } @@ -1066,9 +1066,9 @@ function MUX_f() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.in1; + this.model.ipar = new ScilabDouble(this.in1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1081,16 +1081,16 @@ function M_SWITCH() { in1 = [[1],[-1],[-1]]; ipar = [[1],[3]]; this.nin = 2; - model = scicos_model(); - model.sim = list("mswitch",4); - model.in1 = in1; - model.out = -1; - model.ipar = ipar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mswitch",4); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = ipar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[string(ipar)]]; gr_i = []; - this.x = standard_define([2.5,2],model,exprs,gr_i); + this.x = standard_define([2.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } M_SWITCH.prototype.details = function M_SWITCH() { @@ -1111,7 +1111,7 @@ function M_SWITCH() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nin,this.base,this.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) { @@ -1137,12 +1137,12 @@ function M_SWITCH() { } it = [[-1],[-2*ones(this.nin,1)]]; ot = -2; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { graphics.exprs = exprs; - model.ipar = [[this.base],[this.rule]]; + this.model.ipar = [[this.base],[this.rule]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1155,15 +1155,15 @@ function NRMSOM_f() { NRMSOM_f.prototype.define = function NRMSOM_f() { in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = "junk"; - model.in1 = in1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("junk"); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string(this.nin)]; gr_i = []; - this.x = standard_define([.2,2],model,exprs,gr_i); + this.x = standard_define([.2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } NRMSOM_f.prototype.details = function NRMSOM_f() { @@ -1180,17 +1180,17 @@ function NRMSOM_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nin,exprs] = scicos_getvalue("Set parameters",["number of inputs"],list("vec",1),exprs); if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,[],[]); if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1203,18 +1203,18 @@ function RELAY_f() { i0 = 0; in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = list("relay",2); - model.in1 = in1; - model.out = -1; - model.evtin = ones(in1); - model.dstate = i0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,true]; + this.model = scicos_model(); + this.model.sim = list("relay",2); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(ones(in1)); + this.model.dstate = new ScilabDouble(i0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,true]; exprs = [[string(this.nin)],[string(i0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RELAY_f.prototype.details = function RELAY_f() { @@ -1233,8 +1233,8 @@ function RELAY_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; + this.model = arg1.model; + ipar = this.model.ipar; while (true) { [ok,this.nin,this.z0,exprs] = scicos_getvalue("Set parameters",["number of inputs","initial connected input"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -1243,12 +1243,12 @@ function RELAY_f() { if (this.z0>this.nin||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0-1; + this.model.dstate = new ScilabString(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1260,15 +1260,15 @@ function RELAY_f() { function SCALAR2VECTOR() { SCALAR2VECTOR.prototype.define = function SCALAR2VECTOR() { this.nout = -1; - model = scicos_model(); - model.sim = list("scalar2vector",4); - model.out = this.nout; - model.in1 = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("scalar2vector",4); + this.model.out = new ScilabDouble(this.nout); + this.model.in1 = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string([this.nout])]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SCALAR2VECTOR.prototype.details = function SCALAR2VECTOR() { @@ -1285,7 +1285,7 @@ function SCALAR2VECTOR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nout,exprs] = scicos_getvalue("Set block parameters",["size of output (-1: if don\'t know)"],list("vec",1),exprs); if (!ok) { @@ -1297,12 +1297,12 @@ function SCALAR2VECTOR() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[1],this.nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[1],this.nout,[],[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1315,17 +1315,17 @@ function SELECT_f() { this.z0 = 0; in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = list("selector",2); - model.in1 = in1; - model.out = -1; - model.evtin = ones(in1); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector",2); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(ones(in1)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[string(this.z0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SELECT_f.prototype.details = function SELECT_f() { @@ -1344,7 +1344,7 @@ function SELECT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nin,this.z0,exprs] = scicos_getvalue("Set parameters",["number of inputs","initial connected input"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -1353,12 +1353,12 @@ function SELECT_f() { if (this.z0>this.nin||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0-1; + this.model.dstate = new ScilabDouble(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1371,26 +1371,26 @@ function SELECT_m() { SELECT_m.prototype.define = function SELECT_m() { this.z0 = 1; this.nin = 2; - model = scicos_model(); - model.sim = list("selector_m",4); - model.in1 = [[-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(this.nin,1); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector_m",4); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[-2],[-2]]; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtout = []; + this.model.state = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.firing = []; + this.model.evtin = new ScilabDouble(ones(this.nin,1)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(this.nin)],[sci2exp(this.z0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SELECT_m.prototype.details = function SELECT_m() { @@ -1411,7 +1411,7 @@ function SELECT_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.typ,this.nin,this.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) { @@ -1428,12 +1428,12 @@ function SELECT_m() { if (ok) { in1 = [-ones(this.nin,1),-2*ones(this.nin,1)]; out = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(this.nin,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.nin,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0; + this.model.dstate = new ScilabDouble(this.z0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1449,19 +1449,19 @@ function SWITCH2() { ipar = [0]; this.nzz = 1; rpar = 0; - model = scicos_model(); - model.sim = list("switch2",4); - model.in1 = in1; - model.out = -1; - model.ipar = ipar; - model.rpar = rpar; - model.nzcross = this.nzz; - model.nmode = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("switch2",4); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.model.nzcross = new ScilabDouble(this.nzz); + this.model.nmode = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(ipar)],[string(rpar)],[string(this.nzz)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SWITCH2.prototype.details = function SWITCH2() { @@ -1482,7 +1482,7 @@ function SWITCH2() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.rule,this.thra,this.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) { @@ -1496,17 +1496,17 @@ function SWITCH2() { this.rule = 2; } graphics.exprs = exprs; - model.ipar = this.rule; - model.rpar = this.thra; + this.model.ipar = new ScilabDouble(this.rule); + this.model.rpar = new ScilabDouble(this.thra); if (this.nzz!=0) { - model.nmode = 1; - model.nzcross = 1; + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -1518,23 +1518,23 @@ function SWITCH2_m() { ipar = [0]; this.nzz = 1; rpar = 0; - model = scicos_model(); - model.sim = list("switch2_m",4); - model.in1 = [[-1],[1],[-1]]; - model.in2 = [[-2],[1],[-2]]; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = 1; - model.ipar = ipar; - model.rpar = rpar; - model.nzcross = this.nzz; - model.nmode = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("switch2_m",4); + this.model.in1 = [[-1],[1],[-1]]; + this.model.in2 = [[-2],[1],[-2]]; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.model.nzcross = new ScilabDouble(this.nzz); + this.model.nmode = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[string(ipar)],[string(rpar)],[string(this.nzz)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SWITCH2_m.prototype.details = function SWITCH2_m() { @@ -1557,7 +1557,7 @@ function SWITCH2_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.ot,this.rule,this.thra,this.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) { @@ -1571,14 +1571,14 @@ function SWITCH2_m() { this.rule = 2; } graphics.exprs = exprs; - model.ipar = this.rule; - model.rpar = this.thra; + this.model.ipar = new ScilabDouble(this.rule); + this.model.rpar = new ScilabDouble(this.thra); if (this.nzz!=0) { - model.nmode = 1; - model.nzcross = 1; + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } if (((this.ot<1)||(this.ot>8))&&(this.ot!=-1)) { message("Datatype is not supported"); @@ -1588,13 +1588,13 @@ function SWITCH2_m() { it[1-1] = this.ot; it[2-1] = 1; it[3-1] = this.ot; - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,this.ot),[],[]); + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,this.ot),[],[]); } if (ok) { this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1607,17 +1607,17 @@ function SWITCH_f() { i0 = 0; in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = list("switchn",2); - model.in1 = in1; - model.out = -1; - model.ipar = i0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,true]; + this.model = scicos_model(); + this.model.sim = list("switchn",2); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = new ScilabDouble(i0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,true]; exprs = [[string(this.nin)],[string(i0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SWITCH_f.prototype.details = function SWITCH_f() { @@ -1636,8 +1636,8 @@ function SWITCH_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; + this.model = arg1.model; + ipar = this.model.ipar; while (true) { [ok,this.nin,this.z0,exprs] = scicos_getvalue("Set switch parameters",["number of inputs","connected input"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -1646,12 +1646,12 @@ function SWITCH_f() { if (this.z0>this.nin||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,[],[]); if (ok) { graphics.exprs = exprs; - model.ipar = this.z0-1; + this.model.ipar = new ScilabString(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -1665,7 +1665,7 @@ function CCS() { ModelName = "CCS"; PrametersValue = []; ParametersName = []; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -1690,22 +1690,22 @@ function CCS() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = []; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2.1,3],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2.1,3],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -1722,7 +1722,7 @@ function CCS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); } @@ -1733,7 +1733,7 @@ function CVS() { ModelName = "CVS"; PrametersValue = []; ParametersName = []; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -1758,22 +1758,22 @@ function CVS() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = []; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2.1,3],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2.1,3],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -1790,7 +1790,7 @@ function CVS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); } @@ -1798,24 +1798,24 @@ function CVS() { /* autogenerated from "macros/Electrical/Capacitor.sci" */ function Capacitor() { Capacitor.prototype.define = function Capacitor() { - model = scicos_model(); + this.model = scicos_model(); this.C = 0.01; this.v = 0; - model.rpar = [[this.C],[this.v]]; - model.sim = "Capacitor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.C],[this.v]]; + this.model.sim = new ScilabString("Capacitor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Capacitor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list(["C","v"],list(this.C,this.v),[0,1]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = string([[this.C],[this.v]]); gr_i = []; - this.x = standard_define([2,1.1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1.1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -1836,17 +1836,17 @@ function Capacitor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,this.v,exprs] = scicos_getvalue("Set Capacitor block parameter",["C (F)","Initial Voltage"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = this.C; - model.equations.parameters[2-1] = list(this.C,this.v); + this.model.rpar = new ScilabDouble(this.C); + this.model.equations.parameters[('2', 'double')] = list(this.C,this.v); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -1856,22 +1856,22 @@ function Capacitor() { function ConstantVoltage() { ConstantVoltage.prototype.define = function ConstantVoltage() { this.V = 0.01; - model = scicos_model(); - model.rpar = this.V; - model.in1 = 1; - model.out = 1; - model.sim = "ConstantVoltage"; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.rpar = new ScilabDouble(this.V); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.sim = new ScilabString("ConstantVoltage"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "ConstantVoltage"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("V",list(this.V)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string(this.V); gr_i = []; - this.x = standard_define([1.5,1.1],model,exprs,list(gr_i,0)); + this.x = standard_define([1.5,1.1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -1889,17 +1889,17 @@ function ConstantVoltage() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.V,exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.V; - model.equations.parameters[2-1] = list(this.V); + this.model.rpar = new ScilabDouble(this.V); + this.model.equations.parameters[('2', 'double')] = list(this.V); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -1908,20 +1908,20 @@ function ConstantVoltage() { /* autogenerated from "macros/Electrical/CurrentSensor.sci" */ function CurrentSensor() { CurrentSensor.prototype.define = function CurrentSensor() { - model = scicos_model(); - model.in1 = 1; - model.out = [[1],[1]]; - model.sim = "CurrentSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.sim = new ScilabString("CurrentSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "CurrentSensor"; mo.inputs = "p"; mo.outputs = [["n"],["i"]]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new BasicBlock(this.x); @@ -1946,22 +1946,22 @@ function Diode() { this.Vt = 0.04; this.Maxexp = 15; this.R = 1.e8; - model = scicos_model(); - model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; - model.in1 = 1; - model.out = 1; - model.sim = "Diode"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.sim = new ScilabString("Diode"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Diode"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string([[this.Ids],[this.Vt],[this.Maxexp],[this.R]]); gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -1986,17 +1986,17 @@ function Diode() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Ids,this.Vt,this.Maxexp,this.R,exprs] = scicos_getvalue("Set Diode block parameter",["Saturation cuurent (A)","Voltage equivalent to temperature (Volt)","Max exponent for linear continuation","R (ohm)"],list("vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; - model.equations.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); + this.model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; + this.model.equations.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2005,19 +2005,19 @@ function Diode() { /* autogenerated from "macros/Electrical/Ground.sci" */ function Ground() { Ground.prototype.define = function Ground() { - model = scicos_model(); - model.in1 = [1]; - model.out = []; - model.sim = "Ground"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = []; + this.model.sim = new ScilabString("Ground"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Ground"; mo.inputs = "p"; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = ""; gr_i = []; - this.x = standard_define([1,1],model,exprs,list(gr_i,0)); + this.x = standard_define([1,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new GroundBlock(this.x); @@ -2041,7 +2041,7 @@ function Gyrator() { ModelName = "Gyrator"; PrametersValue = [[1],[1]]; ParametersName = [["G1"],["G2"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -2066,22 +2066,22 @@ function Gyrator() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["1"],["1"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -2102,7 +2102,7 @@ function Gyrator() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { @@ -2123,7 +2123,7 @@ function IdealTransformer() { ModelName = "IdealTransformer"; PrametersValue = [1]; ParametersName = ["N"]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -2148,22 +2148,22 @@ function IdealTransformer() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = ["1"]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -2182,7 +2182,7 @@ function IdealTransformer() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { @@ -2200,23 +2200,23 @@ function IdealTransformer() { /* autogenerated from "macros/Electrical/Inductor.sci" */ function Inductor() { Inductor.prototype.define = function Inductor() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.L = 1.e-5; - model.rpar = this.L; - model.sim = "Inductor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(this.L); + this.model.sim = new ScilabString("Inductor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Inductor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("L",list(this.L)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string(this.L); gr_i = []; - this.x = standard_define([2,0.9],model,exprs,list(gr_i,0)); + this.x = standard_define([2,0.9],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -2234,17 +2234,17 @@ function Inductor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.L,exprs] = scicos_getvalue("Set Inductor block parameter","L (H)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.L; - model.equations.parameters[2-1] = list(this.L); + this.model.rpar = new ScilabDouble(this.L); + this.model.equations.parameters[('2', 'double')] = list(this.L); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2253,15 +2253,15 @@ function Inductor() { /* autogenerated from "macros/Electrical/MOTOR.sci" */ function MOTOR() { MOTOR.prototype.define = function MOTOR() { - model = scicos_model(); - model.out = [[1],[1]]; - model.in1 = [1]; - model.sim = "motor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.out = [[1],[1]]; + this.model.in1 = [1]; + this.model.sim = new ScilabString("motor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; exprs = ""; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.out_implicit = [["I"],["I"]]; this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); @@ -2282,7 +2282,7 @@ function MOTOR() { /* autogenerated from "macros/Electrical/NMOS.sci" */ function NMOS() { NMOS.prototype.define = function NMOS() { - model = scicos_model(); + this.model = scicos_model(); this.W = 20.e-6; this.L = 6.e-6; this.Beta = 0.041e-3; @@ -2292,20 +2292,20 @@ function NMOS() { this.dW = -2.5e-6; this.dL = -1.5e-6; this.RDS = 1.e+7; - model.sim = "NMOS"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("NMOS"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "NMOS"; mo.outputs = [["D"],["B"],["S"]]; mo.inputs = "G"; mo.parameters = list([["W"],["L"],["Beta"],["Vt"],["K2"],["K5"],["dW"],["dL"],["RDS"]],[[this.W],[this.L],[this.Beta],[this.Vt],[this.K2],[this.K5],[this.dW],[this.dL],[this.RDS]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -2340,16 +2340,16 @@ function NMOS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set NMOS Transistor block parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); + this.model.equations.parameters[('2', 'double')] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2361,7 +2361,7 @@ function NPN() { ModelName = "NPN"; PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -2386,22 +2386,22 @@ function NPN() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -2452,7 +2452,7 @@ function NPN() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { @@ -2472,22 +2472,22 @@ function OpAmp() { OpAmp.prototype.define = function OpAmp() { S = []; Z = []; - model = scicos_model(); - model.sim = "OpAmp"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("OpAmp"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); - mo.model = model.sim; + mo.model = this.model.sim; mo.inputs = [["in_p"],["in_n"]]; mo.outputs = ["out"]; mo.parameters = list(S,Z); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - model.rpar = Z; + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.model.rpar = Z; exprs = string(Z); gr_i = []; - this.x = standard_define([3,5],model,exprs,gr_i); + this.x = standard_define([3,5],this.model,exprs,gr_i); this.x.graphics.in_implicit = [["I"],["I"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -2510,16 +2510,16 @@ function OpAmp() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (false) { [ok,this.OLGain,this.SatH,this.SatL,exprs] = scicos_getvalue("Set the Operational Amplifier parameters",["Open Loop Gain","Positive saturation voltage","Negative saturation voltage"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.OLGain,this.SatH,this.SatL); + this.model.equations.parameters[('2', 'double')] = list(this.OLGain,this.SatH,this.SatL); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2528,7 +2528,7 @@ function OpAmp() { /* autogenerated from "macros/Electrical/PMOS.sci" */ function PMOS() { PMOS.prototype.define = function PMOS() { - model = scicos_model(); + this.model = scicos_model(); this.W = 50.0e-6; this.L = 6.0e-6; this.Beta = 0.0105e-3; @@ -2538,20 +2538,20 @@ function PMOS() { this.dW = -2.5e-6; this.dL = -2.1e-6; this.RDS = 1.e+7; - model.sim = "PMOS"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("PMOS"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PMOS"; mo.outputs = [["D"],["B"],["S"]]; mo.inputs = "G"; mo.parameters = list([["W"],["L"],["Beta"],["Vt"],["K2"],["K5"],["dW"],["dL"],["RDS"]],[[this.W],[this.L],[this.Beta],[this.Vt],[this.K2],[this.K5],[this.dW],[this.dL],[this.RDS]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -2586,16 +2586,16 @@ function PMOS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set PMOS Transistor parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); + this.model.equations.parameters[('2', 'double')] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2607,7 +2607,7 @@ function PNP() { ModelName = "PNP"; PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -2632,22 +2632,22 @@ function PNP() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -2698,7 +2698,7 @@ function PNP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { @@ -2716,20 +2716,20 @@ function PNP() { /* autogenerated from "macros/Electrical/PotentialSensor.sci" */ function PotentialSensor() { PotentialSensor.prototype.define = function PotentialSensor() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; - model.rpar = []; - model.sim = "PotentialSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; + this.model.rpar = []; + this.model.sim = new ScilabString("PotentialSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PotentialSensor"; mo.inputs = "p"; mo.outputs = ["v"]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); gr_i = []; - this.x = standard_define([2,2],model,"",list(gr_i,0)); + this.x = standard_define([2,2],this.model,"",list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["E"]; return new BasicBlock(this.x); @@ -2750,23 +2750,23 @@ function PotentialSensor() { /* autogenerated from "macros/Electrical/Resistor.sci" */ function Resistor() { Resistor.prototype.define = function Resistor() { - model = scicos_model(); + this.model = scicos_model(); this.R = 0.01; - model.rpar = this.R; - model.sim = "resistor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(this.R); + this.model.sim = new ScilabString("resistor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Resistor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("R",list(this.R)); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = string(this.R); gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -2784,17 +2784,17 @@ function Resistor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.R,exprs] = scicos_getvalue("Set Resistor block parameter","R (ohm)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.R; - model.equations.parameters[2-1] = list(this.R); + this.model.rpar = new ScilabDouble(this.R); + this.model.equations.parameters[('2', 'double')] = list(this.R); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2803,27 +2803,27 @@ function Resistor() { /* autogenerated from "macros/Electrical/SineVoltage.sci" */ function SineVoltage() { SineVoltage.prototype.define = function SineVoltage() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.V = 1; this.ph = 0; this.frq = 1; this.offset = 0; this.start = 0; - model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; - model.sim = "SineVoltage"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; + this.model.sim = new ScilabString("SineVoltage"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "SineVoltage"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list([["V"],["phase"],["freqHz"],["offset"],["startTime"]],list(this.V,this.ph,this.frq,this.offset,this.start)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [[string(this.V)],[string(this.ph)],[string(this.frq)],[string(this.offset)],[string(this.start)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -2850,17 +2850,17 @@ function SineVoltage() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.V,this.ph,this.frq,this.offset,this.start,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","phase (rad)","Frequency (Hz)","Voltageoffset (V)","Timeoffset (s)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; - model.equations.parameters[2-1] = list(this.V,this.ph,this.frq,this.offset,this.start); + this.model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; + this.model.equations.parameters[('2', 'double')] = list(this.V,this.ph,this.frq,this.offset,this.start); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2869,26 +2869,26 @@ function SineVoltage() { /* autogenerated from "macros/Electrical/Switch.sci" */ function Switch() { Switch.prototype.define = function Switch() { - model = scicos_model(); + this.model = scicos_model(); this.Ron = 0.01; this.Roff = 1e5; S = [["Ron"],["Roff"]]; Z = eval(S); - model.sim = "Switch"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("Switch"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); - mo.model = model.sim; + mo.model = this.model.sim; mo.inputs = [["p"],["inp"]]; mo.outputs = "n"; mo.parameters = list(S,Z); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - model.rpar = Z; + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.model.rpar = new ScilabDouble(Z); exprs = string(Z); gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = [["I"],["E"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -2909,16 +2909,16 @@ function Switch() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Ron,this.Roff,exprs] = scicos_getvalue("Set non-ideal electrical switch parameters",["Resistance in On state (Ohm)","Resistance in Off state (Ohm)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.Ron,this.Roff); + this.model.equations.parameters[('2', 'double')] = list(this.Ron,this.Roff); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2927,24 +2927,24 @@ function Switch() { /* autogenerated from "macros/Electrical/VVsourceAC.sci" */ function VVsourceAC() { VVsourceAC.prototype.define = function VVsourceAC() { - model = scicos_model(); - model.in1 = [[1],[1]]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [[1],[1]]; + this.model.out = [1]; VA = 220; this.FR = 50; - model.rpar = [this.FR]; - model.sim = "VVsourceAC"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [this.FR]; + this.model.sim = new ScilabString("VVsourceAC"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VVsourceAC"; mo.inputs = ["p","VA"]; mo.outputs = "n"; mo.parameters = list(["f"],list(this.FR)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [string(this.FR)]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -2963,17 +2963,17 @@ function VVsourceAC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Frequency (Hz)"],list("vec",-1),exprs); if (!ok) { break; } - model.rpar = [this.FR]; - model.equations.parameters[2-1] = list(this.FR); + this.model.rpar = [this.FR]; + this.model.equations.parameters[('2', 'double')] = list(this.FR); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -2982,20 +2982,20 @@ function VVsourceAC() { /* autogenerated from "macros/Electrical/VariableResistor.sci" */ function VariableResistor() { VariableResistor.prototype.define = function VariableResistor() { - model = scicos_model(); - model.sim = "VariableResistor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("VariableResistor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VariableResistor"; mo.inputs = ["p","R"]; mo.outputs = "n"; - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -3016,20 +3016,20 @@ function VariableResistor() { /* autogenerated from "macros/Electrical/VoltageSensor.sci" */ function VoltageSensor() { VoltageSensor.prototype.define = function VoltageSensor() { - model = scicos_model(); - model.in1 = 1; - model.out = [[1],[1]]; - model.sim = "VoltageSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.sim = new ScilabString("VoltageSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VoltageSensor"; mo.inputs = "p"; mo.outputs = [["n"],["v"]]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new VoltageSensorBlock(this.x); @@ -3050,24 +3050,24 @@ function VoltageSensor() { /* autogenerated from "macros/Electrical/VsourceAC.sci" */ function VsourceAC() { VsourceAC.prototype.define = function VsourceAC() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.VA = 220; this.FR = 50; - model.rpar = [[this.VA],[this.FR]]; - model.sim = "VsourceAC"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.VA],[this.FR]]; + this.model.sim = new ScilabString("VsourceAC"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VsourceAC"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list([["VA"],["f"]],list(this.VA,this.FR)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [[string(this.VA)],[string(this.FR)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -3088,17 +3088,17 @@ function VsourceAC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.VA,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","Frequency (Hz)"],list("vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.VA],[this.FR]]; - model.equations.parameters[2-1] = list(this.VA,this.FR); + this.model.rpar = [[this.VA],[this.FR]]; + this.model.equations.parameters[('2', 'double')] = list(this.VA,this.FR); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -3189,15 +3189,15 @@ function ANDBLK() { /* autogenerated from "macros/Events/ANDLOG_f.sci" */ function ANDLOG_f() { ANDLOG_f.prototype.define = function ANDLOG_f() { - model = scicos_model(); - model.sim = "andlog"; - model.out = 1; - model.evtin = [[1],[1]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("andlog"); + this.model.out = new ScilabDouble(1); + this.model.evtin = [[1],[1]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([3,3],model,[],gr_i); + this.x = standard_define([3,3],this.model,[],gr_i); return new BasicBlock(this.x); } ANDLOG_f.prototype.details = function ANDLOG_f() { @@ -3216,15 +3216,15 @@ function ANDLOG_f() { /* autogenerated from "macros/Events/CLKSOMV_f.sci" */ function CLKSOMV_f() { CLKSOMV_f.prototype.define = function CLKSOMV_f() { - model = scicos_model(); - model.sim = "sum"; - model.evtin = [[1],[1],[1]]; - model.evtout = 1; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sum"); + this.model.evtin = [[1],[1],[1]]; + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } CLKSOMV_f.prototype.details = function CLKSOMV_f() { @@ -3243,15 +3243,15 @@ function CLKSOMV_f() { /* autogenerated from "macros/Events/CLKSOM_f.sci" */ function CLKSOM_f() { CLKSOM_f.prototype.define = function CLKSOM_f() { - model = scicos_model(); - model.sim = "sum"; - model.evtin = [[1],[1],[1]]; - model.evtout = 1; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sum"); + this.model.evtin = [[1],[1],[1]]; + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([1,1]/1.2,model,[],gr_i); + this.x = standard_define([1,1]/1.2,this.model,[],gr_i); return new BasicBlock(this.x); } CLKSOM_f.prototype.details = function CLKSOM_f() { @@ -3270,14 +3270,14 @@ function CLKSOM_f() { /* autogenerated from "macros/Events/CLKSPLIT_f.sci" */ function CLKSPLIT_f() { CLKSPLIT_f.prototype.define = function CLKSPLIT_f() { - model = scicos_model(); - model.sim = "split"; - model.evtin = 1; - model.evtout = [[1],[1]]; - model.blocktype = "d"; - model.firing = [false,false,false]; - model.dep_ut = [false,false]; - this.x = standard_define([1,1]/3,model,[],[]); + this.model = scicos_model(); + this.model.sim = new ScilabString("split"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = [false,false,false]; + this.model.dep_ut = [false,false]; + this.x = standard_define([1,1]/3,this.model,[],[]); return new BasicBlock(this.x); } CLKSPLIT_f.prototype.details = function CLKSPLIT_f() { @@ -3297,16 +3297,16 @@ function CLKSPLIT_f() { function END_c() { END_c.prototype.define = function END_c() { this.tf = 100000000; - model = scicos_model(); - model.sim = list("scicosexit",4); - model.evtin = 1; - model.evtout = 1; - model.firing = this.tf; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("scicosexit",4); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(this.tf); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = string(this.tf); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } END_c.prototype.details = function END_c() { @@ -3323,7 +3323,7 @@ function END_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tf,exprs] = scicos_getvalue("Set final simulation time",["Final simulation time"],list("vec",1),exprs); if (!ok) { @@ -3331,9 +3331,9 @@ function END_c() { } if (ok) { graphics.exprs = exprs; - model.firing = this.tf; + this.model.firing = new ScilabDouble(this.tf); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -3345,17 +3345,17 @@ function EVTDLY_c() { EVTDLY_c.prototype.define = function EVTDLY_c() { this.dt = 0.1; this.ff = 0.0; - model = scicos_model(); - model.sim = list("evtdly4",4); - model.evtin = 1; - model.evtout = 1; - model.rpar = [[this.dt],[this.ff]]; - model.blocktype = "d"; - model.firing = this.ff; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("evtdly4",4); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[this.dt],[this.ff]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(this.ff); + this.model.dep_ut = [false,false]; exprs = [[string(this.dt)],[sci2exp(this.ff)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTDLY_c.prototype.details = function EVTDLY_c() { @@ -3374,7 +3374,7 @@ function EVTDLY_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.dt,this.ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" to disable any output event."]],["Delay","Date of initial output event"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -3386,10 +3386,10 @@ function EVTDLY_c() { } if (ok) { graphics.exprs = exprs; - model.rpar = [[this.dt],[this.ff]]; - model.firing = this.ff; + this.model.rpar = [[this.dt],[this.ff]]; + this.model.firing = new ScilabDouble(this.ff); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -3401,17 +3401,17 @@ function EVTDLY_f() { EVTDLY_f.prototype.define = function EVTDLY_f() { this.dt = 0.1; this.ff = this.dt; - model = scicos_model(); - model.sim = "evtdly"; - model.evtin = 1; - model.evtout = 1; - model.rpar = this.dt; - model.blocktype = "d"; - model.firing = this.ff; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("evtdly"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.dt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(this.ff); + this.model.dep_ut = [false,false]; exprs = [[string(this.dt)],[sci2exp(this.ff)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTDLY_f.prototype.details = function EVTDLY_f() { @@ -3430,7 +3430,7 @@ function EVTDLY_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.dt,this.ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" if no initial event required"]],["Delay","Date of initial output event"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -3442,10 +3442,10 @@ function EVTDLY_f() { } if (ok) { graphics.exprs = exprs; - model.rpar = this.dt; - model.firing = this.ff; + this.model.rpar = new ScilabDouble(this.dt); + this.model.firing = new ScilabDouble(this.ff); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -3456,15 +3456,15 @@ function EVTDLY_f() { function EVTGEN_f() { EVTGEN_f.prototype.define = function EVTGEN_f() { this.tt = 0; - model = scicos_model(); - model.sim = "trash"; - model.evtout = 1; - model.blocktype = "d"; - model.firing = this.tt; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("trash"); + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(this.tt); + this.model.dep_ut = [false,false]; exprs = string(this.tt); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTGEN_f.prototype.details = function EVTGEN_f() { @@ -3481,18 +3481,18 @@ function EVTGEN_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tt,exprs] = scicos_getvalue("Set Event time",["Event Time"],list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - if (model.firing!=this.tt) { - model.firing = this.tt; + if (this.model.firing!=this.tt) { + this.model.firing = new ScilabDouble(this.tt); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -3501,18 +3501,18 @@ function EVTGEN_f() { /* autogenerated from "macros/Events/EVTVARDLY.sci" */ function EVTVARDLY() { EVTVARDLY.prototype.define = function EVTVARDLY() { - model = scicos_model(); - model.sim = list("evtvardly",4); - model.in1 = 1; - model.evtin = 1; - model.evtout = 1; - model.blocktype = "d"; - model.firing = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - exprs = string(model.firing); + this.model = scicos_model(); + this.model.sim = list("evtvardly",4); + this.model.in1 = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + exprs = string(this.model.firing); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTVARDLY.prototype.details = function EVTVARDLY() { @@ -3528,16 +3528,16 @@ function EVTVARDLY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.fir,exprs] = scicos_getvalue("Set parameter of variable event delay","Initial event firing time (<0 if absent)",list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - model.firing = this.fir; + this.model.firing = new ScilabDouble(this.fir); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -3547,16 +3547,16 @@ function EVTVARDLY() { function HALT_f() { HALT_f.prototype.define = function HALT_f() { this.n = 0; - model = scicos_model(); - model.sim = "hltblk"; - model.evtin = 1; - model.dstate = 0; - model.ipar = 0; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("hltblk"); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.ipar = new ScilabDouble(0); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = string(this.n); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } HALT_f.prototype.details = function HALT_f() { @@ -3573,7 +3573,7 @@ function HALT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.n,exprs] = scicos_getvalue("Set Halt block parameters",["State on halt"],list("vec",1),exprs); if (!ok) { @@ -3581,9 +3581,9 @@ function HALT_f() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.n; + this.model.ipar = new ScilabDouble(this.n); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -3593,21 +3593,21 @@ function HALT_f() { /* autogenerated from "macros/Events/IFTHEL_f.sci" */ function IFTHEL_f() { IFTHEL_f.prototype.define = function IFTHEL_f() { - model = scicos_model(); - model.sim = list("ifthel",-1); - model.in1 = 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,false]; - model.nmode = 1; - model.nzcross = 1; + this.model = scicos_model(); + this.model.sim = list("ifthel",-1); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.blocktype = new ScilabString("l"); + this.model.firing = [-1,-1]; + this.model.dep_ut = [true,false]; + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); gr_i = []; - exprs = [[string(model.in1)],[string(model.nmode)]]; - this.x = standard_define([3,3],model,exprs,gr_i); + exprs = [[string(this.model.in1)],[string(this.model.nmode)]]; + this.x = standard_define([3,3],this.model,exprs,gr_i); return new BasicBlock(this.x); } IFTHEL_f.prototype.details = function IFTHEL_f() { @@ -3626,7 +3626,7 @@ function IFTHEL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (exprs==[]) { exprs = string(1); } @@ -3638,22 +3638,22 @@ function IFTHEL_f() { if (!ok) { break; } - model.dep_ut = [true,false]; + this.model.dep_ut = [true,false]; if (this.nmod!=0) { this.nmod = 1; } if (this.inh!=1) { this.inh = []; } - [model,graphics,ok] = check_io(model,graphics,1,[],this.inh,[[1],[1]]); + [model,graphics,ok] = check_io(this.model,graphics,1,[],this.inh,[[1],[1]]); if (ok) { graphics.exprs = exprs; - model.evtin = this.inh; - model.sim[2-1] = -1; - model.nmode = this.nmod; - model.nzcross = this.nmod; + this.model.evtin = this.inh; + this.model.sim[('2', 'double')] = new ScilabDouble(-1); + this.model.nmode = new ScilabDouble(this.nmod); + this.model.nzcross = new ScilabDouble(this.nmod); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -3766,19 +3766,19 @@ function MFCLCK_f() { MFCLCK_f.prototype.define = function MFCLCK_f() { this.nn = 2; this.dt = 0.1; - model = scicos_model(); - model.sim = "mfclck"; - model.evtin = 1; - model.evtout = [[1],[1]]; - model.dstate = 0; - model.rpar = this.dt; - model.ipar = this.nn; - model.blocktype = "d"; - model.firing = [-1,0]; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("mfclck"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.dstate = new ScilabDouble(0); + this.model.rpar = new ScilabDouble(this.dt); + this.model.ipar = new ScilabDouble(this.nn); + this.model.blocktype = new ScilabString("d"); + this.model.firing = [-1,0]; + this.model.dep_ut = [false,false]; exprs = [[string(this.dt)],[string(this.nn)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MFCLCK_f.prototype.details = function MFCLCK_f() { @@ -3797,17 +3797,17 @@ function MFCLCK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; [ok,this.dt,this.nn,exprs] = scicos_getvalue("Set Multifrequency clock parameters",["basic period (1/f)","multiply by (n)"],list("vec",1,"vec",1),exprs); if (ok) { - model.ipar = this.nn; - model.rpar = this.dt; - hh = model.firing; + this.model.ipar = new ScilabDouble(this.nn); + this.model.rpar = new ScilabDouble(this.dt); + hh = this.model.firing; hh[2-1] = 0; - model.firing = hh; + this.model.firing = hh; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; } return new BasicBlock(this.x); } @@ -3815,18 +3815,18 @@ function MFCLCK_f() { /* autogenerated from "macros/Events/M_freq.sci" */ function M_freq() { M_freq.prototype.define = function M_freq() { - model = scicos_model(); - model.sim = list("m_frequ",4); - model.evtout = [[1],[1],[1]]; - model.evtin = 1; - model.rpar = []; - model.opar = list([[1,1,0],[1,1,1],[1,3,2]],1,0,0); - model.blocktype = "d"; - model.firing = [0,-1,-1]; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("m_frequ",4); + this.model.evtout = [[1],[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = []; + this.model.opar = list([[1,1,0],[1,1,1],[1,3,2]],1,0,0); + this.model.blocktype = new ScilabString("d"); + this.model.firing = [0,-1,-1]; + this.model.dep_ut = [false,false]; exprs = [[sci2exp([[1],[2]])],[sci2exp([[0],[0]])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } M_freq.prototype.details = function M_freq() { @@ -3844,7 +3844,7 @@ function M_freq() { this.offset = inverse(arguments[0]["offset"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",-1,"vec",-1),exprs); @@ -3867,18 +3867,18 @@ function M_freq() { [m,den,off,count,m1,fir,this.frequ,this.offset,ok] = mfrequ_clk(this.frequ,this.offset); } if (ok) { - model.opar = list(m,double(den),off,count); + this.model.opar = list(m,double(den),off,count); mn = (2^size(m1,"*"))-1; - [model,graphics,ok] = set_io(model,graphics,list(),list(),1,ones(mn,1)); + [model,graphics,ok] = set_io(this.model,graphics,list(),list(),1,ones(mn,1)); if (mn>3) { graphics.sz = [40+(mn-3)*10,40]; } else { graphics.sz = [50,40]; } - model.firing = fir; + this.model.firing = new ScilabDouble(fir); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -3888,16 +3888,16 @@ function M_freq() { /* autogenerated from "macros/Events/VirtualCLK0.sci" */ function VirtualCLK0() { VirtualCLK0.prototype.define = function VirtualCLK0() { - model = scicos_model(); - model.sim = "vrtclk0"; - model.evtin = 1; - model.opar = list(); - model.ipar = []; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("vrtclk0"); + this.model.evtin = new ScilabDouble(1); + this.model.opar = list(); + this.model.ipar = []; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = []; - this.x = standard_define([2,2],model,exprs," "); + this.x = standard_define([2,2],this.model,exprs," "); return new BasicBlock(this.x); } VirtualCLK0.prototype.details = function VirtualCLK0() { @@ -3929,61 +3929,61 @@ function freq_div() { scs_m_1.objs[10-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,-100]; graphics.sz = [60,40]; graphics.exprs = [["0"],["3"]]; - model.dstate = 3; - model.ipar = 3; + this.model.dstate = new ScilabDouble(3); + this.model.ipar = new ScilabDouble(3); graphics.pout = 7; graphics.pein = 10; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [120,0]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.peout = 6; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; blk = scs_m_1.objs[3-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [130,-160]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pein = 8; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[3-1] = blk; blk = scs_m_1.objs[4-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [100,-100]; graphics.sz = [60,40]; graphics.exprs = [["1"],["0"]]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pin = 7; graphics.pein = 9; graphics.peout = [[0],[8]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[4-1] = blk; blk = scs_m_1.objs[5-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [127,-33]; graphics.sz = [7,7]; graphics.pein = 6; graphics.peout = [[9],[10]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[5-1] = blk; lnk = scs_m_1.objs[6-1]; lnk.ct = [5,-1]; @@ -4013,13 +4013,13 @@ function freq_div() { scs_m_1.objs[10-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.evtin = 1; - model.evtout = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } freq_div.prototype.details = function freq_div() { @@ -4053,7 +4053,7 @@ function freq_div() { xxn = xx; graphics = xx.graphics; exprs = graphics.exprs; - model = xx.model; + this.model = xx.model; while (true) { [ok,%ph,%df,exprs] = scicos_getvalue("Set frequency division block parameters",["Phase (0 to division factor -1)","Division factor"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -4068,45 +4068,45 @@ function freq_div() { %ph = %df-1; } graphics.exprs = exprs; - model.ipar = %df; - model.dstate = %ph; + this.model.ipar = new ScilabDouble(%df); + this.model.dstate = new ScilabDouble(%ph); xxn.graphics = graphics; - xxn.model = model; + xxn.model = this.model; break; } } if (diffobjs(xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; @@ -4126,9 +4126,9 @@ function Bache() { Bache.prototype.define = function Bache() { in1 = 2; out = 3; - model = scicos_model(); - model.in1 = [-transpose([1:in1])]; - model.out = [-transpose([1:out])]; + this.model = scicos_model(); + this.model.in1 = [-transpose([1:in1])]; + this.model.out = [-transpose([1:out])]; this.Patm = 1.013e5; this.A = 1; this.ze1 = 40; @@ -4138,21 +4138,21 @@ function Bache() { this.z0 = 30; this.T0 = 290; this.p_rho = 0; - model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; - model.sim = "Bache"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; + this.model.sim = new ScilabString("Bache"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Bache"; mo.inputs = ["Ce1","Ce2"]; mo.outputs = ["Cs1","Cs2","yNiveau"]; mo.parameters = list([["Patm"],["A"],["ze1"],["ze2"],["zs1"],["zs2"],["z0"],["T0"],["p_rho"]],[[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.Patm)],[string(this.A)],[string(this.ze1)],[string(this.ze2)],[string(this.zs1)],[string(this.zs2)],[string(this.z0)],[string(this.T0)],[string(this.p_rho)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = [["I"],["I"]]; this.x.graphics.out_implicit = [["I"],["I"],["E"]]; return new BasicBlock(this.x); @@ -4187,17 +4187,17 @@ function Bache() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Patm,this.A,this.ze1,this.ze2,this.zs1,this.zs2,this.z0,this.T0,this.p_rho,exprs] = scicos_getvalue("Parametres de la bache",["Pression dans le ciel de la bache : Patm (Pa)","Section de la bache : A (m2)","Altitude du piquage d entrée 1: ze1 (m)","Altitude du piquage d entrée 2: ze2 (m)","Altitude du piquage de sortie 1: zs1 (m)","Altitude du piquage de sortie 2: zs2 (m)","Altitude initiale du fluide : z0 (m)","Température initiale du fluide : T0 (K)","Si >0, masse volumique imposée du fluide : p_rho (kg/m3)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; - model.equations.parameters[2-1] = list(this.Patm,this.A,this.ze1,this.ze2,this.zs1,this.zs2,this.z0,this.T0,this.p_rho); + this.model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; + this.model.equations.parameters[('2', 'double')] = list(this.Patm,this.A,this.ze1,this.ze2,this.zs1,this.zs2,this.z0,this.T0,this.p_rho); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -4209,7 +4209,7 @@ function Flowmeter() { ModelName = "Flowmeter"; PrametersValue = 1; ParametersName = "Qini"; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -4234,22 +4234,22 @@ function Flowmeter() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = new ScilabDouble(PrametersValue); mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = "1"; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -4267,7 +4267,7 @@ function Flowmeter() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (false) { @@ -4285,30 +4285,30 @@ function Flowmeter() { /* autogenerated from "macros/Hydraulics/PerteDP.sci" */ function PerteDP() { PerteDP.prototype.define = function PerteDP() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.L = 10; this.D = 0.2; this.lambda = 0.03; this.z1 = 0; this.z2 = 0; this.p_rho = 0; - model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; - model.sim = "PerteDP"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; + this.model.sim = new ScilabString("PerteDP"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PerteDP"; mo.inputs = "C1"; mo.outputs = "C2"; mo.parameters = list([["L"],["D"],["lambda"],["z1"],["z2"],["p_rho"]],[[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.L)],[string(this.D)],[string(this.lambda)],[string(this.z1)],[string(this.z2)],[string(this.p_rho)]]; gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -4337,17 +4337,17 @@ function PerteDP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho,exprs] = scicos_getvalue("Parametres du tuyau",["Longueur du tube : L (m)","Diamètre interne du tube : D (m)","Coefficient de perte de charge-frottement(S.U) : lambda","Altitude entrée tuyauterie : z1 (m)","Altitude sortie tuyauterie : z2 (m)","Si >0, masse volumique imposée fu fluide : p_rho (kg/m3)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; - model.equations.parameters[2-1] = list(this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho); + this.model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; + this.model.equations.parameters[('2', 'double')] = list(this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -4356,24 +4356,24 @@ function PerteDP() { /* autogenerated from "macros/Hydraulics/PuitsP.sci" */ function PuitsP() { PuitsP.prototype.define = function PuitsP() { - model = scicos_model(); + this.model = scicos_model(); this.P0 = 100000; this.T0 = 290; this.H0 = 100000; this.option_temperature = 1; - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.sim = "Puits"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.sim = new ScilabString("Puits"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Puits"; mo.inputs = ["C"]; mo.parameters = list([["P0"],["T0"],["H0"],["option_temperature"]],[[this.P0],[this.T0],[this.H0],[this.option_temperature]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); exprs = [[string(this.P0)],[string(this.T0)],[string(this.H0)],[string(this.option_temperature)]]; gr_i = []; - this.x = standard_define([2.5,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2.5,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); } @@ -4397,17 +4397,17 @@ function PuitsP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.P0,this.T0,this.H0,this.option_temperature,exprs] = scicos_getvalue("Paramètres du puits",["Pression de la source : P0 (Pa)","Temperature de la source : T0 (K)","Enthalpie spécifique de la source : H0 (J/kg)","1:température fixée - 2:enthalpie fixée : option_temperature"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.equations.parameters[2-1] = list(this.P0,this.T0,this.H0,this.option_temperature); + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.equations.parameters[('2', 'double')] = list(this.P0,this.T0,this.H0,this.option_temperature); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -4416,26 +4416,26 @@ function PuitsP() { /* autogenerated from "macros/Hydraulics/SourceP.sci" */ function SourceP() { SourceP.prototype.define = function SourceP() { - model = scicos_model(); + this.model = scicos_model(); this.P0 = 300000; this.T0 = 290; this.H0 = 100000; this.option_temperature = 1; - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.sim = "Source"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.sim = new ScilabString("Source"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Source"; mo.inputs = []; mo.outputs = ["C"]; mo.parameters = list([["P0"],["T0"],["H0"],["option_temperature"]],[[this.P0],[this.T0],[this.H0],[this.option_temperature]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.P0)],[string(this.T0)],[string(this.H0)],[string(this.option_temperature)]]; gr_i = []; - this.x = standard_define([2.5,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2.5,2],this.model,exprs,list(gr_i,0)); this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); } @@ -4459,17 +4459,17 @@ function SourceP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.P0,this.T0,this.H0,this.option_temperature,exprs] = scicos_getvalue("Paramètres du puits",["Pression de la source : P0 (Pa)","Temperature de la source : T0 (K)","Enthalpie spécifique de la source : H0 (J/kg)","1:température fixée - 2:enthalpie fixée : option_temperature"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.equations.parameters[2-1] = list(this.P0,this.T0,this.H0,this.option_temperature); + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.equations.parameters[('2', 'double')] = list(this.P0,this.T0,this.H0,this.option_temperature); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -4478,26 +4478,26 @@ function SourceP() { /* autogenerated from "macros/Hydraulics/VanneReglante.sci" */ function VanneReglante() { VanneReglante.prototype.define = function VanneReglante() { - model = scicos_model(); - model.in1 = [[1],[1]]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [[1],[1]]; + this.model.out = [1]; this.Cvmax = 8005.42; this.p_rho = 0; - model.rpar = [[this.Cvmax],[this.p_rho]]; - model.sim = "VanneReglante"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.Cvmax],[this.p_rho]]; + this.model.sim = new ScilabString("VanneReglante"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VanneReglante"; mo.inputs = ["C1","Ouv"]; mo.outputs = "C2"; mo.parameters = list([["Cvmax"],["p_rho"]],[[this.Cvmax],[this.p_rho]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.Cvmax)],[string(this.p_rho)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = [["I"],["E"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -4518,17 +4518,17 @@ function VanneReglante() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Cvmax,this.p_rho,exprs] = scicos_getvalue("Paramètres de la vanne reglante",["Cvmax","p_rho"],list("vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.Cvmax],[this.p_rho]]; - model.equations.parameters[2-1] = list(this.Cvmax,this.p_rho); + this.model.rpar = [[this.Cvmax],[this.p_rho]]; + this.model.equations.parameters[('2', 'double')] = list(this.Cvmax,this.p_rho); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -4537,20 +4537,20 @@ function VanneReglante() { /* autogenerated from "macros/IntegerOp/BITCLEAR.sci" */ function BITCLEAR() { BITCLEAR.prototype.define = function BITCLEAR() { - model = scicos_model(); - model.sim = list("bit_clear_32",4); - model.in1 = 1; - model.in2 = 1; - model.out = 1; - model.out2 = 1; - model.intyp = 3; - model.outtyp = 3; - model.opar = list(int32(0)); - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("bit_clear_32",4); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.opar = list(int32(0)); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BITCLEAR.prototype.details = function BITCLEAR() { @@ -4569,13 +4569,13 @@ function BITCLEAR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITCLEAR")],[" "],["Clear a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; if (floor(this.bit)!=this.bit) { block_parameter_error(msprintf("Wrong type for \'%s\' parameter: %5.1f.","Index of Bit",this.bit),"Must be integer."); ok = false; @@ -4587,7 +4587,7 @@ function BITCLEAR() { this.bit = uint32(this.bit); n = (2^32-1)-2^this.bit; n = uint32(n); - model.sim = list("bit_clear_32",4); + this.model.sim = list("bit_clear_32",4); } } else if ((this.Datatype==4)||(this.Datatype==7)) { if (this.bit>15||this.bit<0) { @@ -4597,7 +4597,7 @@ function BITCLEAR() { this.bit = uint16(this.bit); n = (2^16-1)-2^this.bit; n = uint16(n); - model.sim = list("bit_clear_16",4); + this.model.sim = list("bit_clear_16",4); } } else if ((this.Datatype==5)||(this.Datatype==8)) { if (this.bit>7||this.bit<0) { @@ -4607,7 +4607,7 @@ function BITCLEAR() { this.bit = uint8(this.bit); n = (2^8-1)-2^this.bit; n = uint8(n); - model.sim = list("bit_clear_8",4); + this.model.sim = list("bit_clear_8",4); } } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",this.Datatype),msprintf("Must be in the interval %s.","[3, 8]")); @@ -4617,13 +4617,13 @@ function BITCLEAR() { it = this.Datatype; ot = this.Datatype; out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { graphics.exprs = exprs; - model.opar = list(n); + this.model.opar = list(n); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -4633,20 +4633,20 @@ function BITCLEAR() { /* autogenerated from "macros/IntegerOp/BITSET.sci" */ function BITSET() { BITSET.prototype.define = function BITSET() { - model = scicos_model(); - model.sim = list("bit_set_32",4); - model.in1 = 1; - model.in2 = 1; - model.out = 1; - model.out2 = 1; - model.intyp = 3; - model.outtyp = 3; - model.opar = list(uint32(0)); - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("bit_set_32",4); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.opar = list(uint32(0)); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BITSET.prototype.details = function BITSET() { @@ -4665,13 +4665,13 @@ function BITSET() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITSET")],[" "],["Set a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; if (floor(this.bit)!=this.bit) { block_parameter_error(msprintf("Wrong type for \'%s\' parameter: %5.1f.","Index of Bit",this.bit),"Must be integer."); ok = false; @@ -4684,7 +4684,7 @@ function BITSET() { this.bit = uint32(this.bit); n = 2^this.bit; n = uint32(n); - model.sim = list("bit_set_32",4); + this.model.sim = list("bit_set_32",4); } else if ((this.Datatype==4)||(this.Datatype==7)) { if (this.bit>15||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 15]")); @@ -4693,7 +4693,7 @@ function BITSET() { this.bit = uint16(this.bit); n = 2^this.bit; n = uint16(n); - model.sim = list("bit_set_16",4); + this.model.sim = list("bit_set_16",4); } else if ((this.Datatype==5)||(this.Datatype==8)) { if (this.bit>7||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 7]")); @@ -4702,7 +4702,7 @@ function BITSET() { this.bit = uint8(this.bit); n = 2^this.bit; n = uint8(n); - model.sim = list("bit_set_8",4); + this.model.sim = list("bit_set_8",4); } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",this.Datatype),msprintf("Must be in the interval %s.","[3, 8]")); ok = false; @@ -4711,13 +4711,13 @@ function BITSET() { it = this.Datatype; ot = this.Datatype; out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { graphics.exprs = exprs; - model.opar = list(n); + this.model.opar = list(n); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -4728,21 +4728,21 @@ function BITSET() { function CONVERT() { CONVERT.prototype.define = function CONVERT() { sgn = 2; - model = scicos_model(); - model.sim = list("convert",4); - model.in1 = -1; - model.out = -1; - model.in2 = -2; - model.out2 = -2; - model.intyp = 1; - model.outtyp = 3; - model.rpar = []; - model.ipar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("convert",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(3); + this.model.rpar = []; + this.model.ipar = new ScilabDouble(sgn); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONVERT.prototype.details = function CONVERT() { @@ -4762,7 +4762,7 @@ function CONVERT() { this.np = arguments[0]["np"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.it,this.ot,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONVERT")],[" "],["Type conversion"],[" "]],["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1,"vec",1),exprs); @@ -4785,321 +4785,321 @@ function CONVERT() { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Output Type",this.ot),msprintf("Must be in the interval %s.","[1, 8]")); ok = false; } - model.sim = list("convert",4); + this.model.sim = list("convert",4); if ((this.it==this.ot)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else { if ((this.np==0)) { if ((this.it==1)) { if ((this.ot==3)) { - model.ipar = 2; + this.model.ipar = new ScilabDouble(2); } else if ((this.ot==4)) { - model.ipar = 3; + this.model.ipar = new ScilabDouble(3); } else if ((this.ot==5)) { - model.ipar = 4; + this.model.ipar = new ScilabDouble(4); } else if ((this.ot==6)) { - model.ipar = 5; + this.model.ipar = new ScilabDouble(5); } else if ((this.ot==7)) { - model.ipar = 6; + this.model.ipar = new ScilabDouble(6); } else if ((this.ot==8)) { - model.ipar = 7; + this.model.ipar = new ScilabDouble(7); } } else if ((this.it==3)) { if ((this.ot==1)) { - model.ipar = 8; + this.model.ipar = new ScilabDouble(8); } else if ((this.ot==4)) { - model.ipar = 9; + this.model.ipar = new ScilabDouble(9); } else if ((this.ot==5)) { - model.ipar = 10; + this.model.ipar = new ScilabDouble(10); } else if ((this.ot==6)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==7)) { - model.ipar = 11; + this.model.ipar = new ScilabDouble(11); } else if ((this.ot==8)) { - model.ipar = 12; + this.model.ipar = new ScilabDouble(12); } } else if ((this.it==4)) { if ((this.ot==1)) { - model.ipar = 13; + this.model.ipar = new ScilabDouble(13); } else if ((this.ot==3)) { - model.ipar = 14; + this.model.ipar = new ScilabDouble(14); } else if ((this.ot==5)) { - model.ipar = 15; + this.model.ipar = new ScilabDouble(15); } else if ((this.ot==6)) { - model.ipar = 16; + this.model.ipar = new ScilabDouble(16); } else if ((this.ot==7)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==8)) { - model.ipar = 17; + this.model.ipar = new ScilabDouble(17); } } else if ((this.it==5)) { if ((this.ot==1)) { - model.ipar = 18; + this.model.ipar = new ScilabDouble(18); } else if ((this.ot==3)) { - model.ipar = 19; + this.model.ipar = new ScilabDouble(19); } else if ((this.ot==4)) { - model.ipar = 20; + this.model.ipar = new ScilabDouble(20); } else if ((this.ot==6)) { - model.ipar = 21; + this.model.ipar = new ScilabDouble(21); } else if ((this.ot==7)) { - model.ipar = 22; + this.model.ipar = new ScilabDouble(22); } else if ((this.ot==8)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } } else if ((this.it==6)) { if ((this.ot==1)) { - model.ipar = 23; + this.model.ipar = new ScilabDouble(23); } else if ((this.ot==3)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==4)) { - model.ipar = 24; + this.model.ipar = new ScilabDouble(24); } else if ((this.ot==5)) { - model.ipar = 25; + this.model.ipar = new ScilabDouble(25); } else if ((this.ot==7)) { - model.ipar = 26; + this.model.ipar = new ScilabDouble(26); } else if ((this.ot==8)) { - model.ipar = 27; + this.model.ipar = new ScilabDouble(27); } } else if ((this.it==7)) { if ((this.ot==1)) { - model.ipar = 28; + this.model.ipar = new ScilabDouble(28); } else if ((this.ot==3)) { - model.ipar = 29; + this.model.ipar = new ScilabDouble(29); } else if ((this.ot==4)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==5)) { - model.ipar = 30; + this.model.ipar = new ScilabDouble(30); } else if ((this.ot==6)) { - model.ipar = 31; + this.model.ipar = new ScilabDouble(31); } else if ((this.ot==8)) { - model.ipar = 32; + this.model.ipar = new ScilabDouble(32); } } else if ((this.it==8)) { if ((this.ot==1)) { - model.ipar = 33; + this.model.ipar = new ScilabDouble(33); } else if ((this.ot==3)) { - model.ipar = 34; + this.model.ipar = new ScilabDouble(34); } else if ((this.ot==4)) { - model.ipar = 35; + this.model.ipar = new ScilabDouble(35); } else if ((this.ot==5)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==6)) { - model.ipar = 36; + this.model.ipar = new ScilabDouble(36); } else if ((this.ot==7)) { - model.ipar = 37; + this.model.ipar = new ScilabDouble(37); } } } else if ((this.np==1)) { if ((this.it==1)) { if ((this.ot==3)) { - model.ipar = 38; + this.model.ipar = new ScilabDouble(38); } else if ((this.ot==4)) { - model.ipar = 39; + this.model.ipar = new ScilabDouble(39); } else if ((this.ot==5)) { - model.ipar = 40; + this.model.ipar = new ScilabDouble(40); } else if ((this.ot==6)) { - model.ipar = 41; + this.model.ipar = new ScilabDouble(41); } else if ((this.ot==7)) { - model.ipar = 42; + this.model.ipar = new ScilabDouble(42); } else if ((this.ot==8)) { - model.ipar = 43; + this.model.ipar = new ScilabDouble(43); } } else if ((this.it==3)) { if ((this.ot==1)) { - model.ipar = 8; + this.model.ipar = new ScilabDouble(8); } else if ((this.ot==4)) { - model.ipar = 44; + this.model.ipar = new ScilabDouble(44); } else if ((this.ot==5)) { - model.ipar = 45; + this.model.ipar = new ScilabDouble(45); } else if ((this.ot==6)) { - model.ipar = 46; + this.model.ipar = new ScilabDouble(46); } else if ((this.ot==7)) { - model.ipar = 47; + this.model.ipar = new ScilabDouble(47); } else if ((this.ot==8)) { - model.ipar = 48; + this.model.ipar = new ScilabDouble(48); } } else if ((this.it==4)) { if ((this.ot==1)) { - model.ipar = 13; + this.model.ipar = new ScilabDouble(13); } else if ((this.ot==3)) { - model.ipar = 14; + this.model.ipar = new ScilabDouble(14); } else if ((this.ot==5)) { - model.ipar = 49; + this.model.ipar = new ScilabDouble(49); } else if ((this.ot==6)) { - model.ipar = 50; + this.model.ipar = new ScilabDouble(50); } else if ((this.ot==7)) { - model.ipar = 51; + this.model.ipar = new ScilabDouble(51); } else if ((this.ot==8)) { - model.ipar = 52; + this.model.ipar = new ScilabDouble(52); } } else if ((this.it==5)) { if ((this.ot==1)) { - model.ipar = 18; + this.model.ipar = new ScilabDouble(18); } else if ((this.ot==3)) { - model.ipar = 19; + this.model.ipar = new ScilabDouble(19); } else if ((this.ot==4)) { - model.ipar = 20; + this.model.ipar = new ScilabDouble(20); } else if ((this.ot==6)) { - model.ipar = 53; + this.model.ipar = new ScilabDouble(53); } else if ((this.ot==7)) { - model.ipar = 54; + this.model.ipar = new ScilabDouble(54); } else if ((this.ot==8)) { - model.ipar = 55; + this.model.ipar = new ScilabDouble(55); } } else if ((this.it==6)) { if ((this.ot==1)) { - model.ipar = 23; + this.model.ipar = new ScilabDouble(23); } else if ((this.ot==3)) { - model.ipar = 56; + this.model.ipar = new ScilabDouble(56); } else if ((this.ot==4)) { - model.ipar = 57; + this.model.ipar = new ScilabDouble(57); } else if ((this.ot==5)) { - model.ipar = 58; + this.model.ipar = new ScilabDouble(58); } else if ((this.ot==7)) { - model.ipar = 59; + this.model.ipar = new ScilabDouble(59); } else if ((this.ot==8)) { - model.ipar = 60; + this.model.ipar = new ScilabDouble(60); } } else if ((this.it==7)) { if ((this.ot==1)) { - model.ipar = 28; + this.model.ipar = new ScilabDouble(28); } else if ((this.ot==3)) { - model.ipar = 29; + this.model.ipar = new ScilabDouble(29); } else if ((this.ot==4)) { - model.ipar = 61; + this.model.ipar = new ScilabDouble(61); } else if ((this.ot==5)) { - model.ipar = 62; + this.model.ipar = new ScilabDouble(62); } else if ((this.ot==6)) { - model.ipar = 31; + this.model.ipar = new ScilabDouble(31); } else if ((this.ot==8)) { - model.ipar = 63; + this.model.ipar = new ScilabDouble(63); } } else if ((this.it==8)) { if ((this.ot==1)) { - model.ipar = 33; + this.model.ipar = new ScilabDouble(33); } else if ((this.ot==3)) { - model.ipar = 34; + this.model.ipar = new ScilabDouble(34); } else if ((this.ot==4)) { - model.ipar = 35; + this.model.ipar = new ScilabDouble(35); } else if ((this.ot==5)) { - model.ipar = 64; + this.model.ipar = new ScilabDouble(64); } else if ((this.ot==6)) { - model.ipar = 36; + this.model.ipar = new ScilabDouble(36); } else if ((this.ot==7)) { - model.ipar = 37; + this.model.ipar = new ScilabDouble(37); } } } else if ((this.np==2)) { if ((this.it==1)) { if ((this.ot==3)) { - model.ipar = 65; + this.model.ipar = new ScilabDouble(65); } else if ((this.ot==4)) { - model.ipar = 66; + this.model.ipar = new ScilabDouble(66); } else if ((this.ot==5)) { - model.ipar = 67; + this.model.ipar = new ScilabDouble(67); } else if ((this.ot==6)) { - model.ipar = 68; + this.model.ipar = new ScilabDouble(68); } else if ((this.ot==7)) { - model.ipar = 69; + this.model.ipar = new ScilabDouble(69); } else if ((this.ot==8)) { - model.ipar = 70; + this.model.ipar = new ScilabDouble(70); } } else if ((this.it==3)) { if ((this.ot==1)) { - model.ipar = 8; + this.model.ipar = new ScilabDouble(8); } else if ((this.ot==4)) { - model.ipar = 71; + this.model.ipar = new ScilabDouble(71); } else if ((this.ot==5)) { - model.ipar = 72; + this.model.ipar = new ScilabDouble(72); } else if ((this.ot==6)) { - model.ipar = 73; + this.model.ipar = new ScilabDouble(73); } else if ((this.ot==7)) { - model.ipar = 74; + this.model.ipar = new ScilabDouble(74); } else if ((this.ot==8)) { - model.ipar = 75; + this.model.ipar = new ScilabDouble(75); } } else if ((this.it==4)) { if ((this.ot==1)) { - model.ipar = 13; + this.model.ipar = new ScilabDouble(13); } else if ((this.ot==3)) { - model.ipar = 14; + this.model.ipar = new ScilabDouble(14); } else if ((this.ot==5)) { - model.ipar = 76; + this.model.ipar = new ScilabDouble(76); } else if ((this.ot==6)) { - model.ipar = 77; + this.model.ipar = new ScilabDouble(77); } else if ((this.ot==7)) { - model.ipar = 78; + this.model.ipar = new ScilabDouble(78); } else if ((this.ot==8)) { - model.ipar = 79; + this.model.ipar = new ScilabDouble(79); } } else if ((this.it==5)) { if ((this.ot==1)) { - model.ipar = 18; + this.model.ipar = new ScilabDouble(18); } else if ((this.ot==3)) { - model.ipar = 19; + this.model.ipar = new ScilabDouble(19); } else if ((this.ot==4)) { - model.ipar = 20; + this.model.ipar = new ScilabDouble(20); } else if ((this.ot==6)) { - model.ipar = 80; + this.model.ipar = new ScilabDouble(80); } else if ((this.ot==7)) { - model.ipar = 81; + this.model.ipar = new ScilabDouble(81); } else if ((this.ot==8)) { - model.ipar = 82; + this.model.ipar = new ScilabDouble(82); } } else if ((this.it==6)) { if ((this.ot==1)) { - model.ipar = 23; + this.model.ipar = new ScilabDouble(23); } else if ((this.ot==3)) { - model.ipar = 83; + this.model.ipar = new ScilabDouble(83); } else if ((this.ot==4)) { - model.ipar = 84; + this.model.ipar = new ScilabDouble(84); } else if ((this.ot==5)) { - model.ipar = 85; + this.model.ipar = new ScilabDouble(85); } else if ((this.ot==7)) { - model.ipar = 86; + this.model.ipar = new ScilabDouble(86); } else if ((this.ot==8)) { - model.ipar = 87; + this.model.ipar = new ScilabDouble(87); } } else if ((this.it==7)) { if ((this.ot==1)) { - model.ipar = 28; + this.model.ipar = new ScilabDouble(28); } else if ((this.ot==3)) { - model.ipar = 29; + this.model.ipar = new ScilabDouble(29); } else if ((this.ot==4)) { - model.ipar = 88; + this.model.ipar = new ScilabDouble(88); } else if ((this.ot==5)) { - model.ipar = 89; + this.model.ipar = new ScilabDouble(89); } else if ((this.ot==6)) { - model.ipar = 31; + this.model.ipar = new ScilabDouble(31); } else if ((this.ot==8)) { - model.ipar = 90; + this.model.ipar = new ScilabDouble(90); } } else if ((this.it==8)) { if ((this.ot==1)) { - model.ipar = 33; + this.model.ipar = new ScilabDouble(33); } else if ((this.ot==3)) { - model.ipar = 34; + this.model.ipar = new ScilabDouble(34); } else if ((this.ot==4)) { - model.ipar = 35; + this.model.ipar = new ScilabDouble(35); } else if ((this.ot==5)) { - model.ipar = 91; + this.model.ipar = new ScilabDouble(91); } else if ((this.ot==6)) { - model.ipar = 36; + this.model.ipar = new ScilabDouble(36); } else if ((this.ot==7)) { - model.ipar = 37; + this.model.ipar = new ScilabDouble(37); } } } } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(out,this.ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(out,this.ot),[],[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -5184,20 +5184,20 @@ function DFLIPFLOP() { scs_m.objs[42-1] = scicos_link(xx=[[253.72572],[253.72156]],yy=[[309.29537],[305.95927]],id="drawlink",thick=[0,0],ct=[5,-1],from=[41,1,0],to=[4,1,1]); scs_m.objs[43-1] = scicos_link(xx=[[253.72572],[312.19705],[312.19705]],yy=[[309.29537],[309.29537],[299.28749]],id="drawlink",thick=[0,0],ct=[5,-1],from=[41,2,0],to=[32,1,1]); scs_m.objs[44-1] = scicos_link(xx=[[279.98293],[279.98293],[325.53038],[325.53038]],yy=[[372.50232],[315.89455],[315.89455],[299.28749]],id="drawlink",thick=[0,0],ct=[5,-1],from=[2,2,0],to=[32,2,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1],[1]]; - model.in2 = [[1],[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,1,1]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1],[1]]; + this.model.in2 = [[1],[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,1,1]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } DFLIPFLOP.prototype.details = function DFLIPFLOP() { @@ -5236,20 +5236,20 @@ function DLATCH() { scs_m.objs[17-1] = scicos_link(xx=[[386.03841],[406.03841]],yy=[[329.46812],[329.46812]],id="drawlink",thick=[0,0],ct=[1,1],from=[8,1,0],to=[16,1,1]); scs_m.objs[18-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[325.09603,270.83282],sz=[20,20],flip=true,theta=0,exprs="1",pin=19,pout=[],pein=[],peout=[],gr_i=list(" ",8),id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[19-1] = scicos_link(xx=[[305.09603],[325.09603]],yy=[[280.83282],[280.83282]],id="drawlink",thick=[0,0],ct=[1,1],from=[10,2,0],to=[18,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,-1]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,-1]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } DLATCH.prototype.details = function DLATCH() { @@ -5269,20 +5269,20 @@ function DLATCH() { function EXTRACTBITS() { EXTRACTBITS.prototype.define = function EXTRACTBITS() { numb = []; - model = scicos_model(); - model.sim = list("extract_bit_32_UH0",4); - model.in1 = 1; - model.in2 = 1; - model.out = 1; - model.out2 = 1; - model.intyp = 3; - model.outtyp = 3; - model.ipar = [0,numb]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("extract_bit_32_UH0",4); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.ipar = [0,numb]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(1)],[sci2exp(0)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXTRACTBITS.prototype.details = function EXTRACTBITS() { @@ -5305,7 +5305,7 @@ function EXTRACTBITS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Datatype,this.rule,this.bit,this.scal,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","EXTRACTBITS")],[" "],["Bits Extraction"],[" "],[" - Bits to Extract:"],[" 1 Upper Half"],[" 2 Lower Half"],[" 3 Range from MSB"],[" 4 Range to LSB"],[" 5 Range of Bits"],[" - Number of Bits or Index of bit : Index 0 is LSB"],[" If \'Bits to Extract\' is set to \'Range of bits\': [Start, End]"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Bits to extract","Number of Bits or Index of Bit","Treat Bit Field as an Integer (0:No, 1:Yes)"],list("vec",1,"vec",1,"vec",-1,"vec",1),exprs); if (!ok) { @@ -5319,7 +5319,7 @@ function EXTRACTBITS() { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Treat Bit Field as an Integer",this.scal),msprintf("Must be in the interval %s.","[0, 1]")); ok = false; } else { - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; this.bit = int(this.bit); this.rule = int(this.rule); if ((this.rule==3)||(this.rule==4)) { @@ -5354,41 +5354,41 @@ function EXTRACTBITS() { case 1: switch (this.scal) { case 0: - model.sim = list("extract_bit_32_UH0",4); + this.model.sim = list("extract_bit_32_UH0",4); case 1: switch (this.Datatype) { case 3: - model.sim = list("extract_bit_32_UH1",4); + this.model.sim = list("extract_bit_32_UH1",4); case 6: - model.sim = list("extract_bit_u32_UH1",4); + this.model.sim = list("extract_bit_u32_UH1",4); } } case 2: - model.sim = list("extract_bit_32_LH",4); + this.model.sim = list("extract_bit_32_LH",4); case 3: switch (this.scal) { case 0: - model.sim = list("extract_bit_32_MSB0",4); + this.model.sim = list("extract_bit_32_MSB0",4); case 1: switch (this.Datatype) { case 3: - model.sim = list("extract_bit_32_MSB1",4); + this.model.sim = list("extract_bit_32_MSB1",4); case 6: - model.sim = list("extract_bit_u32_MSB1",4); + this.model.sim = list("extract_bit_u32_MSB1",4); } } case 4: - model.sim = list("extract_bit_32_LSB",4); + this.model.sim = list("extract_bit_32_LSB",4); case 5: switch (this.scal) { case 0: - model.sim = list("extract_bit_32_RB0",4); + this.model.sim = list("extract_bit_32_RB0",4); case 1: switch (this.Datatype) { case 3: - model.sim = list("extract_bit_32_RB1",4); + this.model.sim = list("extract_bit_32_RB1",4); case 6: - model.sim = list("extract_bit_u32_RB1",4); + this.model.sim = list("extract_bit_u32_RB1",4); } } } @@ -5401,41 +5401,41 @@ function EXTRACTBITS() { case 1: switch (this.scal) { case 0: - model.sim = list("extract_bit_16_UH0",4); + this.model.sim = list("extract_bit_16_UH0",4); case 1: switch (this.Datatype) { case 4: - model.sim = list("extract_bit_16_UH1",4); + this.model.sim = list("extract_bit_16_UH1",4); case 7: - model.sim = list("extract_bit_u16_UH1",4); + this.model.sim = list("extract_bit_u16_UH1",4); } } case 2: - model.sim = list("extract_bit_16_LH",4); + this.model.sim = list("extract_bit_16_LH",4); case 3: switch (this.scal) { case 0: - model.sim = list("extract_bit_16_MSB0",4); + this.model.sim = list("extract_bit_16_MSB0",4); case 1: switch (this.Datatype) { case 4: - model.sim = list("extract_bit_16_MSB1",4); + this.model.sim = list("extract_bit_16_MSB1",4); case 7: - model.sim = list("extract_bit_u16_MSB1",4); + this.model.sim = list("extract_bit_u16_MSB1",4); } } case 4: - model.sim = list("extract_bit_16_LSB",4); + this.model.sim = list("extract_bit_16_LSB",4); case 5: switch (this.scal) { case 0: - model.sim = list("extract_bit_16_RB0",4); + this.model.sim = list("extract_bit_16_RB0",4); case 1: switch (this.Datatype) { case 4: - model.sim = list("extract_bit_16_RB1",4); + this.model.sim = list("extract_bit_16_RB1",4); case 7: - model.sim = list("extract_bit_u16_RB1",4); + this.model.sim = list("extract_bit_u16_RB1",4); } } } @@ -5448,41 +5448,41 @@ function EXTRACTBITS() { case 1: switch (this.scal) { case 0: - model.sim = list("extract_bit_8_UH0",4); + this.model.sim = list("extract_bit_8_UH0",4); case 1: switch (this.Datatype) { case 5: - model.sim = list("extract_bit_8_UH1",4); + this.model.sim = list("extract_bit_8_UH1",4); case 8: - model.sim = list("extract_bit_u8_UH1",4); + this.model.sim = list("extract_bit_u8_UH1",4); } } case 2: - model.sim = list("extract_bit_8_LH",4); + this.model.sim = list("extract_bit_8_LH",4); case 3: switch (this.scal) { case 0: - model.sim = list("extract_bit_8_MSB0",4); + this.model.sim = list("extract_bit_8_MSB0",4); case 1: switch (this.Datatype) { case 5: - model.sim = list("extract_bit_8_MSB1",4); + this.model.sim = list("extract_bit_8_MSB1",4); case 8: - model.sim = list("extract_bit_u8_MSB1",4); + this.model.sim = list("extract_bit_u8_MSB1",4); } } case 4: - model.sim = list("extract_bit_8_LSB",4); + this.model.sim = list("extract_bit_8_LSB",4); case 5: switch (this.scal) { case 0: - model.sim = list("extract_bit_8_RB0",4); + this.model.sim = list("extract_bit_8_RB0",4); case 1: switch (this.Datatype) { case 5: - model.sim = list("extract_bit_8_RB1",4); + this.model.sim = list("extract_bit_8_RB1",4); case 8: - model.sim = list("extract_bit_u8_RB1",4); + this.model.sim = list("extract_bit_u8_RB1",4); } } } @@ -5495,13 +5495,13 @@ function EXTRACTBITS() { it = this.Datatype; ot = this.Datatype; out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { graphics.exprs = exprs; - model.ipar = [[int(this.bit.slice())],[int(numb.slice())]]; + this.model.ipar = [[int(this.bit.slice())],[int(numb.slice())]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -5512,21 +5512,21 @@ function EXTRACTBITS() { function INTMUL() { INTMUL.prototype.define = function INTMUL() { sgn = 0; - model = scicos_model(); - model.sim = list("matmul_i32",4); - model.in1 = [[-1],[-2]]; - model.out = -1; - model.in2 = [[-2],[-3]]; - model.out2 = -3; - model.intyp = [3,3]; - model.outtyp = 3; - model.rpar = []; - model.ipar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("matmul_i32",4); + this.model.in1 = [[-1],[-2]]; + this.model.out = new ScilabDouble(-1); + this.model.in2 = [[-2],[-3]]; + this.model.out2 = new ScilabDouble(-3); + this.model.intyp = [3,3]; + this.model.outtyp = new ScilabDouble(3); + this.model.rpar = []; + this.model.ipar = new ScilabDouble(sgn); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTMUL.prototype.details = function INTMUL() { @@ -5544,7 +5544,7 @@ function INTMUL() { this.np = arguments[0]["np"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.Datatype,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","INTMUL")],[" "],["Integer matrix multiplication"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1),exprs); @@ -5558,66 +5558,66 @@ function INTMUL() { ok = false; } else if (this.Datatype==3) { if (this.np==0) { - model.sim = list("matmul_i32n",4); + this.model.sim = list("matmul_i32n",4); } else if (this.np==1) { - model.sim = list("matmul_i32s",4); + this.model.sim = list("matmul_i32s",4); } else { - model.sim = list("matmul_i32e",4); + this.model.sim = list("matmul_i32e",4); } } else if (this.Datatype==4) { if (this.np==0) { - model.sim = list("matmul_i16n",4); + this.model.sim = list("matmul_i16n",4); } else if (this.np==1) { - model.sim = list("matmul_i16s",4); + this.model.sim = list("matmul_i16s",4); } else { - model.sim = list("matmul_i16e",4); + this.model.sim = list("matmul_i16e",4); } } else if (this.Datatype==5) { if (this.np==0) { - model.sim = list("matmul_i8n",4); + this.model.sim = list("matmul_i8n",4); } else if (this.np==1) { - model.sim = list("matmul_i8s",4); + this.model.sim = list("matmul_i8s",4); } else { - model.sim = list("matmul_i8e",4); + this.model.sim = list("matmul_i8e",4); } } else if (this.Datatype==6) { if (this.np==0) { - model.sim = list("matmul_ui32n",4); + this.model.sim = list("matmul_ui32n",4); } else if (this.np==1) { - model.sim = list("matmul_ui32s",4); + this.model.sim = list("matmul_ui32s",4); } else { - model.sim = list("matmul_ui32e",4); + this.model.sim = list("matmul_ui32e",4); } } else if (this.Datatype==7) { if (this.np==0) { - model.sim = list("matmul_ui16n",4); + this.model.sim = list("matmul_ui16n",4); } else if (this.np==1) { - model.sim = list("matmul_ui16s",4); + this.model.sim = list("matmul_ui16s",4); } else { - model.sim = list("matmul_ui16e",4); + this.model.sim = list("matmul_ui16e",4); } } else if (this.Datatype==8) { if (this.np==0) { - model.sim = list("matmul_ui8n",4); + this.model.sim = list("matmul_ui8n",4); } else if (this.np==1) { - model.sim = list("matmul_ui8s",4); + this.model.sim = list("matmul_ui8s",4); } else { - model.sim = list("matmul_ui8e",4); + this.model.sim = list("matmul_ui8e",4); } } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",ot),msprintf("Must be in the interval %s.","[3, 8]")); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.ipar = this.np; + this.model.ipar = new ScilabDouble(this.np); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -5658,20 +5658,20 @@ function JKFLIPFLOP() { scs_m.objs[20-1] = scicos_link(xx=[[368.82793],[388.82793]],yy=[[243.45067],[243.45067]],id="drawlink",thick=[0,0],ct=[1,1],from=[6,2,0],to=[19,1,1]); scs_m.objs[21-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[466.2036,169.25363],sz=[20,20],flip=true,theta=0,exprs="2",pin=22,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=2,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[22-1] = scicos_link(xx=[[446.2036],[466.2036]],yy=[[179.25363],[179.25363]],id="drawlink",thick=[0,0],ct=[1,1],from=[9,1,0],to=[21,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1],[1]]; - model.in2 = [[1],[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,1,5]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1],[1]]; + this.model.in2 = [[1],[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,1,5]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } JKFLIPFLOP.prototype.details = function JKFLIPFLOP() { @@ -5695,8 +5695,8 @@ function JKFLIPFLOP() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs[1-1]; - model = xx.model; - init_old = model.odstate[1-1]; + this.model = xx.model; + init_old = this.model.odstate[1-1]; while (true) { [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","JKFLIPFLOP")],[" "],["JK flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); if (!ok) { @@ -5709,8 +5709,8 @@ function JKFLIPFLOP() { } if (ok) { xx.graphics.exprs[1-1] = this.exprs0; - model.odstate[1-1] = this.init; - xx.model = model; + this.model.odstate[('1', 'double')] = new ScilabDouble(this.init); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } @@ -5730,22 +5730,22 @@ function JKFLIPFLOP() { function LOGIC() { LOGIC.prototype.define = function LOGIC() { this.mat = [[0],[0],[0],[1]]; - model = scicos_model(); - model.sim = list("logic",4); - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.out = 1; - model.out2 = 1; - model.evtin = 1; - model.intyp = [5,5]; - model.outtyp = 5; - model.opar = list(int8(this.mat)); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("logic",4); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.intyp = [5,5]; + this.model.outtyp = new ScilabDouble(5); + this.model.opar = list(int8(this.mat)); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.mat)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOGIC.prototype.details = function LOGIC() { @@ -5764,7 +5764,7 @@ function LOGIC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.mat,this.herit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","LOGIC")],[" "],["Combinatorial logic"],[" "],[" Rows of the matrix are the output values"],[" Number of rows must be a power of two."],[" Number of columns gives the number of outputs."],[" "]],["Truth Table (matrix of outputs)","Accepts Inherited Events (0:No, 1:Yes)"],list("mat",[-1,-2],"vec",1),exprs); if (!ok) { @@ -5788,14 +5788,14 @@ function LOGIC() { out = [ones(nout,1),ones(nout,1)]; it = 5*ones(1,nin); ot = 5*ones(1,nout); - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.herit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.herit,1),[]); } if (ok) { graphics.exprs = exprs; this.mat = int8(this.mat); - model.opar = list(this.mat); + this.model.opar = list(this.mat); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -5807,21 +5807,21 @@ function SHIFT() { SHIFT.prototype.define = function SHIFT() { sgn = [[0],[0]]; OPER = 0; - model = scicos_model(); - model.sim = list("shift_32_LA",4); - model.in1 = -1; - model.out = -1; - model.in2 = -2; - model.out2 = -2; - model.intyp = 3; - model.outtyp = 3; - model.rpar = []; - model.ipar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("shift_32_LA",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.rpar = []; + this.model.ipar = sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SHIFT.prototype.details = function SHIFT() { @@ -5841,7 +5841,7 @@ function SHIFT() { this.np = arguments[0]["np"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.Datatype,this.nb,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","SHIFT")],[" "],["Shift/Rotates bits"]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Number of Bits to Shift Left (Negative number to shift right)","Shift Type (0:Arithmetic, 1:Circular)"],list("vec",1,"vec",1,"vec",1),exprs); @@ -5858,63 +5858,63 @@ function SHIFT() { if (this.nb>0) { switch (this.np) { case 0: - model.sim = list("shift_32_LA",4); + this.model.sim = list("shift_32_LA",4); case 1: - model.sim = list("shift_32_LC",4); + this.model.sim = list("shift_32_LC",4); } } else if (this.nb<0) { switch (this.np) { case 0: switch (this.Datatype) { case 3: - model.sim = list("shift_32_RA",4); + this.model.sim = list("shift_32_RA",4); case 6: - model.sim = list("shift_u32_RA",4); + this.model.sim = list("shift_u32_RA",4); } case 1: - model.sim = list("shift_32_RC",4); + this.model.sim = list("shift_32_RC",4); } } } else if ((this.Datatype==4||this.Datatype==7)) { if (this.nb>0) { switch (this.np) { case 0: - model.sim = list("shift_16_LA",4); + this.model.sim = list("shift_16_LA",4); case 1: - model.sim = list("shift_16_LC",4); + this.model.sim = list("shift_16_LC",4); } } else if (this.nb<0) { switch (this.np) { case 0: switch (this.Datatype) { case 4: - model.sim = list("shift_16_RA",4); + this.model.sim = list("shift_16_RA",4); case 7: - model.sim = list("shift_u16_RA",4); + this.model.sim = list("shift_u16_RA",4); } case 1: - model.sim = list("shift_16_RC",4); + this.model.sim = list("shift_16_RC",4); } } } else if ((this.Datatype==5||this.Datatype==8)) { if (this.nb>0) { switch (this.np) { case 0: - model.sim = list("shift_8_LA",4); + this.model.sim = list("shift_8_LA",4); case 1: - model.sim = list("shift_8_LC",4); + this.model.sim = list("shift_8_LC",4); } } else if (this.nb<0) { switch (this.np) { case 0: switch (this.Datatype) { case 5: - model.sim = list("shift_8_RA",4); + this.model.sim = list("shift_8_RA",4); case 8: - model.sim = list("shift_u8_RA",4); + this.model.sim = list("shift_u8_RA",4); } case 1: - model.sim = list("shift_8_RC",4); + this.model.sim = list("shift_8_RC",4); } } } else { @@ -5922,13 +5922,13 @@ function SHIFT() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([-1,-2],it),list([-1,-2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],it),list([-1,-2],ot),[],[]); } if (ok) { - model.ipar = this.nb; + this.model.ipar = new ScilabDouble(this.nb); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -5953,20 +5953,20 @@ function SRFLIPFLOP() { scs_m.objs[12-1] = scicos_link(xx=[[269.93257],[289.93257]],yy=[[211.45067],[211.45067]],id="drawlink",thick=[0,0],ct=[1,1],from=[11,1,0],to=[1,3,1]); scs_m.objs[13-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[383.03733,238.584],sz=[20,20],flip=true,theta=0,exprs="1",pin=14,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[14-1] = scicos_link(xx=[[363.03733],[383.03733]],yy=[[248.584],[248.584]],id="drawlink",thick=[0,0],ct=[1,1],from=[5,2,0],to=[13,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,5]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,5]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } SRFLIPFLOP.prototype.details = function SRFLIPFLOP() { @@ -5990,8 +5990,8 @@ function SRFLIPFLOP() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs[1-1]; - model = xx.model; - init_old = model.odstate[1-1]; + this.model = xx.model; + init_old = this.model.odstate[1-1]; while (true) { [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","SRFLIPFLOP")],[" "],["SR flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); if (!ok) { @@ -6004,8 +6004,8 @@ function SRFLIPFLOP() { } if (ok) { xx.graphics.exprs[1-1] = this.exprs0; - model.odstate[1-1] = this.init; - xx.model = model; + this.model.odstate[('1', 'double')] = new ScilabDouble(this.init); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } @@ -6025,16 +6025,16 @@ function SRFLIPFLOP() { function BIGSOM_f() { BIGSOM_f.prototype.define = function BIGSOM_f() { this.sgn = [[1],[1]]; - model = scicos_model(); - model.sim = list("sum",2); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.rpar = this.sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("sum",2); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.rpar = this.sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(this.sgn); gr_i = []; - this.x = standard_define([2,3],model,exprs,gr_i); + this.x = standard_define([2,3],this.model,exprs,gr_i); return new BigSom(this.x); } BIGSOM_f.prototype.details = function BIGSOM_f() { @@ -6049,7 +6049,7 @@ function BIGSOM_f() { this.sgn = inverse(arguments[0]["sgn"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.sgn,exprs] = scicos_getvalue("Set sum block parameters","Inputs ports signs/gain",list("vec",-1),exprs); @@ -6057,12 +6057,12 @@ function BIGSOM_f() { break; } in1 = -ones(size(this.sgn,"*"),1); - [model,graphics,ok] = check_io(model,graphics,in1,-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,-1,[],[]); if (ok) { - model.rpar = this.sgn.slice(); + this.model.rpar = this.sgn.slice(); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6073,14 +6073,14 @@ function BIGSOM_f() { function CLINDUMMY_f() { CLINDUMMY_f.prototype.define = function CLINDUMMY_f() { x0 = 0; - model = scicos_model(); - model.sim = list("cdummy",4); - model.state = x0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("cdummy",4); + this.model.state = new ScilabDouble(x0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } CLINDUMMY_f.prototype.details = function CLINDUMMY_f() { @@ -6105,16 +6105,16 @@ function CLR() { C = 1; D = 0; exprs = [["1"],["1+s"]]; - model = scicos_model(); - model.sim = list("csslti4",4); - model.in1 = 1; - model.out = 1; - model.state = x0; - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = new ScilabDouble(x0); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLR.prototype.details = function CLR() { @@ -6133,9 +6133,9 @@ function CLR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.state; - rpar = model.rpar; + this.model = arg1.model; + x0 = this.model.state; + rpar = this.model.rpar; ns = prod(size(x0)); nin = 1; nout = 1; @@ -6161,18 +6161,18 @@ function CLR() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } if (ns1<=ns) { x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } - model.state = x0; - model.rpar = rpar; + this.model.state = x0; + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6188,16 +6188,16 @@ function CLR_f() { C = 1; D = 0; exprs = [["1"],["1+s"]]; - model = scicos_model(); - model.sim = list("csslti",1); - model.in1 = 1; - model.out = 1; - model.state = x0; - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti",1); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = new ScilabDouble(x0); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([2.5,2.5],model,exprs,gr_i); + this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLR_f.prototype.details = function CLR_f() { @@ -6216,9 +6216,9 @@ function CLR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.state; - rpar = model.rpar; + this.model = arg1.model; + x0 = this.model.state; + rpar = this.model.rpar; ns = prod(size(x0)); nin = 1; nout = 1; @@ -6244,18 +6244,18 @@ function CLR_f() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } if (ns1<=ns) { x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } - model.state = x0; - model.rpar = rpar; + this.model.state = x0; + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6272,17 +6272,17 @@ function CLSS() { this.D = 0; in1 = 1; out = 1; - model = scicos_model(); - model.sim = list("csslti4",4); - model.in1 = in1; - model.out = out; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLSS.prototype.details = function CLSS() { @@ -6310,7 +6310,7 @@ function CLSS() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -6338,7 +6338,7 @@ function CLSS() { if (ms!=ns||!okD) { message(_("Matrix A is not square or D has wrong dimension")); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -6348,16 +6348,16 @@ function CLSS() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6375,17 +6375,17 @@ function CLSS_f() { this.D = 0; in1 = 1; out = 1; - model = scicos_model(); - model.sim = list("csslti",1); - model.in1 = in1; - model.out = out; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti",1); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLSS_f.prototype.details = function CLSS_f() { @@ -6413,7 +6413,7 @@ function CLSS_f() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -6431,7 +6431,7 @@ function CLSS_f() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -6441,16 +6441,16 @@ function CLSS_f() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6465,20 +6465,20 @@ function DELAYV_f() { z0 = zeros(11,1); this.zz0 = z0.slice(1-1,$-1); this.T = 1; - model = scicos_model(); - model.sim = list("delayv",1); - model.in1 = [[this.nin],[1]]; - model.out = this.nin; - model.evtin = 1; - model.evtout = [[1],[1]]; - model.dstate = z0; - model.rpar = this.T/(size(this.zz0,"*")); - model.blocktype = "d"; - model.firing = [0,-1]; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("delayv",1); + this.model.in1 = [[this.nin],[1]]; + this.model.out = new ScilabDouble(this.nin); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.dstate = new ScilabDouble(z0); + this.model.rpar = new ScilabDouble(this.T/(size(this.zz0,"*"))); + this.model.blocktype = new ScilabString("d"); + this.model.firing = [0,-1]; + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[strcat(string(z0.slice(1-1,$-1)),";")],[string(this.T)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DELAYV_f.prototype.details = function DELAYV_f() { @@ -6499,9 +6499,9 @@ function DELAYV_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - this.nin = model.in1[1-1]; - z0 = model.dstate; + this.model = arg1.model; + this.nin = this.model.in1[1-1]; + z0 = this.model.dstate; this.zz0 = z0.slice(1-1,$-1); told = z0[$-1]; while (true) { @@ -6518,14 +6518,14 @@ function DELAYV_f() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]); + [model,graphics,ok] = check_io(this.model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]); } if (ok) { graphics.exprs = exprs; - model.dstate = [[this.zz0.slice()],[told]]; - model.rpar = this.T/(size(this.zz0,"*")); + this.model.dstate = [[this.zz0.slice()],[told]]; + this.model.rpar = new ScilabDouble(this.T/(size(this.zz0,"*"))); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6673,15 +6673,15 @@ function DELAY_f() { /* autogenerated from "macros/Linear/DERIV.sci" */ function DERIV() { DERIV.prototype.define = function DERIV() { - model = scicos_model(); - model.sim = list("deriv",4); - model.in1 = -1; - model.out = -1; - model.blocktype = "x"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("deriv",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("x"); + this.model.dep_ut = [true,false]; exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DERIV.prototype.details = function DERIV() { @@ -6701,16 +6701,16 @@ function DERIV() { function DIFF_c() { DIFF_c.prototype.define = function DIFF_c() { this.x0 = [[0],[0]]; - model = scicos_model(); - model.sim = list("diffblk_c",10004); - model.in1 = 1; - model.out = 1; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("diffblk_c",10004); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = this.x0; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DIFF_c.prototype.details = function DIFF_c() { @@ -6729,7 +6729,7 @@ function DIFF_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { ask_again = false; [ok,this.x0,this.xd0,exprs] = scicos_getvalue("Set continuous linear system parameters",["Initial state","Initial Derivative"],list("vec",-1,"vec",-1),exprs); @@ -6750,11 +6750,11 @@ function DIFF_c() { } if (!ask_again) { graphics.exprs = exprs; - model.state = [[this.x0],[this.xd0]]; - model.out = [N]; - model.in1 = N; + this.model.state = [[this.x0],[this.xd0]]; + this.model.out = [N]; + this.model.in1 = new ScilabDouble(N); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6771,17 +6771,17 @@ function DLR() { C = 1; D = 0; exprs = [["1"],["1+z"]]; - model = scicos_model(); - model.sim = list("dsslti4",4); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = x0.slice(); - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dsslti4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = x0.slice(); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLR.prototype.details = function DLR() { @@ -6800,8 +6800,8 @@ function DLR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.dstate; + this.model = arg1.model; + x0 = this.model.dstate; ns = prod(size(x0)); PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.z = %z; @@ -6825,18 +6825,18 @@ function DLR() { x0[ns1-1][1-1] = 0; } rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.dstate = x0; - model.rpar = rpar; + this.model.dstate = x0; + this.model.rpar = rpar; if (norm(D,1)!=0) { mmm = [true,false]; } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6853,17 +6853,17 @@ function DLR_f() { C = 1; D = 0; exprs = [["1"],["1+z"]]; - model = scicos_model(); - model.sim = "dsslti"; - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = x0.slice(); - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("dsslti"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = x0.slice(); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2.5,2.5],model,exprs,gr_i); + this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLR_f.prototype.details = function DLR_f() { @@ -6882,8 +6882,8 @@ function DLR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.dstate; + this.model = arg1.model; + x0 = this.model.dstate; ns = prod(size(x0)); PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.z = %z; @@ -6907,18 +6907,18 @@ function DLR_f() { x0[ns1-1][1-1] = 0; } rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.dstate = x0; - model.rpar = rpar; + this.model.dstate = x0; + this.model.rpar = rpar; if (norm(D,1)!=0) { mmm = [true,false]; } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -6934,18 +6934,18 @@ function DLSS() { this.B = 1; this.C = 1; this.D = 0; - model = scicos_model(); - model.sim = list("dsslti4",4); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.x0.slice(); - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dsslti4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = this.x0.slice(); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLSS.prototype.details = function DLSS() { @@ -6973,7 +6973,7 @@ function DLSS() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set discrete linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -7001,7 +7001,7 @@ function DLSS() { if (ms!=ns||!okD) { message(_("Matrix A is not square or D has wrong dimension")); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -7011,16 +7011,16 @@ function DLSS() { } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,false]; + this.model.dep_ut = [false,false]; } - model.dstate = this.x0.slice(); - model.rpar = rpar; + this.model.dstate = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7036,18 +7036,18 @@ function DLSS_f() { this.B = 1; this.C = 1; this.D = 0; - model = scicos_model(); - model.sim = list("dsslti",1); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.x0.slice(); - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dsslti",1); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = this.x0.slice(); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLSS_f.prototype.details = function DLSS_f() { @@ -7075,7 +7075,7 @@ function DLSS_f() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set discrete linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -7093,7 +7093,7 @@ function DLSS_f() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -7103,16 +7103,16 @@ function DLSS_f() { } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,false]; + this.model.dep_ut = [false,false]; } - model.dstate = this.x0.slice(); - model.rpar = rpar; + this.model.dstate = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7127,16 +7127,16 @@ function DOLLAR() { this.inh = 0; in1 = 1; exprs = string([[z],[this.inh]]); - model = scicos_model(); - model.sim = list("dollar4",4); - model.in1 = in1; - model.out = in1; - model.evtin = 1-this.inh; - model.dstate = z; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dollar4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1-this.inh); + this.model.dstate = new ScilabDouble(z); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DOLLAR.prototype.details = function DOLLAR() { @@ -7155,7 +7155,7 @@ function DOLLAR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<2) { exprs[2-1] = "0"; } @@ -7169,17 +7169,17 @@ function DOLLAR() { out = []; } in1 = out; - model.sim = list("dollar4_m",4); - model.odstate = list(this.a); - model.dstate = []; + this.model.sim = list("dollar4_m",4); + this.model.odstate = list(this.a); + this.model.dstate = []; if (this.type[(this.a)==1-1]) { if (isreal(this.a)) { it = 1; ot = 1; if ((size(this.a,1)==1||size(this.a,2)==1)) { - model.sim = list("dollar4",4); - model.dstate = this.a.slice(); - model.odstate = list(); + this.model.sim = list("dollar4",4); + this.model.dstate = this.a.slice(); + this.model.odstate = list(); } } else { it = 2; @@ -7208,12 +7208,12 @@ function DOLLAR() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7227,16 +7227,16 @@ function DOLLAR_f() { this.inh = 0; in1 = 1; exprs = string([[z],[this.inh]]); - model = scicos_model(); - model.sim = "dollar"; - model.in1 = in1; - model.out = in1; - model.evtin = 1-this.inh; - model.dstate = z; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("dollar"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1-this.inh); + this.model.dstate = new ScilabDouble(z); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DOLLAR_f.prototype.details = function DOLLAR_f() { @@ -7255,7 +7255,7 @@ function DOLLAR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<2) { exprs[2-1] = "0"; } @@ -7270,15 +7270,15 @@ function DOLLAR_f() { } in1 = out; if (ok) { - [model,graphics,ok] = check_io(model,graphics,-1,-1,ones(1-this.inh,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,-1,ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; - model.dstate = this.a; - model.in1 = in1; - model.out = out; + this.model.dstate = new ScilabDouble(this.a); + this.model.in1 = in1; + this.model.out = out; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7292,16 +7292,16 @@ function DOLLAR_m() { this.inh = 0; in1 = 1; exprs = string([[z],[this.inh]]); - model = scicos_model(); - model.sim = list("dollar4",4); - model.in1 = in1; - model.out = in1; - model.evtin = 1-this.inh; - model.dstate = z; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dollar4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1-this.inh); + this.model.dstate = new ScilabDouble(z); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DOLLAR_m.prototype.details = function DOLLAR_m() { @@ -7320,7 +7320,7 @@ function DOLLAR_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<2) { exprs[2-1] = "0"; } @@ -7334,17 +7334,17 @@ function DOLLAR_m() { out = []; } in1 = out; - model.sim = list("dollar4_m",4); - model.odstate = list(this.a); - model.dstate = []; + this.model.sim = list("dollar4_m",4); + this.model.odstate = list(this.a); + this.model.dstate = []; if ((this.type[this.a-1]==1)) { if (isreal(this.a)) { it = 1; ot = 1; if ((size(this.a,1)==1||size(this.a,2)==1)) { - model.sim = list("dollar4",4); - model.dstate = this.a.slice(); - model.odstate = list(); + this.model.sim = list("dollar4",4); + this.model.dstate = this.a.slice(); + this.model.odstate = list(); } } else { it = 2; @@ -7373,12 +7373,12 @@ function DOLLAR_m() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7393,18 +7393,18 @@ function GAINBLK() { out = -1; in2 = -2; out2 = -2; - model = scicos_model(); - model.sim = list("gainblk",4); - model.in1 = in1; - model.out = out; - model.in2 = in2; - model.out2 = out2; - model.rpar = this.gain; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("gainblk",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.in2 = new ScilabDouble(in2); + this.model.out2 = new ScilabDouble(out2); + this.model.rpar = new ScilabDouble(this.gain); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [strcat(sci2exp(this.gain))]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GAINBLK.prototype.details = function GAINBLK() { @@ -7423,7 +7423,7 @@ function GAINBLK() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==1) { exprs = [[exprs],[sci2exp(0)]]; } @@ -7439,9 +7439,9 @@ function GAINBLK() { if (isreal(this.gain)) { it = 1; ot = 1; - model.sim = list("gainblk",4); - model.rpar = this.gain.slice(); - model.opar = list(); + this.model.sim = list("gainblk",4); + this.model.rpar = this.gain.slice(); + this.model.opar = list(); } else { message("type is not supported"); ok = false; @@ -7450,22 +7450,22 @@ function GAINBLK() { if ((this.over==0)) { if ((typeof(this.gain)=="int32")) { ot = 3; - model.sim = list("gainblk_i32n",4); + this.model.sim = list("gainblk_i32n",4); } else if ((typeof(this.gain)=="int16")) { ot = 4; - model.sim = list("gainblk_i16n",4); + this.model.sim = list("gainblk_i16n",4); } else if ((typeof(this.gain)=="int8")) { ot = 5; - model.sim = list("gainblk_i8n",4); + this.model.sim = list("gainblk_i8n",4); } else if ((typeof(this.gain)=="uint32")) { ot = 6; - model.sim = list("gainblk_ui32n",4); + this.model.sim = list("gainblk_ui32n",4); } else if ((typeof(this.gain)=="uint16")) { ot = 7; - model.sim = list("gainblk_ui16n",4); + this.model.sim = list("gainblk_ui16n",4); } else if ((typeof(this.gain)=="uint8")) { ot = 8; - model.sim = list("gainblk_ui8n",4); + this.model.sim = list("gainblk_ui8n",4); } else { message("type is not supported."); ok = false; @@ -7473,22 +7473,22 @@ function GAINBLK() { } else if ((this.over==1)) { if ((typeof(this.gain)=="int32")) { ot = 3; - model.sim = list("gainblk_i32s",4); + this.model.sim = list("gainblk_i32s",4); } else if ((typeof(this.gain)=="int16")) { ot = 4; - model.sim = list("gainblk_i16s",4); + this.model.sim = list("gainblk_i16s",4); } else if ((typeof(this.gain)=="int8")) { ot = 5; - model.sim = list("gainblk_i8s",4); + this.model.sim = list("gainblk_i8s",4); } else if ((typeof(this.gain)=="uint32")) { ot = 6; - model.sim = list("gainblk_ui32s",4); + this.model.sim = list("gainblk_ui32s",4); } else if ((typeof(this.gain)=="uint16")) { ot = 7; - model.sim = list("gainblk_ui16s",4); + this.model.sim = list("gainblk_ui16s",4); } else if ((typeof(this.gain)=="uint8")) { ot = 8; - model.sim = list("gainblk_ui8s",4); + this.model.sim = list("gainblk_ui8s",4); } else { message("type is not supported."); ok = false; @@ -7496,22 +7496,22 @@ function GAINBLK() { } else if ((this.over==2)) { if ((typeof(this.gain)=="int32")) { ot = 3; - model.sim = list("gainblk_i32e",4); + this.model.sim = list("gainblk_i32e",4); } else if ((typeof(this.gain)=="int16")) { ot = 4; - model.sim = list("gainblk_i16e",4); + this.model.sim = list("gainblk_i16e",4); } else if ((typeof(this.gain)=="int8")) { ot = 5; - model.sim = list("gainblk_i8e",4); + this.model.sim = list("gainblk_i8e",4); } else if ((typeof(this.gain)=="uint32")) { ot = 6; - model.sim = list("gainblk_ui32e",4); + this.model.sim = list("gainblk_ui32e",4); } else if ((typeof(this.gain)=="uint16")) { ot = 7; - model.sim = list("gainblk_ui16e",4); + this.model.sim = list("gainblk_ui16e",4); } else if ((typeof(this.gain)=="uint8")) { ot = 8; - model.sim = list("gainblk_ui8e",4); + this.model.sim = list("gainblk_ui8e",4); } else { message("type is not an integer."); ok = false; @@ -7520,21 +7520,21 @@ function GAINBLK() { message("Do on Overflow must be 0,1,2"); ok = false; } - model.rpar = []; - model.opar = list(this.gain.slice()); + this.model.rpar = []; + this.model.opar = list(this.gain.slice()); } if (ok) { [out,in1] = size(this.gain); if (out*in1!=1) { - [model,graphics,ok] = set_io(model,graphics,list([in1,-1],ot),list([out,-1],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,-1],ot),list([out,-1],ot),[],[]); } else { - [model,graphics,ok] = set_io(model,graphics,list([-1,-2],ot),list([-1,-2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],ot),list([-1,-2],ot),[],[]); } } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7548,16 +7548,16 @@ function GAINBLK_f() { this.gain = 1; in1 = 1; out = 1; - model = scicos_model(); - model.sim = "gain"; - model.in1 = in1; - model.out = out; - model.rpar = this.gain; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gain"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.rpar = new ScilabDouble(this.gain); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [strcat(sci2exp(this.gain))]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GAINBLK_f.prototype.details = function GAINBLK_f() { @@ -7574,7 +7574,7 @@ function GAINBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]); if (!ok) { @@ -7584,12 +7584,12 @@ function GAINBLK_f() { message("Gain must have at least one element"); } else { [out,in1] = size(this.gain); - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; - model.rpar = this.gain.slice(); + this.model.rpar = this.gain.slice(); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7603,16 +7603,16 @@ function GAIN_f() { this.gain = 1; in1 = 1; out = 1; - model = scicos_model(); - model.sim = "gain"; - model.in1 = 1; - model.out = 1; - model.rpar = this.gain; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gain"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.gain); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.gain))],[strcat(sci2exp(in1))],[strcat(sci2exp(out))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GAIN_f.prototype.details = function GAIN_f() { @@ -7629,7 +7629,7 @@ function GAIN_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]); if (!ok) { @@ -7639,12 +7639,12 @@ function GAIN_f() { message("Gain must have at least one element"); } else { [out,in1] = size(this.gain); - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; - model.rpar = this.gain.slice(); + this.model.rpar = this.gain.slice(); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7658,17 +7658,17 @@ function INTEGRAL() { this.maxp = 1; minp = -1; rpar = []; - model = scicos_model(); - model.state = 0; - model.sim = list("integral_func",4); - model.in1 = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.state = new ScilabDouble(0); + this.model.sim = list("integral_func",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = string([[0],[0],[0],[this.maxp],[minp]]); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.id = "1/s"; return new BasicBlock(this.x); } @@ -7694,7 +7694,7 @@ function INTEGRAL() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,this.reinit,this.satur,this.maxp,this.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("vec",-1,"vec",1,"vec",1,"vec",-1,"vec",-1),exprs); if (!ok) { @@ -7725,23 +7725,23 @@ function INTEGRAL() { ok = false; } else { rpar = [[this.maxp],[this.lowp]]; - model.nzcross = size(this.x0,1); - model.nmode = size(this.x0,1); + this.model.nzcross = new ScilabDouble(size(this.x0,1)); + this.model.nmode = new ScilabDouble(size(this.x0,1)); } } else { rpar = []; - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } if (ok) { - model.rpar = rpar; - model.state = this.x0; - [model,graphics,ok] = check_io(model,graphics,size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,1),ones(this.reinit,1),[]); + this.model.rpar = rpar; + this.model.state = this.x0; + [model,graphics,ok] = check_io(this.model,graphics,size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,1),ones(this.reinit,1),[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7752,16 +7752,16 @@ function INTEGRAL() { function INTEGRAL_f() { INTEGRAL_f.prototype.define = function INTEGRAL_f() { this.x0 = 0; - model = scicos_model(); - model.sim = "integr"; - model.in1 = 1; - model.out = 1; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("integr"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = new ScilabDouble(this.x0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = strcat(sci2exp(this.x0)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTEGRAL_f.prototype.details = function INTEGRAL_f() { @@ -7777,16 +7777,16 @@ function INTEGRAL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters","Initial state",list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - model.state = this.x0; + this.model.state = new ScilabDouble(this.x0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } this.x.model.firing = []; @@ -7799,19 +7799,19 @@ function INTEGRAL_m() { this.maxp = 1; minp = -1; rpar = []; - model = scicos_model(); - model.state = 0; - model.sim = list("integral_func",4); - model.in1 = 1; - model.out = 1; - model.in2 = 1; - model.out2 = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.state = new ScilabDouble(0); + this.model.sim = list("integral_func",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = string([[0],[0],[0],[this.maxp],[minp]]); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTEGRAL_m.prototype.details = function INTEGRAL_m() { @@ -7836,7 +7836,7 @@ function INTEGRAL_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,this.reinit,this.satur,this.maxp,this.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) { @@ -7870,8 +7870,8 @@ function INTEGRAL_m() { ok = false; } else { rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())]]; - model.nzcross = size(this.x0,"*"); - model.nmode = size(this.x0,"*"); + this.model.nzcross = new ScilabDouble(size(this.x0,"*")); + this.model.nmode = new ScilabDouble(size(this.x0,"*")); } } else if ((Datatype==2)) { if (size(this.maxp,"*")==1) { @@ -7891,25 +7891,25 @@ function INTEGRAL_m() { ok = false; } else { rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())],[imag(this.maxp.slice())],[imag(this.lowp.slice())]]; - model.nzcross = 2*size(this.x0,"*"); - model.nmode = 2*size(this.x0,"*"); + this.model.nzcross = new ScilabDouble(2*size(this.x0,"*")); + this.model.nmode = new ScilabDouble(2*size(this.x0,"*")); } } } else { rpar = []; - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } if (ok) { - model.rpar = rpar; + this.model.rpar = rpar; if ((Datatype==1)) { - model.state = real(this.x0.slice()); - model.sim = list("integral_func",4); + this.model.state = new ScilabDouble(real(this.x0.slice())); + this.model.sim = list("integral_func",4); it = [[1],[ones(this.reinit,1)]]; ot = 1; } else if ((Datatype==2)) { - model.state = [[real(this.x0.slice())],[imag(this.x0.slice())]]; - model.sim = list("integralz_func",4); + this.model.state = [[real(this.x0.slice())],[imag(this.x0.slice())]]; + this.model.sim = list("integralz_func",4); it = [[2],[2*ones(this.reinit,1)]]; ot = 2; } else { @@ -7919,13 +7919,13 @@ function INTEGRAL_m() { if (ok) { in1 = [size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,2)*[[1],[ones(this.reinit,1)]]]; out = size(this.x0); - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(this.reinit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.reinit,1),[]); } } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -7957,20 +7957,20 @@ function PID() { scs_m.objs[19-1] = scicos_link(xx=[[436.5421],[456.5421]],yy=[[202.85067],[202.85067]],id="drawlink",thick=[0,0],ct=[1,1],from=[2,1,0],to=[18,1,1]); scs_m.objs[20-1] = scicos_block(gui="IN_f",graphics=scicos_graphics(orig=[193.97067,193.11733],sz=[20,20],flip=true,theta=0,exprs="1",pin=[],pout=21,pein=[],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim="input",in1=[],in2=[],intyp=1,out=-1,out2=[],outtyp=-1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[21-1] = scicos_link(xx=[[213.97067],[233.97067]],yy=[[203.11733],[203.11733]],id="drawlink",thick=[0,0],ct=[1,1],from=[20,1,0],to=[15,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = -1; - model.in2 = -2; - model.out = -1; - model.out2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [false,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } PID.prototype.details = function PID() { @@ -8065,17 +8065,17 @@ function PID() { function REGISTER() { REGISTER.prototype.define = function REGISTER() { this.z0 = zeros(10,1); - model = scicos_model(); - model.sim = list("delay4",4); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.z0; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("delay4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(string(this.z0),";"); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } REGISTER.prototype.details = function REGISTER() { @@ -8094,7 +8094,7 @@ function REGISTER() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,1)==1) { exprs = [[exprs],[sci2exp(1)]]; } @@ -8108,44 +8108,44 @@ function REGISTER() { ok = false; } if (this.it==1) { - model.sim = list("delay4",4); + this.model.sim = list("delay4",4); this.z0 = double(this.z0); - model.dstate = this.z0; - model.odstate = list(); + this.model.dstate = new ScilabDouble(this.z0); + this.model.odstate = list(); } else { if (this.it==3) { - model.sim = list("delay4_i32",4); + this.model.sim = list("delay4_i32",4); this.z0 = int32(this.z0); } else if (this.it==4) { - model.sim = list("delay4_i16",4); + this.model.sim = list("delay4_i16",4); this.z0 = int16(this.z0); } else if (this.it==5) { - model.sim = list("delay4_i8",4); + this.model.sim = list("delay4_i8",4); this.z0 = int8(this.z0); } else if (this.it==6) { - model.sim = list("delay4_ui32",4); + this.model.sim = list("delay4_ui32",4); this.z0 = uint32(this.z0); } else if (this.it==7) { - model.sim = list("delay4_ui16",4); + this.model.sim = list("delay4_ui16",4); this.z0 = uint16(this.z0); } else if (this.it==8) { - model.sim = list("delay4_ui8",4); + this.model.sim = list("delay4_ui8",4); this.z0 = uint8(this.z0); } else { message("Datatype is not supported"); ok = false; } - model.odstate = list(this.z0); - model.dstate = []; + this.model.odstate = list(this.z0); + this.model.dstate = []; } if (ok) { in1 = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(in1,this.it),1,[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -8156,17 +8156,17 @@ function REGISTER() { function REGISTER_f() { REGISTER_f.prototype.define = function REGISTER_f() { this.z0 = zeros(10,1); - model = scicos_model(); - model.sim = "delay"; - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.z0; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("delay"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(string(this.z0),";"); gr_i = []; - this.x = standard_define([2.5,2.5],model,exprs,gr_i); + this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } REGISTER_f.prototype.details = function REGISTER_f() { @@ -8182,7 +8182,7 @@ function REGISTER_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.z0,exprs] = scicos_getvalue("Set delay parameters","Register initial condition",list("vec",-1),exprs); if (!ok) { @@ -8194,9 +8194,9 @@ function REGISTER_f() { } if (ok) { graphics.exprs = exprs; - model.dstate = this.z0; + this.model.dstate = new ScilabDouble(this.z0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -8207,15 +8207,15 @@ function REGISTER_f() { function SAMPHOLD() { SAMPHOLD.prototype.define = function SAMPHOLD() { in1 = -1; - model = scicos_model(); - model.sim = list("samphold4",4); - model.in1 = -1; - model.out = -1; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("samphold4",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model," ",gr_i); + this.x = standard_define([2,2],this.model," ",gr_i); return new BasicBlock(this.x); } SAMPHOLD.prototype.details = function SAMPHOLD() { @@ -8235,20 +8235,20 @@ function SAMPHOLD() { /* autogenerated from "macros/Linear/SAMPHOLD_m.sci" */ function SAMPHOLD_m() { SAMPHOLD_m.prototype.define = function SAMPHOLD_m() { - model = scicos_model(); - model.sim = list("samphold4_m",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.out = -1; - model.out2 = -2; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("samphold4_m",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } SAMPHOLD_m.prototype.details = function SAMPHOLD_m() { @@ -8266,7 +8266,7 @@ function SAMPHOLD_m() { this.x.model.firing = []; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.it,exprs] = scicos_getvalue("Set parameters Block",["Datatype(1=real double 2=Complex 3=int32 ...)"],list("vec",1),label); if (!ok) { @@ -8277,12 +8277,12 @@ function SAMPHOLD_m() { ok = false; } if (ok) { - in1 = [model.in1,model.in2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(in1,this.it),1,[]); + in1 = [this.model.in1,this.model.in2]; + [model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]); if (ok) { graphics.exprs = exprs; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -8295,15 +8295,15 @@ function SAMPHOLD_m() { function SAMPLEHOLD_f() { SAMPLEHOLD_f.prototype.define = function SAMPLEHOLD_f() { in1 = -1; - model = scicos_model(); - model.sim = "samphold"; - model.in1 = -1; - model.out = -1; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("samphold"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model," ",gr_i); + this.x = standard_define([2,2],this.model," ",gr_i); return new BasicBlock(this.x); } SAMPLEHOLD_f.prototype.details = function SAMPLEHOLD_f() { @@ -8324,16 +8324,16 @@ function SAMPLEHOLD_f() { function SOM_f() { SOM_f.prototype.define = function SOM_f() { sgn = [[1],[1],[1]]; - model = scicos_model(); - model.sim = list("sum",2); - model.in1 = [[-1],[-1],[-1]]; - model.out = -1; - model.rpar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("sum",2); + this.model.in1 = [[-1],[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.rpar = sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(sgn)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SOM_f.prototype.details = function SOM_f() { @@ -8347,13 +8347,13 @@ function SOM_f() { SOM_f.prototype.set = function SOM_f() { this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } if (size(exprs,"*")!=3) { - exprs = string(model.rpar); + exprs = string(this.model.rpar); } if (graphics.flip) { labs = ["down","left","up"]; @@ -8370,18 +8370,18 @@ function SOM_f() { function SUMMATION() { SUMMATION.prototype.define = function SUMMATION() { this.sgn = [[1],[-1]]; - model = scicos_model(); - model.sim = list("summation",4); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.in2 = [[-2],[-2]]; - model.out2 = -2; - model.ipar = this.sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("summation",4); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.in2 = [[-2],[-2]]; + this.model.out2 = new ScilabDouble(-2); + this.model.ipar = this.sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(this.sgn); gr_i = []; - this.x = standard_define([2,3],model,exprs,gr_i); + this.x = standard_define([2,3],this.model,exprs,gr_i); return new Summation(this.x); } SUMMATION.prototype.details = function SUMMATION() { @@ -8401,7 +8401,7 @@ function SUMMATION() { this.satur = arguments[0]["satur"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,1)==1) { exprs = [[sci2exp(1)],[exprs],[sci2exp(0)]]; @@ -8449,66 +8449,66 @@ function SUMMATION() { it = this.Datatype*ones(1,size(in1,1)); ot = this.Datatype; if (this.Datatype==1) { - model.sim = list("summation",4); + this.model.sim = list("summation",4); } else if (this.Datatype==2) { - model.sim = list("summation_z",4); + this.model.sim = list("summation_z",4); } else if (((this.Datatype<1)||(this.Datatype>8))) { message("Datatype is not supported"); ok = false; } else { if (this.satur==0) { if (this.Datatype==3) { - model.sim = list("summation_i32n",4); + this.model.sim = list("summation_i32n",4); } else if (this.Datatype==4) { - model.sim = list("summation_i16n",4); + this.model.sim = list("summation_i16n",4); } else if (this.Datatype==5) { - model.sim = list("summation_i8n",4); + this.model.sim = list("summation_i8n",4); } else if (this.Datatype==6) { - model.sim = list("summation_ui32n",4); + this.model.sim = list("summation_ui32n",4); } else if (this.Datatype==7) { - model.sim = list("summation_ui16n",4); + this.model.sim = list("summation_ui16n",4); } else if (this.Datatype==8) { - model.sim = list("summation_ui8n",4); + this.model.sim = list("summation_ui8n",4); } } else if (this.satur==1) { if (this.Datatype==3) { - model.sim = list("summation_i32s",4); + this.model.sim = list("summation_i32s",4); } else if (this.Datatype==4) { - model.sim = list("summation_i16s",4); + this.model.sim = list("summation_i16s",4); } else if (this.Datatype==5) { - model.sim = list("summation_i8s",4); + this.model.sim = list("summation_i8s",4); } else if (this.Datatype==6) { - model.sim = list("summation_ui32s",4); + this.model.sim = list("summation_ui32s",4); } else if (this.Datatype==7) { - model.sim = list("summation_ui16s",4); + this.model.sim = list("summation_ui16s",4); } else if (this.Datatype==8) { - model.sim = list("summation_ui8s",4); + this.model.sim = list("summation_ui8s",4); } } else if (this.satur==2) { if (this.Datatype==3) { - model.sim = list("summation_i32e",4); + this.model.sim = list("summation_i32e",4); } else if (this.Datatype==4) { - model.sim = list("summation_i16e",4); + this.model.sim = list("summation_i16e",4); } else if (this.Datatype==5) { - model.sim = list("summation_i8e",4); + this.model.sim = list("summation_i8e",4); } else if (this.Datatype==6) { - model.sim = list("summation_ui32e",4); + this.model.sim = list("summation_ui32e",4); } else if (this.Datatype==7) { - model.sim = list("summation_ui16e",4); + this.model.sim = list("summation_ui16e",4); } else if (this.Datatype==8) { - model.sim = list("summation_ui8e",4); + this.model.sim = list("summation_ui8e",4); } } } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],it),list([nout,nout2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],it),list([nout,nout2],ot),[],[]); } if (ok) { - model.rpar = this.satur; - model.ipar = this.sgn; + this.model.rpar = new ScilabDouble(this.satur); + this.model.ipar = new ScilabDouble(this.sgn); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -8518,15 +8518,15 @@ function SUMMATION() { /* autogenerated from "macros/Linear/SUM_f.sci" */ function SUM_f() { SUM_f.prototype.define = function SUM_f() { - model = scicos_model(); - model.sim = list("plusblk",2); - model.in1 = [[-1],[-1],[-1]]; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("plusblk",2); + this.model.in1 = [[-1],[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; exprs = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new BasicBlock(this.x); } SUM_f.prototype.details = function SUM_f() { @@ -8553,18 +8553,18 @@ function TCLSS() { in1 = 1; nx = size(this.x0,"*"); out = 1; - model = scicos_model(); - model.sim = list("tcslti4",4); - model.in1 = [[in1],[nx]]; - model.out = out; - model.evtin = 1; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("tcslti4",4); + this.model.in1 = [[in1],[nx]]; + this.model.out = new ScilabDouble(out); + this.model.evtin = new ScilabDouble(1); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TCLSS.prototype.details = function TCLSS() { @@ -8589,7 +8589,7 @@ function TCLSS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } @@ -8610,7 +8610,7 @@ function TCLSS() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,[[in1],[ms]],out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,[[in1],[ms]],out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -8620,21 +8620,21 @@ function TCLSS() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; if (this.D!=[]) { - model.sim = list("tcslti4",4); + this.model.sim = list("tcslti4",4); } else { - model.sim = list("tcsltj4",4); + this.model.sim = list("tcsltj4",4); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -8653,18 +8653,18 @@ function TCLSS_f() { in1 = 1; nx = size(this.x0,"*"); out = 1; - model = scicos_model(); - model.sim = list("tcslti",1); - model.in1 = [[in1],[nx]]; - model.out = out; - model.evtin = 1; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("tcslti",1); + this.model.in1 = [[in1],[nx]]; + this.model.out = new ScilabDouble(out); + this.model.evtin = new ScilabDouble(1); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TCLSS_f.prototype.details = function TCLSS_f() { @@ -8689,7 +8689,7 @@ function TCLSS_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } @@ -8710,7 +8710,7 @@ function TCLSS_f() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,[[in1],[ms]],out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,[[in1],[ms]],out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -8720,21 +8720,21 @@ function TCLSS_f() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; if (this.D!=[]) { - model.sim = list("tcslti",1); + this.model.sim = list("tcslti",1); } else { - model.sim = list("tcsltj",1); + this.model.sim = list("tcsltj",1); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -8749,17 +8749,17 @@ function TIME_DELAY() { this.T = 1; this.init = 0; this.N = 1024; - model = scicos_model(); - model.sim = list("time_delay",4); - model.in1 = [nin]; - model.out = nin; - model.rpar = [this.T,this.init]; - model.ipar = this.N; - model.blocktype = "x"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("time_delay",4); + this.model.in1 = [nin]; + this.model.out = new ScilabDouble(nin); + this.model.rpar = [this.T,this.init]; + this.model.ipar = new ScilabDouble(this.N); + this.model.blocktype = new ScilabString("x"); + this.model.dep_ut = [false,true]; exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; gr_i = []; - this.x = standard_define([3.5,2],model,exprs,gr_i); + this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TIME_DELAY.prototype.details = function TIME_DELAY() { @@ -8780,8 +8780,8 @@ function TIME_DELAY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - nin = model.in1[1-1]; + this.model = arg1.model; + nin = this.model.in1[1-1]; while (true) { [ok,this.T,this.init,this.N,exprs] = scicos_getvalue("Set delay parameters",["Delay","initial input","Buffer size"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -8796,15 +8796,15 @@ function TIME_DELAY() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[-1],-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[-1],-1,[],[]); } if (ok) { graphics.exprs = exprs; - model.rpar = [[this.T],[this.init]]; - model.ipar = this.N; - model.dep_ut = [false,true]; + this.model.rpar = [[this.T],[this.init]]; + this.model.ipar = new ScilabDouble(this.N); + this.model.dep_ut = [false,true]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -8818,17 +8818,17 @@ function VARIABLE_DELAY() { this.T = 1; this.init = 0; this.N = 1024; - model = scicos_model(); - model.sim = list("variable_delay",4); - model.in1 = [[nin],[1]]; - model.out = nin; - model.rpar = [this.T,this.init]; - model.ipar = this.N; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("variable_delay",4); + this.model.in1 = [[nin],[1]]; + this.model.out = new ScilabDouble(nin); + this.model.rpar = [this.T,this.init]; + this.model.ipar = new ScilabDouble(this.N); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } VARIABLE_DELAY.prototype.details = function VARIABLE_DELAY() { @@ -8849,8 +8849,8 @@ function VARIABLE_DELAY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - nin = model.in1[1-1]; + this.model = arg1.model; + nin = this.model.in1[1-1]; while (true) { [ok,this.T,this.init,this.N,exprs] = scicos_getvalue("Set delay parameters",["Max delay","initial input","Buffer size"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -8865,14 +8865,14 @@ function VARIABLE_DELAY() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[[-1],[1]],-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[[-1],[1]],-1,[],[]); } if (ok) { graphics.exprs = exprs; - model.rpar = [[this.T],[this.init]]; - model.ipar = this.N; + this.model.rpar = [[this.T],[this.init]]; + this.model.ipar = new ScilabDouble(this.N); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -8882,28 +8882,28 @@ function VARIABLE_DELAY() { /* autogenerated from "macros/MatrixOp/CUMSUM.sci" */ function CUMSUM() { CUMSUM.prototype.define = function CUMSUM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "cumsum_m"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } CUMSUM.prototype.details = function CUMSUM() { @@ -8921,7 +8921,7 @@ function CUMSUM() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -8966,15 +8966,15 @@ function CUMSUM() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -8987,28 +8987,28 @@ function CUMSUM() { /* autogenerated from "macros/MatrixOp/EXTRACT.sci" */ function EXTRACT() { EXTRACT.prototype.define = function EXTRACT() { - model = scicos_model(); + this.model = scicos_model(); function_name = "extract"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = [1,1,1,1]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp([1])],[sci2exp([1])]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } EXTRACT.prototype.details = function EXTRACT() { @@ -9029,7 +9029,7 @@ function EXTRACT() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -9070,17 +9070,17 @@ function EXTRACT() { ok = false; } } - model.ipar = [[this.a],[this.b],[ma],[mb]]; - in1 = [model.in1,model.in2]; + this.model.ipar = [[this.a],[this.b],[ma],[mb]]; + in1 = [this.model.in1,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9091,28 +9091,28 @@ function EXTRACT() { /* autogenerated from "macros/MatrixOp/EXTTRI.sci" */ function EXTTRI() { EXTTRI.prototype.define = function EXTTRI() { - model = scicos_model(); + this.model = scicos_model(); function_name = "extrilz"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } EXTTRI.prototype.details = function EXTTRI() { @@ -9130,7 +9130,7 @@ function EXTTRI() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -9172,15 +9172,15 @@ function EXTTRI() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -9193,28 +9193,28 @@ function EXTTRI() { /* autogenerated from "macros/MatrixOp/MATBKSL.sci" */ function MATBKSL() { MATBKSL.prototype.define = function MATBKSL() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_bksl"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-1]]; - model.in2 = [[-2],[-3]]; - model.intyp = [1,1]; - model.out = -2; - model.out2 = -3; - model.outtyp = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[-2],[-3]]; + this.model.intyp = [1,1]; + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-3); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATBKSL.prototype.details = function MATBKSL() { @@ -9231,7 +9231,7 @@ function MATBKSL() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -9252,16 +9252,16 @@ function MATBKSL() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9272,28 +9272,28 @@ function MATBKSL() { /* autogenerated from "macros/MatrixOp/MATCATH.sci" */ function MATCATH() { MATCATH.prototype.define = function MATCATH() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_cath"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-1]]; - model.in2 = [[-2],[-3]]; - model.intyp = [1,1]; - model.out = -1; - model.out2 = 0; - model.outtyp = -1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[-2],[-3]]; + this.model.intyp = [1,1]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(0); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(2)]; gr_i = []; - this.x = standard_define([2,3],model,label,gr_i); + this.x = standard_define([2,3],this.model,label,gr_i); return new BasicBlock(this.x); } MATCATH.prototype.details = function MATCATH() { @@ -9309,7 +9309,7 @@ function MATCATH() { this.nin = arguments[0]["nin"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")>1) { @@ -9325,13 +9325,13 @@ function MATCATH() { out = [-1,0]; it = -1*(ones(this.nin,1)); ot = -1; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { funtyp = 4; - model.sim = list("mat_cath",funtyp); + this.model.sim = list("mat_cath",funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9343,28 +9343,28 @@ function MATCATH() { function MATCATV() { MATCATV.prototype.define = function MATCATV() { l1 = [[2],[2]]; - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_catv"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in2 = [[-1],[-1]]; - model.in1 = [[-2],[-3]]; - model.intyp = [-1,-1]; - model.out = 0; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in2 = [[-1],[-1]]; + this.model.in1 = [[-2],[-3]]; + this.model.intyp = [-1,-1]; + this.model.out = new ScilabDouble(0); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(2)]; gr_i = []; - this.x = standard_define([2,3],model,label,gr_i); + this.x = standard_define([2,3],this.model,label,gr_i); return new BasicBlock(this.x); } MATCATV.prototype.details = function MATCATV() { @@ -9380,7 +9380,7 @@ function MATCATV() { this.nin = arguments[0]["nin"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")>1) { @@ -9396,13 +9396,13 @@ function MATCATV() { it = -ones(this.nin,1); ot = -1; out = [0,-1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { funtyp = 4; - model.sim = list("mat_catv",funtyp); + this.model.sim = list("mat_catv",funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9413,28 +9413,28 @@ function MATCATV() { /* autogenerated from "macros/MatrixOp/MATDET.sci" */ function MATDET() { MATDET.prototype.define = function MATDET() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_det"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATDET.prototype.details = function MATDET() { @@ -9451,7 +9451,7 @@ function MATDET() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -9472,16 +9472,16 @@ function MATDET() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9492,28 +9492,28 @@ function MATDET() { /* autogenerated from "macros/MatrixOp/MATDIAG.sci" */ function MATDIAG() { MATDIAG.prototype.define = function MATDIAG() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_diag"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = 1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATDIAG.prototype.details = function MATDIAG() { @@ -9530,7 +9530,7 @@ function MATDIAG() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -9551,16 +9551,16 @@ function MATDIAG() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9571,28 +9571,28 @@ function MATDIAG() { /* autogenerated from "macros/MatrixOp/MATDIV.sci" */ function MATDIV() { MATDIV.prototype.define = function MATDIV() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_div"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-2]]; - model.in2 = [[-3],[-3]]; - model.intyp = [1,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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-2]]; + this.model.in2 = [[-3],[-3]]; + this.model.intyp = [1,1]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATDIV.prototype.details = function MATDIV() { @@ -9609,7 +9609,7 @@ function MATDIV() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -9630,16 +9630,16 @@ function MATDIV() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9650,28 +9650,28 @@ function MATDIV() { /* autogenerated from "macros/MatrixOp/MATEIG.sci" */ function MATEIG() { MATEIG.prototype.define = function MATEIG() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_vps"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(2); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATEIG.prototype.details = function MATEIG() { @@ -9689,7 +9689,7 @@ function MATEIG() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -9736,11 +9736,11 @@ function MATEIG() { in1 = [-1,-1]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -9753,28 +9753,28 @@ function MATEIG() { /* autogenerated from "macros/MatrixOp/MATEXPM.sci" */ function MATEXPM() { MATEXPM.prototype.define = function MATEXPM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_expm"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATEXPM.prototype.details = function MATEXPM() { @@ -9791,7 +9791,7 @@ function MATEXPM() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -9812,16 +9812,16 @@ function MATEXPM() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9832,28 +9832,28 @@ function MATEXPM() { /* autogenerated from "macros/MatrixOp/MATINV.sci" */ function MATINV() { MATINV.prototype.define = function MATINV() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_inv"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATINV.prototype.details = function MATINV() { @@ -9870,7 +9870,7 @@ function MATINV() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -9891,16 +9891,16 @@ function MATINV() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -9911,28 +9911,28 @@ function MATINV() { /* autogenerated from "macros/MatrixOp/MATLU.sci" */ function MATLU() { MATLU.prototype.define = function MATLU() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_lu"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - model.intyp = 1; - model.out = [[-1],[-1]]; - model.out2 = [[-1],[-1]]; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-1],[-1]]; + this.model.outtyp = [1,1]; + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = sci2exp(1); gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATLU.prototype.details = function MATLU() { @@ -9948,7 +9948,7 @@ function MATLU() { this.typ = inverse(arguments[0]["typ"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -9972,14 +9972,14 @@ function MATLU() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([model.in1,model.in2],it),list([model.out,model.out2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([this.model.in1,this.model.in2],it),list([this.model.out,this.model.out2],ot),[],[]); } if (ok) { funtyp = 4; - model.sim = list(function_name,funtyp); + this.model.sim = list(function_name,funtyp); graphics.exprs = this.lab; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -9989,28 +9989,28 @@ function MATLU() { /* autogenerated from "macros/MatrixOp/MATMAGPHI.sci" */ function MATMAGPHI() { MATMAGPHI.prototype.define = function MATMAGPHI() { - model = scicos_model(); + this.model = scicos_model(); function_name = "matz_abs"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(2); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-2],[-2]]; + this.model.outtyp = [1,1]; + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATMAGPHI.prototype.details = function MATMAGPHI() { @@ -10026,7 +10026,7 @@ function MATMAGPHI() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -10056,11 +10056,11 @@ function MATMAGPHI() { } funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -10073,17 +10073,17 @@ function MATMAGPHI() { /* autogenerated from "macros/MatrixOp/MATMUL.sci" */ function MATMUL() { MATMUL.prototype.define = function MATMUL() { - model = scicos_model(); - model.sim = list("matmul_m",4); - model.in1 = [[-1],[-2]]; - model.in2 = [[-2],[-3]]; - model.out = -1; - model.out2 = -3; - model.dep_ut = [true,false]; - model.ipar = 1; - label = [sci2exp(model.ipar)]; + this.model = scicos_model(); + this.model.sim = list("matmul_m",4); + this.model.in1 = [[-1],[-2]]; + this.model.in2 = [[-2],[-3]]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-3); + this.model.dep_ut = [true,false]; + this.model.ipar = new ScilabDouble(1); + label = [sci2exp(this.model.ipar)]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATMUL.prototype.details = function MATMUL() { @@ -10104,9 +10104,9 @@ function MATMUL() { this.x = arg1; graphics = this.x.graphics; label = graphics.exprs; - model = this.x.model; - if (model.ipar==[]) { - model.ipar = 1; + this.model = this.x.model; + if (this.model.ipar==[]) { + this.model.ipar = new ScilabDouble(1); } if (size(label,"*")==1) { label[2-1] = sci2exp(1); @@ -10135,72 +10135,72 @@ function MATMUL() { TABMAX = [[0],[0],[(2^31)-1],[(2^15)-1],[(2^7)-1],[(2^32)-1],[(2^16)-1],[(2^8)-1]]; if (this.rule==2) { if (this.np==0) { - model.sim = list("matmul2_m",4); + this.model.sim = list("matmul2_m",4); } else if (this.np==1) { - model.sim = list("matmul2_s",4); + this.model.sim = list("matmul2_s",4); } else { - model.sim = list("matmul2_e",4); + this.model.sim = list("matmul2_e",4); } } else if (this.rule==3) { if (this.np==0) { - model.sim = list("matbyscal",4); + this.model.sim = list("matbyscal",4); } else if (this.np==1) { - model.sim = list("matbyscal_s",4); + this.model.sim = list("matbyscal_s",4); } else { - model.sim = list("matbyscal_e",4); + this.model.sim = list("matbyscal_e",4); } } else { if ((this.dtype==1)) { - model.sim = list("matmul_m",4); + this.model.sim = list("matmul_m",4); } else if ((this.dtype==2)) { - model.sim = list("matzmul_m",4); + this.model.sim = list("matzmul_m",4); } else if (this.dtype==3) { if (this.np==0) { - model.sim = list("matmul_i32n",4); + this.model.sim = list("matmul_i32n",4); } else if (this.np==1) { - model.sim = list("matmul_i32s",4); + this.model.sim = list("matmul_i32s",4); } else { - model.sim = list("matmul_i32e",4); + this.model.sim = list("matmul_i32e",4); } } else if (this.dtype==4) { if (this.np==0) { - model.sim = list("matmul_i16n",4); + this.model.sim = list("matmul_i16n",4); } else if (this.np==1) { - model.sim = list("matmul_i16s",4); + this.model.sim = list("matmul_i16s",4); } else { - model.sim = list("matmul_i16e",4); + this.model.sim = list("matmul_i16e",4); } } else if (this.dtype==5) { if (this.np==0) { - model.sim = list("matmul_i8n",4); + this.model.sim = list("matmul_i8n",4); } else if (this.np==1) { - model.sim = list("matmul_i8s",4); + this.model.sim = list("matmul_i8s",4); } else { - model.sim = list("matmul_i8e",4); + this.model.sim = list("matmul_i8e",4); } } else if (this.dtype==6) { if (this.np==0) { - model.sim = list("matmul_ui32n",4); + this.model.sim = list("matmul_ui32n",4); } else if (this.np==1) { - model.sim = list("matmul_ui32s",4); + this.model.sim = list("matmul_ui32s",4); } else { - model.sim = list("matmul_ui32e",4); + this.model.sim = list("matmul_ui32e",4); } } else if (this.dtype==7) { if (this.np==0) { - model.sim = list("matmul_ui16n",4); + this.model.sim = list("matmul_ui16n",4); } else if (this.np==1) { - model.sim = list("matmul_ui16s",4); + this.model.sim = list("matmul_ui16s",4); } else { - model.sim = list("matmul_ui16e",4); + this.model.sim = list("matmul_ui16e",4); } } else if (this.dtype==8) { if (this.np==0) { - model.sim = list("matmul_ui8n",4); + this.model.sim = list("matmul_ui8n",4); } else if (this.np==1) { - model.sim = list("matmul_ui8s",4); + this.model.sim = list("matmul_ui8s",4); } else { - model.sim = list("matmul_ui8e",4); + this.model.sim = list("matmul_ui8e",4); } } } @@ -10218,14 +10218,14 @@ function MATMUL() { in1 = [[-1,-2],[1,1]]; out = [-1,-2]; } - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { label = exprs; - model.ipar = this.rule; - model.rpar = [[kmin],[kmax]]; + this.model.ipar = new ScilabDouble(this.rule); + this.model.rpar = [[kmin],[kmax]]; graphics.exprs = label; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; arg1 = this.x; break; } @@ -10236,28 +10236,28 @@ function MATMUL() { /* autogenerated from "macros/MatrixOp/MATPINV.sci" */ function MATPINV() { MATPINV.prototype.define = function MATPINV() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_pinv"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -2; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATPINV.prototype.details = function MATPINV() { @@ -10274,7 +10274,7 @@ function MATPINV() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -10295,16 +10295,16 @@ function MATPINV() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -10315,28 +10315,28 @@ function MATPINV() { /* autogenerated from "macros/MatrixOp/MATRESH.sci" */ function MATRESH() { MATRESH.prototype.define = function MATRESH() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_reshape"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp([1,1])],[sci2exp([1,1])]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATRESH.prototype.details = function MATRESH() { @@ -10356,7 +10356,7 @@ function MATRESH() { this.out = arguments[0]["out"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -10405,14 +10405,14 @@ function MATRESH() { } if (ok) { label = this.lab; - [model,graphics,ok] = set_io(model,graphics,list(this.l1,it),list(this.out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(this.l1,it),list(this.out,ot),[],[]); } if (ok) { funtyp = 4; - model.sim = list(function_name,funtyp); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -10424,28 +10424,28 @@ function MATRESH() { /* autogenerated from "macros/MatrixOp/MATSING.sci" */ function MATSING() { MATSING.prototype.define = function MATSING() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_sing"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATSING.prototype.details = function MATSING() { @@ -10463,7 +10463,7 @@ function MATSING() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -10513,11 +10513,11 @@ function MATSING() { } funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -10530,28 +10530,28 @@ function MATSING() { /* autogenerated from "macros/MatrixOp/MATSUM.sci" */ function MATSUM() { MATSUM.prototype.define = function MATSUM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_sum"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATSUM.prototype.details = function MATSUM() { @@ -10569,7 +10569,7 @@ function MATSUM() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -10617,14 +10617,14 @@ function MATSUM() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -10637,16 +10637,16 @@ function MATSUM() { /* autogenerated from "macros/MatrixOp/MATTRAN.sci" */ function MATTRAN() { MATTRAN.prototype.define = function MATTRAN() { - model = scicos_model(); - model.sim = list("mattran_m",4); - model.in1 = -1; - model.in2 = -2; - model.out = -2; - model.out2 = -1; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mattran_m",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-1); + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATTRAN.prototype.details = function MATTRAN() { @@ -10665,7 +10665,7 @@ function MATTRAN() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==1) { label[2-1] = sci2exp(1); } @@ -10690,16 +10690,16 @@ function MATTRAN() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -10710,28 +10710,28 @@ function MATTRAN() { /* autogenerated from "macros/MatrixOp/MATZCONJ.sci" */ function MATZCONJ() { MATZCONJ.prototype.define = function MATZCONJ() { - model = scicos_model(); + this.model = scicos_model(); function_name = "matz_conj"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -2; - model.intyp = 2; - model.out = -1; - model.out2 = -2; - model.outtyp = 2; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(2); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(2); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = []; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATZCONJ.prototype.details = function MATZCONJ() { @@ -10750,28 +10750,28 @@ function MATZCONJ() { /* autogenerated from "macros/MatrixOp/MATZREIM.sci" */ function MATZREIM() { MATZREIM.prototype.define = function MATZREIM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "matz_reim"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(2); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-2],[-2]]; + this.model.outtyp = [1,1]; + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = sci2exp(1); gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATZREIM.prototype.details = function MATZREIM() { @@ -10787,7 +10787,7 @@ function MATZREIM() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -10817,11 +10817,11 @@ function MATZREIM() { } funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -10834,28 +10834,28 @@ function MATZREIM() { /* autogenerated from "macros/MatrixOp/RICC.sci" */ function RICC() { RICC.prototype.define = function RICC() { - model = scicos_model(); + this.model = scicos_model(); function_name = "ricc_m"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-1],[-1]]; - model.in2 = [[-1],[-1],[-1]]; - model.intyp = [1,1,1]; - model.out = -1; - model.out2 = -1; - model.outtyp = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = [[1],[1]]; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-1],[-1]]; + this.model.in2 = [[-1],[-1],[-1]]; + this.model.intyp = [1,1,1]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = [[1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } RICC.prototype.details = function RICC() { @@ -10874,7 +10874,7 @@ function RICC() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -10883,17 +10883,17 @@ function RICC() { if (!ok) { break; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; it = [1,1,1]; ot = 1; label = exprs; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { - model.ipar = [[this.tpe],[this.mod]]; + this.model.ipar = [[this.tpe],[this.mod]]; graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -10904,28 +10904,28 @@ function RICC() { /* autogenerated from "macros/MatrixOp/ROOTCOEF.sci" */ function ROOTCOEF() { ROOTCOEF.prototype.define = function ROOTCOEF() { - model = scicos_model(); + this.model = scicos_model(); function_name = "root_coef"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } ROOTCOEF.prototype.details = function ROOTCOEF() { @@ -10944,7 +10944,7 @@ function ROOTCOEF() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -10965,16 +10965,16 @@ function ROOTCOEF() { message("Datatype is not supported"); ok = false; } - in1 = [this.inp,model.in2]; - out = [this.inp+1,model.out2]; + in1 = [this.inp,this.model.in2]; + out = [this.inp+1,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -10985,18 +10985,18 @@ function ROOTCOEF() { /* autogenerated from "macros/MatrixOp/SQRT.sci" */ function SQRT() { SQRT.prototype.define = function SQRT() { - model = scicos_model(); - model.sim = list("mat_sqrt",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.out = -1; - model.out2 = -2; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mat_sqrt",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } SQRT.prototype.details = function SQRT() { @@ -11013,7 +11013,7 @@ function SQRT() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.typ,exprs] = scicos_getvalue("Set SQRT Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); if (!ok) { @@ -11029,16 +11029,16 @@ function SQRT() { } it = this.typ; ot = this.typ; - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -11049,28 +11049,28 @@ function SQRT() { /* autogenerated from "macros/MatrixOp/SUBMAT.sci" */ function SUBMAT() { SUBMAT.prototype.define = function SUBMAT() { - model = scicos_model(); + this.model = scicos_model(); function_name = "submat"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = [[1],[1],[1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2.5,2],model,label,gr_i); + this.x = standard_define([2.5,2],this.model,label,gr_i); return new BasicBlock(this.x); } SUBMAT.prototype.details = function SUBMAT() { @@ -11097,7 +11097,7 @@ function SUBMAT() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==5) { label[6-1] = sci2exp([1,1]); } @@ -11138,17 +11138,17 @@ function SUBMAT() { message("index of ending column is out of range"); ok = false; } - model.ipar = [[this.a],[this.b],[this.c],[this.d]]; + this.model.ipar = [[this.a],[this.b],[this.c],[this.d]]; in1 = [this.inp[1-1],this.inp[2-1]]; out = [(this.b-this.a)+1,(this.d-this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } @@ -11169,20 +11169,20 @@ function AUTOMAT() { exprs = [[string(NMode)],[string(this.Minitial)],[string(NX)],[sci2exp(this.X0)],[sci2exp(this.XP)],[sci2exp(C1)],[sci2exp(C2)]]; ipar = [[NMode],[this.Minitial],[NX],[this.XP],[C1],[C2]]; rpar = [this.X0]; - model = scicos_model(); - model.sim = list("automat",10004); - model.in1 = [[2*NX+1],[2*NX+1]]; - model.out = [[2],[2*NX]]; - model.state = ones(2*NX,1); - model.nzcross = 1; - model.blocktype = "c"; - model.evtout = 1; - model.firing = -1; - model.dep_ut = [false,true]; - model.ipar = ipar; - model.rpar = rpar; + this.model = scicos_model(); + this.model.sim = list("automat",10004); + this.model.in1 = [[2*NX+1],[2*NX+1]]; + this.model.out = [[2],[2*NX]]; + this.model.state = new ScilabDouble(ones(2*NX,1)); + this.model.nzcross = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,true]; + this.model.ipar = ipar; + this.model.rpar = rpar; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } AUTOMAT.prototype.details = function AUTOMAT() { @@ -11197,8 +11197,8 @@ function AUTOMAT() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; + this.model = arg1.model; + ipar = this.model.ipar; NMode = ipar[1-1]; NX = ipar[3-1]; while (true) { @@ -11278,18 +11278,18 @@ function AUTOMAT() { } } if (!ModifEncore) { - [model,graphics,this.ok] = check_io(model,graphics,INP,OUT,[],[1]); + [model,graphics,this.ok] = check_io(this.model,graphics,INP,OUT,[],[1]); if (!this.ok) { break; } - model.nzcross = nzcross; - model.state = ones(2*NX,1); + this.model.nzcross = new ScilabDouble(nzcross); + this.model.state = new ScilabDouble(ones(2*NX,1)); graphics.gr_i[1-1][1-1] = "txt=[\'Automaton\';\'nM="+string(NMode)+",nX="+string(NX)+"\'];"; graphics.exprs = exprs; this.x.graphics = graphics; - model.ipar = ipar; - model.rpar = rpar; - this.x.model = model; + this.model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.x.model = this.model; break; } } @@ -11300,16 +11300,16 @@ function AUTOMAT() { function BACKLASH() { BACKLASH.prototype.define = function BACKLASH() { exprs = [["0"],["1"],["1"]]; - model = scicos_model(); - model.sim = list("backlash",4); - model.in1 = 1; - model.out = 1; - model.rpar = [[0],[1]]; - model.nzcross = 2; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("backlash",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[0],[1]]; + this.model.nzcross = new ScilabDouble(2); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BACKLASH.prototype.details = function BACKLASH() { @@ -11330,8 +11330,8 @@ function BACKLASH() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - rpar = model.rpar; + this.model = arg1.model; + rpar = this.model.rpar; while (true) { [ok,this.ini,this.gap,this.zcr,exprs] = scicos_getvalue("Set backlash parameters",["initial output","gap","use zero-crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -11342,13 +11342,13 @@ function BACKLASH() { rpar[1-1] = this.ini; rpar[2-1] = this.gap; if (this.zcr!=0) { - model.nzcross = 2; + this.model.nzcross = new ScilabDouble(2); } else { - model.nzcross = 0; + this.model.nzcross = new ScilabDouble(0); } - model.rpar = rpar; + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -11380,19 +11380,19 @@ function BOUNCE() { this.rpar2 = this.rpar1; state = [this.x,this.xd,this.y,this.yd]; state = transpose(state); - model = scicos_model(); - model.sim = list("bounce_ball",4); - model.in1 = []; - model.out = [[n],[n]]; - model.state = state.slice(); - model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; - model.ipar = ipar; - model.nzcross = n*(n-1)/2+4*n; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("bounce_ball",4); + this.model.in1 = []; + this.model.out = [[n],[n]]; + this.model.state = state.slice(); + this.model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; + this.model.ipar = ipar; + this.model.nzcross = new ScilabDouble(n*(n-1)/2+4*n); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.rpar1))],[strcat(sci2exp(this.rpar2))],[strcat(sci2exp(this.walls))],[strcat(sci2exp(this.x))],[strcat(sci2exp(this.xd))],[strcat(sci2exp(this.y))],[strcat(sci2exp(this.yd))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BOUNCE.prototype.details = function BOUNCE() { @@ -11425,7 +11425,7 @@ function BOUNCE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<9) { exprs[8-1] = "9.81"; exprs[9-1] = "0"; @@ -11459,7 +11459,7 @@ function BOUNCE() { if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,[],[n,n],[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[],[n,n],[],[]); if (ok) { k = 1; ipar = []; @@ -11471,15 +11471,15 @@ function BOUNCE() { k = k+1; } } - model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; - model.ipar = ipar; + this.model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; + this.model.ipar = ipar; state = [this.xt,this.xd,this.y,this.yd]; state = transpose(state); - model.state = state.slice(); - model.nzcross = n*(n-1)/2+4*n; + this.model.state = state.slice(); + this.model.nzcross = new ScilabDouble(n*(n-1)/2+4*n); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -11497,12 +11497,12 @@ function BOUNCEXY() { this.xmax = 5; this.ymin = 0; this.ymax = 15; - model = scicos_model(); - model.sim = list("bouncexy",4); - model.in1 = [[-1],[-1]]; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; + this.model = scicos_model(); + this.model.sim = list("bouncexy",4); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); z = []; for (i=1;i<=size(this.clrs,"*");i+=1) { z[6*(i-1)+1-1] = 0; @@ -11512,15 +11512,15 @@ function BOUNCEXY() { z[6*(i-1)+5-1] = 0.000; z[6*(i-1)+6-1] = 64.0*360.000; } - model.dstate = z; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = [[this.win],[this.imode],[this.clrs.slice()]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model.dstate = z; + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = [[this.win],[this.imode],[this.clrs.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = [[strcat(sci2exp(this.clrs))],[strcat(sci2exp(this.siz))],[strcat(sci2exp(this.win))],[strcat(sci2exp(1))],[strcat(sci2exp(this.xmin))],[strcat(sci2exp(this.xmax))],[strcat(sci2exp(this.ymin))],[strcat(sci2exp(this.ymax))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BOUNCEXY.prototype.details = function BOUNCEXY() { @@ -11551,8 +11551,8 @@ function BOUNCEXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; while (true) { [ok,this.clrs,this.siz,this.win,this.imode,this.xmin,this.xmax,this.ymin,this.ymax,exprs] = scicos_getvalue("Set Scope parameters",["colors","radii","window number (-1 for automatic)","animation mode (0,1)","Xmin","Xmax","Ymin","Ymax"],list("vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -11589,12 +11589,12 @@ function BOUNCEXY() { z[6*(i-1)+5-1] = 0.000; z[6*(i-1)+6-1] = 64.0*360.000; } - model.dstate = z; - model.rpar = rpar; - model.ipar = ipar; + this.model.dstate = z; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -11611,17 +11611,17 @@ function BPLATFORM() { this.xmax = 5; this.ymin = 0; this.ymax = 15; - model = scicos_model(); - model.sim = list("bplatform2",5); - model.in1 = [[1],[1]]; - model.evtin = 1; - model.dstate = 0; - model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; - exprs = string(model.rpar); + this.model = scicos_model(); + this.model.sim = list("bplatform2",5); + this.model.in1 = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; + exprs = string(this.model.rpar); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BPLATFORM.prototype.details = function BPLATFORM() { @@ -11650,8 +11650,8 @@ function BPLATFORM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; while (true) { [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.ymax,exprs] = scicos_getvalue("Set Scope parameters",["pendulum length","cart size (square side)","slope","Xmin","Xmax","Ymin","Ymax"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -11674,10 +11674,10 @@ function BPLATFORM() { message(mess); } else { rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -11699,23 +11699,23 @@ function CBLOCK() { this.ipar = []; funam = "toto"; this.ng = 0; - model = scicos_model(); - model.sim = list(" ",2004); - model.in1 = in1; - model.out = out; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; - model.nzcross = this.ng; + this.model = scicos_model(); + this.model.sim = list(" ",2004); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = this.ipar; + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; + this.model.nzcross = new ScilabDouble(this.ng); label = list(transpose([funam,"n",sci2exp(in1),sci2exp(out),sci2exp(clkin),sci2exp(clkout),sci2exp(x0),sci2exp(0),sci2exp(z0),sci2exp(this.rpar),sci2exp(this.ipar),sci2exp(auto),"y","n"]),[]); gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } CBLOCK.prototype.details = function CBLOCK() { @@ -11757,7 +11757,7 @@ function CBLOCK() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -11807,7 +11807,7 @@ function CBLOCK() { if (funam==" ") { break; } - if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=this.ng||sign(size(model.evtout,"*"))!=sign(nevout)) { + if (this.model.sim[1-1]!=funam||sign(size(this.model.state,"*"))!=sign(nx)||sign(size(this.model.dstate,"*"))!=sign(nz)||this.model.nzcross!=this.ng||sign(size(this.model.evtout,"*"))!=sign(nevout)) { tt = []; } tt = label[2-1]; @@ -11818,22 +11818,22 @@ function CBLOCK() { break; } } else { - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); if (ok) { - model.sim = list(funam,funtyp); - model.in1 = this.i; - model.out = this.o; - model.evtin = this.ci; - model.evtout = this.co; - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.firing = this.auto0; - model.dep_ut = dep_ut; - model.nzcross = this.ng; + this.model.sim = list(funam,funtyp); + this.model.in1 = new ScilabDouble(this.i); + this.model.out = new ScilabDouble(this.o); + this.model.evtin = new ScilabDouble(this.ci); + this.model.evtout = new ScilabDouble(this.co); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.dep_ut = dep_ut; + this.model.nzcross = new ScilabDouble(this.ng); label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; @@ -11851,18 +11851,18 @@ function CBLOCK() { function CBLOCK4() { CBLOCK4.prototype.define = function CBLOCK4() { funam = "toto"; - model = scicos_model(); - model.sim = list(" ",2004); - model.in1 = 1; - model.in2 = 1; - model.intyp = 1; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.dep_ut = [true,false]; - label = list([[funam],["n"],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2])],[sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]],[]); + this.model = scicos_model(); + this.model.sim = list(" ",2004); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.dep_ut = [true,false]; + label = list([[funam],["n"],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2])],[sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]],[]); gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } CBLOCK4.prototype.details = function CBLOCK4() { @@ -11914,7 +11914,7 @@ function CBLOCK4() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -11962,11 +11962,11 @@ function CBLOCK4() { if (funam==" ") { break; } - if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=this.nzcr||sign(size(model.evtout,"*"))!=sign(nevout)) { + if (this.model.sim[1-1]!=funam||sign(size(this.model.state,"*"))!=sign(nx)||sign(size(this.model.dstate,"*"))!=sign(nz)||this.model.nzcross!=this.nzcr||sign(size(this.model.evtout,"*"))!=sign(nevout)) { tt = []; } tt = label[2-1]; - [model,graphics,ok] = set_io(model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); + [model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); } if (ok) { while (true) { @@ -11976,19 +11976,19 @@ function CBLOCK4() { break; } } else { - model.sim = list(funam,funtyp); - model.state = this.xx; - model.dstate = this.z; - model.odstate = this.oz; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.opar = this.opar; - model.firing = this.auto0; - model.nzcross = this.nzcr; - model.nmode = this.nmode; - model.dep_ut = dep_ut; + this.model.sim = list(funam,funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.odstate = new ScilabDouble(this.oz); + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.opar = new ScilabDouble(this.opar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.nzcross = new ScilabDouble(this.nzcr); + this.model.nmode = new ScilabDouble(this.nmode); + this.model.dep_ut = dep_ut; label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; @@ -12008,17 +12008,17 @@ function CONSTRAINT2_c() { this.x0 = [0]; this.xd0 = [0]; this.id = [0]; - model = scicos_model(); - model.sim = list("constraint_c",10004); - model.in1 = 1; - model.out = [[1],[1]]; - model.state = [[this.x0],[this.xd0]]; - model.ipar = this.id; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("constraint_c",10004); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.state = [[this.x0],[this.xd0]]; + this.model.ipar = this.id; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = list(strcat(sci2exp(this.x0)),strcat(sci2exp(this.xd0)),strcat(sci2exp(this.id))); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONSTRAINT2_c.prototype.details = function CONSTRAINT2_c() { @@ -12039,7 +12039,7 @@ function CONSTRAINT2_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { ask_again = false; [ok,this.x0,this.xd0,this.id,exprs] = scicos_getvalue("Set Constraint block parameters",["Initial guess values of states x","Initial guess values of derivative x\'","Id(i)=1: if x\'(i) is present in the feedback, else Id(i)=0"],list("vec",-1,"vec",-1,"vec",-1),exprs); @@ -12074,12 +12074,12 @@ function CONSTRAINT2_c() { } if (!ask_again) { graphics.exprs = exprs; - model.state = [[this.x0],[this.xd0]]; - model.out = [[N],[N]]; - model.in1 = N; - model.ipar = this.id; + this.model.state = [[this.x0],[this.xd0]]; + this.model.out = [[N],[N]]; + this.model.in1 = new ScilabDouble(N); + this.model.ipar = this.id; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -12090,17 +12090,17 @@ function CONSTRAINT2_c() { function CONSTRAINT_c() { CONSTRAINT_c.prototype.define = function CONSTRAINT_c() { this.x0 = [[0],[0]]; - model = scicos_model(); - model.sim = list("constraint_c",10004); - model.in1 = 1; - model.out = 1; - model.ipar = 0; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("constraint_c",10004); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(0); + this.model.state = this.x0; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = "0"; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONSTRAINT_c.prototype.details = function CONSTRAINT_c() { @@ -12116,7 +12116,7 @@ function CONSTRAINT_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,exprs] = scicos_getvalue("Set solver block parameters","Initial guess values",list("vec",-1),exprs); if (!ok) { @@ -12127,15 +12127,15 @@ function CONSTRAINT_c() { if (N<=0) { message("number of states (constraints) must be > 0 "); } else { - [model,graphics,ok] = check_io(model,graphics,N,N,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,N,N,[],[]); if (ok) { graphics.exprs = exprs; - model.state = [[this.x0],[zeros(N,1)]]; - model.out = N; - model.in1 = N; - model.ipar = -1*ones(N,1); + this.model.state = [[this.x0],[zeros(N,1)]]; + this.model.out = new ScilabDouble(N); + this.model.in1 = new ScilabDouble(N); + this.model.ipar = new ScilabDouble(-1*ones(N,1)); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -12149,18 +12149,18 @@ function DEADBAND() { this.minp = -.5; this.maxp = .5; rpar = [[this.maxp],[this.minp]]; - model = scicos_model(); - model.sim = list("deadband",4); - model.in1 = 1; - model.nzcross = 2; - model.nmode = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [true,false]; - exprs = [[string(this.maxp)],[string(this.minp)],[string(model.nmode)]]; + this.model = scicos_model(); + this.model.sim = list("deadband",4); + this.model.in1 = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + exprs = [[string(this.maxp)],[string(this.minp)],[string(this.model.nmode)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEADBAND.prototype.details = function DEADBAND() { @@ -12181,7 +12181,7 @@ function DEADBAND() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,this.zeroc,exprs] = scicos_getvalue("Set Deadband parameters",["End of dead band","Start of dead band","zero crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -12191,17 +12191,17 @@ function DEADBAND() { message("Upper limit must be > Lower limit"); } else { rpar = [[this.maxp],[this.minp]]; - model.rpar = rpar; + this.model.rpar = rpar; if (this.zeroc!=0) { - model.nzcross = 2; - model.nmode = 1; + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); } else { - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -12211,12 +12211,12 @@ function DEADBAND() { /* autogenerated from "macros/Misc/DEBUG.sci" */ function DEBUG() { DEBUG.prototype.define = function DEBUG() { - model = scicos_model(); - model.sim = list("%debug_scicos",99); - model.blocktype = "d"; + this.model = scicos_model(); + this.model.sim = list("%debug_scicos",99); + this.model.blocktype = new ScilabString("d"); exprs = list("","xcos_debug_gui(flag,block);"); gr_i = []; - this.x = standard_define([8,2],model,exprs,gr_i); + this.x = standard_define([8,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEBUG.prototype.details = function DEBUG() { @@ -12286,16 +12286,16 @@ function DEBUG_SCICOS() { function DIFF_f() { DIFF_f.prototype.define = function DIFF_f() { this.x0 = [[0],[0]]; - model = scicos_model(); - model.sim = list("diffblk",10001); - model.in1 = 1; - model.out = 1; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("diffblk",10001); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = this.x0; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DIFF_f.prototype.details = function DIFF_f() { @@ -12314,16 +12314,16 @@ function DIFF_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,this.xd0,exprs] = scicos_getvalue("Set continuous linear system parameters",["Initial state","Initial Derivative"],list("vec",1,"vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - model.state = [[this.x0.slice()],[this.xd0.slice()]]; + this.model.state = [[this.x0.slice()],[this.xd0.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } this.x.model.firing = []; @@ -12391,18 +12391,18 @@ function DSUPER() { function EDGETRIGGER() { EDGETRIGGER.prototype.define = function EDGETRIGGER() { this.edge = 1; - model = scicos_model(); - model.sim = list("edgetrig",4); - model.in1 = 1; - model.out = 1; - model.dstate = 0; - model.nzcross = 1; - model.ipar = sign(this.edge); - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("edgetrig",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(sign(this.edge)); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string(this.edge)]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EDGETRIGGER.prototype.details = function EDGETRIGGER() { @@ -12419,16 +12419,16 @@ function EDGETRIGGER() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.edge,exprs] = scicos_getvalue("Set edge trigger block parameters",["rising (1), falling (-1), both (0)"],list("vec",1),exprs); if (!ok) { break; } - model.ipar = sign(this.edge); + this.model.ipar = new ScilabDouble(sign(this.edge)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -12447,51 +12447,51 @@ function EDGE_TRIGGER() { scs_m_1.objs[7-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [60,0]; graphics.sz = [60,40]; graphics.exprs = "0"; - model.ipar = 0; + this.model.ipar = new ScilabDouble(0); graphics.pin = 5; graphics.pout = 6; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [160,0]; graphics.sz = [60,40]; graphics.exprs = [["0"],["0"]]; - model.evtin = []; - model.nzcross = 0; - model.nmode = 0; + this.model.evtin = []; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); graphics.pin = 6; graphics.peout = [[7],[0]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; blk = scs_m_1.objs[3-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,10]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pout = 5; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[3-1] = blk; blk = scs_m_1.objs[4-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [170,-60]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pein = 7; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[4-1] = blk; lnk = scs_m_1.objs[5-1]; lnk.from = [3,1,0]; @@ -12508,13 +12508,13 @@ function EDGE_TRIGGER() { scs_m_1.objs[7-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.in1 = 1; - model.evtout = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } EDGE_TRIGGER.prototype.details = function EDGE_TRIGGER() { @@ -12547,40 +12547,40 @@ function EDGE_TRIGGER() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (diffobjs(this.xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; @@ -12602,9 +12602,9 @@ function ENDBLK() { scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[-159.096,811.104,-121.216,617.984,1323,1008,331,284,630,480,0,7,1.4],Title="ENDBLK",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",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="END_c",graphics=scicos_graphics(orig=[272.104,249.11733],sz=[40,40],flip=true,theta=0,exprs="1.000E+08",pin=[],pout=[],pein=2,peout=2,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim=list("scicosexit",4),in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=1,evtout=1,state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="d",firing=1.000e+08,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[2-1] = scicos_link(xx=[[292.104],[292.104],[261.83733],[261.83733],[292.104],[292.104]],yy=[[243.40305],[234.45067],[234.45067],[305.584],[305.584],[294.83162]],id="drawlink",thick=[0,0],ct=[5,-1],from=[1,1,0],to=[1,1,1]); - model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); + this.model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } ENDBLK.prototype.details = function ENDBLK() { @@ -12637,40 +12637,40 @@ function ENDBLK() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (!this.isequalbitwise[this.xxn-1][xx-1]) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)||or(this.model.in2!=model_n.in2)||or(this.model.out2!=model_n.out2)||or(this.model.outtyp!=model_n.outtyp)||or(this.model.intyp!=model_n.intyp)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))||(size(model.evtin,"*")!=size(model_n.evtin,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))||(size(this.model.evtin,"*")!=size(model_n.evtin,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; @@ -12700,49 +12700,49 @@ function Extract_Activation() { scs_m_1.objs[8-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [80,0]; graphics.sz = [60,40]; graphics.exprs = [["0"],["0"]]; - model.evtin = []; - model.nzcross = 0; - model.nmode = 0; + this.model.evtin = []; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); graphics.pin = 7; graphics.peout = [[5],[6]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [80,-80]; graphics.sz = [80,40]; graphics.pein = [[5],[6]]; graphics.peout = 8; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; blk = scs_m_1.objs[3-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,10]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pout = 7; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[3-1] = blk; blk = scs_m_1.objs[4-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [110,-140]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pein = 8; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[4-1] = blk; lnk = scs_m_1.objs[5-1]; lnk.ct = [5,-1]; @@ -12765,13 +12765,13 @@ function Extract_Activation() { scs_m_1.objs[8-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.in1 = 1; - model.evtout = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } Extract_Activation.prototype.details = function Extract_Activation() { @@ -12794,18 +12794,18 @@ function HYSTHERESIS() { ipar = [0]; this.nzz = 2; rpar = [[1],[0],[1],[0]]; - model = scicos_model(); - model.sim = list("hystheresis",4); - model.in1 = in1; - model.out = 1; - model.rpar = rpar; - model.nzcross = this.nzz; - model.nmode = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("hystheresis",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.nzcross = new ScilabDouble(this.nzz); + this.model.nmode = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(rpar)],[string(sign(this.nzz))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } HYSTHERESIS.prototype.details = function HYSTHERESIS() { @@ -12830,7 +12830,7 @@ function HYSTHERESIS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.high_lim,this.low_lim,this.out_high,this.out_low,this.nzz,exprs] = scicos_getvalue("Set parameters",["switch on at","switch off at","output when on","output when off","use zero crossing: yes (1), no (0)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -12840,13 +12840,13 @@ function HYSTHERESIS() { message("switch on value must be larger than switch off value"); } else { graphics.exprs = exprs; - model.rpar = transpose([this.high_lim,this.low_lim,this.out_high,this.out_low]); + this.model.rpar = transpose([this.high_lim,this.low_lim,this.out_high,this.out_low]); if (this.nzz>0) { this.nzz = 2; } - model.nzcross = this.nzz; + this.model.nzcross = new ScilabDouble(this.nzz); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -12856,16 +12856,16 @@ function HYSTHERESIS() { /* autogenerated from "macros/Misc/IMPSPLIT_f.sci" */ function IMPSPLIT_f() { IMPSPLIT_f.prototype.define = function IMPSPLIT_f() { - model = scicos_model(); - model.sim = "limpsplit"; + this.model = scicos_model(); + this.model.sim = new ScilabString("limpsplit"); mo = modelica(); mo.model = "limpsplit"; mo.inputs = "n"; mo.outputs = [["n"],["n"]]; - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - this.x = standard_define([1,1]/3,model,[],[]); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.x = standard_define([1,1]/3,this.model,[],[]); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I","I"]; return new BasicBlock(this.x); @@ -12889,16 +12889,16 @@ function LOGICAL_OP() { in1 = [[-1],[-1]]; ipar = [0]; this.nin = 2; - model = scicos_model(); - model.sim = list("logicalop",4); - model.in1 = in1; - model.out = -1; - model.ipar = ipar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("logicalop",4); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = ipar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[string(ipar)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOGICAL_OP.prototype.details = function LOGICAL_OP() { @@ -12921,7 +12921,7 @@ function LOGICAL_OP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,1)==2) { exprs = [[exprs],[sci2exp(1)],[sci2exp(0)]]; } @@ -12951,26 +12951,26 @@ function LOGICAL_OP() { this.tp = 1; } if (this.Datatype==1) { - model.sim = list("logicalop",4); - model.ipar = [this.rule]; + this.model.sim = list("logicalop",4); + this.model.ipar = [this.rule]; } else { if (this.Datatype==3) { - model.sim = list("logicalop_i32",4); + this.model.sim = list("logicalop_i32",4); } else if (this.Datatype==4) { - model.sim = list("logicalop_i16",4); + this.model.sim = list("logicalop_i16",4); } else if (this.Datatype==5) { - model.sim = list("logicalop_i8",4); + this.model.sim = list("logicalop_i8",4); } else if (this.Datatype==6) { - model.sim = list("logicalop_ui32",4); + this.model.sim = list("logicalop_ui32",4); } else if (this.Datatype==7) { - model.sim = list("logicalop_ui16",4); + this.model.sim = list("logicalop_ui16",4); } else if (this.Datatype==8) { - model.sim = list("logicalop_ui8",4); + this.model.sim = list("logicalop_ui8",4); } else { message("Datatype is not supported"); ok = false; } - model.ipar = [[this.rule],[this.tp]]; + this.model.ipar = [[this.rule],[this.tp]]; } if (ok) { it = this.Datatype*ones(this.nin,1); @@ -12978,10 +12978,10 @@ function LOGICAL_OP() { in1 = [-ones(this.nin,1),-2*ones(this.nin,1)]; if ((this.rule!=5)&&(this.nin==1)) { out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } else { out = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } } if (ok) { @@ -13001,7 +13001,7 @@ function LOGICAL_OP() { graphics.exprs = exprs; graphics.style = ["blockWithLabel;displayedLabel="+label]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -13021,24 +13021,24 @@ function MBLOCK() { this.pprop = [[0],[0]]; nameF = "generic"; exprs = tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(this.pprop.slice()),nameF,[]); - model = scicos_model(); - model.blocktype = "c"; - model.dep_ut = [false,true]; - model.rpar = []; + this.model = scicos_model(); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[paramv[i-1].slice()]]; + this.model.rpar = [[this.model.rpar],[paramv[i-1].slice()]]; } mo = modelica(); mo.model = nameF; mo.parameters = list(param,paramv); - model.sim = list(mo.model,30004); + this.model.sim = list(mo.model,30004); mo.inputs = this.in1; mo.outputs = this.out; - model.in1 = ones(size(mo.inputs,"r"),1); - model.out = ones(size(mo.outputs,"r"),1); - model.equations = mo; + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"r"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"r"),1)); + this.model.equations = mo; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = this.intype; this.x.graphics.out_implicit = this.outtype; return new BasicBlock(this.x); @@ -13068,14 +13068,14 @@ function MBLOCK() { this.Tfunam = arguments[0]["Tfunam"] this.lab_1 = inverse(arguments[0]["lab_1"]) this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; if (this.type[exprs-1]==15) { paramv = list(); this.pprop = []; - for (i=1;i<=size(model.rpar,"*");i+=1) { - paramv[$+1-1] = string(model.rpar[i-1]); + for (i=1;i<=size(this.model.rpar,"*");i+=1) { + paramv[$+1-1] = string(this.model.rpar[i-1]); this.pprop[$+1-1] = 0; } exprs = tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(this.pprop.slice()),exprs[1-1][7-1],exprs[2-1]); @@ -13191,7 +13191,7 @@ function MBLOCK() { if (ok) { intypex = find(this.intype=="I"); outtypex = find(this.outtype=="I"); - [model,graphics,ok] = set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); + [model,graphics,ok] = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); } if (ok) { Tparam_lab = evstr(this.Tparam); @@ -13245,7 +13245,7 @@ function MBLOCK() { tt = mgetl(this.funam); } else { tt = exprs.funtxt; - mo = model.equations; + mo = this.model.equations; if (mo.model!=nameF) { tt = []; } @@ -13265,12 +13265,12 @@ function MBLOCK() { } else { mo.parameters = list(transpose(param),paramv); } - model.equations = mo; - model.rpar = []; + this.model.equations = new ScilabDouble(mo); + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[paramv[i-1].slice()]]; + this.model.rpar = [[this.model.rpar],[paramv[i-1].slice()]]; } - model.sim[1-1] = this.funam; + this.model.sim[('1', 'double')] = new ScilabDouble(this.funam); exprs.in1 = this.lab_1[1-1]; exprs.intype = this.lab_1[2-1]; exprs.out = this.lab_1[3-1]; @@ -13291,7 +13291,7 @@ function MBLOCK() { exprs.pprop = this.lab_1[6-1]; exprs.nameF = this.lab_1[7-1]; exprs.funtxt = tt; - this.x.model = model; + this.x.model = this.model; graphics.gr_i[1-1][1-1] = "txt=[\'Modelica\';\' "+nameF+" \'];"; graphics.in_implicit = this.intype; graphics.out_implicit = this.outtype; @@ -13309,17 +13309,17 @@ function MEMORY_f() { z = 0; in1 = 1; exprs = [[string(z)],[string(1)]]; - model = scicos_model(); - model.sim = "memo"; - model.in1 = in1; - model.out = in1; - model.evtin = 1; - model.dstate = 0; - model.rpar = z; - model.blocktype = "m"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("memo"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.rpar = new ScilabDouble(z); + this.model.blocktype = new ScilabString("m"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MEMORY_f.prototype.details = function MEMORY_f() { @@ -13338,7 +13338,7 @@ function MEMORY_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.a,this.inh,exprs] = scicos_getvalue("Set memory block parameters",["initial condition","Inherit (1: no, 0: yes)"],list("vec",-1,"vec",1),exprs); if (!ok) { @@ -13349,7 +13349,7 @@ function MEMORY_f() { } else { this.inh = 1; } - [model,graphics,ok] = check_io(model,graphics,-1,-1,this.inh,[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,-1,this.inh,[]); out = size(this.a,"*"); if (out==0) { ok = false; @@ -13358,11 +13358,11 @@ function MEMORY_f() { in1 = out; if (ok) { graphics.exprs = exprs; - model.rpar = this.a; - model.in1 = in1; - model.out = out; + this.model.rpar = new ScilabDouble(this.a); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -13381,24 +13381,24 @@ function MPBLOCK() { pprop = []; nameF = "myModel"; exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]); - model = scicos_model(); - model.blocktype = "c"; - model.dep_ut = [true,true]; - model.rpar = []; + this.model = scicos_model(); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,true]; + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[paramv[i-1].slice()]]; + this.model.rpar = [[this.model.rpar],[paramv[i-1].slice()]]; } mo = modelica(); mo.model = nameF; mo.parameters = list(param,paramv); - model.sim = list(mo.model,10004); + this.model.sim = list(mo.model,10004); mo.inputs = this.in1; mo.outputs = this.out; - model.in1 = ones(size(mo.inputs,"r"),1); - model.out = ones(size(mo.outputs,"r"),1); - model.equations = mo; + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"r"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"r"),1)); + this.model.equations = mo; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = this.intype; this.x.graphics.out_implicit = this.outtype; return new BasicBlock(this.x); @@ -13413,14 +13413,14 @@ function MPBLOCK() { } MPBLOCK.prototype.set = function MPBLOCK() { this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; if (this.type[exprs-1]==15) { paramv = list(); pprop = []; - for (i=1;i<=size(model.rpar,"*");i+=1) { - paramv[$+1-1] = string(model.rpar[i-1]); + for (i=1;i<=size(this.model.rpar,"*");i+=1) { + paramv[$+1-1] = string(this.model.rpar[i-1]); pprop[$+1-1] = 0; } exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),exprs[1-1][7-1],exprs[2-1]); @@ -13536,7 +13536,7 @@ function MPBLOCK() { if (ok) { intypex = find(this.intype=="I"); outtypex = find(this.outtype=="I"); - [model,graphics,ok] = set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); + [model,graphics,ok] = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); } if (ok) { Tparam_lab = evstr(Tparam); @@ -13602,12 +13602,12 @@ function MPBLOCK() { mo.parameters = list(transpose(param),paramv); } } - model.equations = mo; - model.rpar = []; + this.model.equations = new ScilabDouble(mo); + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[double(paramv[i-1].slice())]]; + this.model.rpar = [[this.model.rpar],[double(paramv[i-1].slice())]]; } - model.sim[1-1] = this.funam; + this.model.sim[('1', 'double')] = new ScilabDouble(this.funam); exprs.in1 = lab_1[1-1]; exprs.intype = lab_1[2-1]; exprs.out = lab_1[3-1]; @@ -13628,7 +13628,7 @@ function MPBLOCK() { exprs.pprop = lab_1[6-1]; exprs.nameF = lab_1[7-1]; exprs.funtxt = ""; - this.x.model = model; + this.x.model = this.model; graphics.gr_i[1-1][1-1] = "txt=[\' "+nameF+" \'];"; graphics.in_implicit = this.intype; graphics.out_implicit = this.outtype; @@ -13645,15 +13645,15 @@ function PAL_f() { PAL_f.prototype.define = function PAL_f() { scs = scicos_diagram(); scs.props.title = "Palette"; - model = scicos_model(); - model.sim = "palette"; - model.in1 = []; - model.out = []; - model.rpar = scs; - model.blocktype = "h"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("palette"); + this.model.in1 = []; + this.model.out = []; + this.model.rpar = new ScilabDouble(scs); + this.model.blocktype = new ScilabString("h"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); this.x.graphics.id = scs.props.title[1-1]; return new BasicBlock(this.x); } @@ -13686,17 +13686,17 @@ function PENDULUM_ANIM() { this.xmax = 5; this.ymin = -5; this.ymax = 5; - model = scicos_model(); - model.sim = list("anim_pen",5); - model.in1 = [[1],[1]]; - model.evtin = 1; - model.dstate = 0; - model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; - exprs = string(model.rpar); + this.model = scicos_model(); + this.model.sim = list("anim_pen",5); + this.model.in1 = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; + exprs = string(this.model.rpar); gr_i = []; - this.x = standard_define([3,3],model,exprs,gr_i); + this.x = standard_define([3,3],this.model,exprs,gr_i); return new BasicBlock(this.x); } PENDULUM_ANIM.prototype.details = function PENDULUM_ANIM() { @@ -13725,8 +13725,8 @@ function PENDULUM_ANIM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; while (true) { [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.ymax,exprs] = scicos_getvalue("Set Scope parameters",["pendulum length","cart size (square side)","slope","Xmin","Xmax","Ymin","Ymax"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -13749,10 +13749,10 @@ function PENDULUM_ANIM() { message(mess); } else { rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -13765,16 +13765,16 @@ function RATELIMITER() { this.minp = -1; this.maxp = 1; rpar = [[this.maxp],[this.minp]]; - model = scicos_model(); - model.sim = list("ratelimiter",4); - model.in1 = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("ratelimiter",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.maxp)],[string(this.minp)]]; gr_i = []; - this.x = standard_define([3.5,2],model,exprs,gr_i); + this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RATELIMITER.prototype.details = function RATELIMITER() { @@ -13793,7 +13793,7 @@ function RATELIMITER() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,exprs] = scicos_getvalue("Set rate limiter parameters",["max slope","min slope"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -13803,10 +13803,10 @@ function RATELIMITER() { message("We must have max_slope> 0 > min_slope."); } else { rpar = [[this.maxp],[this.minp]]; - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -13818,16 +13818,16 @@ function RELATIONALOP() { RELATIONALOP.prototype.define = function RELATIONALOP() { ipar = [2]; label = "<"; - model = scicos_model(); - model.sim = list("relationalop",4); - model.in1 = [[1],[1]]; - model.out = 1; - model.ipar = ipar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("relationalop",4); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.ipar = ipar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(ipar)],[string(0)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label]; return new BasicBlock(this.x); } @@ -13849,7 +13849,7 @@ function RELATIONALOP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,1)==2) { exprs = [[exprs],[sci2exp(1)]]; } @@ -13867,19 +13867,19 @@ function RELATIONALOP() { ok = false; } if ((this.Datatype==1)) { - model.sim = list("relational_op",4); + this.model.sim = list("relational_op",4); } else if ((this.Datatype==3||this.Datatype==9)) { - model.sim = list("relational_op_i32",4); + this.model.sim = list("relational_op_i32",4); } else if ((this.Datatype==4)) { - model.sim = list("relational_op_i16",4); + this.model.sim = list("relational_op_i16",4); } else if ((this.Datatype==5)) { - model.sim = list("relational_op_i8",4); + this.model.sim = list("relational_op_i8",4); } else if ((this.Datatype==6)) { - model.sim = list("relational_op_ui32",4); + this.model.sim = list("relational_op_ui32",4); } else if ((this.Datatype==7)) { - model.sim = list("relational_op_ui16",4); + this.model.sim = list("relational_op_ui16",4); } else if ((this.Datatype==8)) { - model.sim = list("relational_op_ui8",4); + this.model.sim = list("relational_op_ui8",4); } else { message("Datatype is not supported"); ok = false; @@ -13889,7 +13889,7 @@ function RELATIONALOP() { ot = this.Datatype; in1 = [[-1,-2],[-1,-2]]; out = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { if (this.rule==0) { @@ -13907,11 +13907,11 @@ function RELATIONALOP() { } graphics.exprs = exprs; graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label]; - model.ipar = [this.rule]; - model.nzcross = this.zcr; - model.nmode = this.zcr; + this.model.ipar = [this.rule]; + this.model.nzcross = new ScilabDouble(this.zcr); + this.model.nmode = new ScilabDouble(this.zcr); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -13921,13 +13921,13 @@ function RELATIONALOP() { /* autogenerated from "macros/Misc/SPLIT_f.sci" */ function SPLIT_f() { SPLIT_f.prototype.define = function SPLIT_f() { - model = scicos_model(); - model.sim = "lsplit"; - model.in1 = -1; - model.out = [[-1],[-1],[-1]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; - this.x = standard_define([1,1]/3,model,[],[]); + this.model = scicos_model(); + this.model.sim = new ScilabString("lsplit"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = [[-1],[-1],[-1]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.x = standard_define([1,1]/3,this.model,[],[]); return new BasicBlock(this.x); } SPLIT_f.prototype.details = function SPLIT_f() { @@ -13956,15 +13956,15 @@ function SUPER_f() { out.graphics.sz = [20,20]; scs.objs[1-1] = in1; scs.objs[2-1] = out; - model = scicos_model(); - model.sim = "super"; - model.in1 = 1; - model.out = 1; - model.rpar = scs; - model.blocktype = "h"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("super"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(scs); + this.model.blocktype = new ScilabString("h"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new SuperBlock(this.x); } SUPER_f.prototype.details = function SUPER_f() { @@ -13985,16 +13985,16 @@ function TEXT_f() { TEXT_f.prototype.define = function TEXT_f() { this.font = 2; this.siz = 1; - model = scicos_model(); - model.sim = "text"; - model.rpar = "Text"; - model.ipar = [[this.font],[this.siz]]; + this.model = scicos_model(); + this.model.sim = new ScilabString("text"); + this.model.rpar = new ScilabString("Text"); + this.model.ipar = [[this.font],[this.siz]]; exprs = [["Text"],[string(this.font)],[string(this.siz)]]; graphics = scicos_graphics(); graphics.orig = [0,0]; graphics.sz = [2,1]; graphics.exprs = exprs; - this.x = mlist(["Text","graphics","model","void","gui"],graphics,model," ","TEXT_f"); + this.x = mlist(["Text","graphics","model","void","gui"],graphics,this.model," ","TEXT_f"); return new TextBlock(this.x); } TEXT_f.prototype.details = function TEXT_f() { @@ -14016,7 +14016,7 @@ function TEXT_f() { graphics = arg1.graphics; orig = graphics.orig; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==1) { exprs = [[exprs],["3"],["1"]]; } @@ -14049,9 +14049,9 @@ function TEXT_f() { graphics.sz = sz; this.x.graphics = graphics; ipar = [[this.font],[this.siz]]; - model.rpar = this.txt; - model.ipar = ipar; - this.x.model = model; + this.model.rpar = new ScilabDouble(this.txt); + this.model.ipar = ipar; + this.x.model = this.model; break; } } @@ -14071,22 +14071,22 @@ function c_block() { auto = []; this.rpar = []; this.funam = "toto"; - model = scicos_model(); - model.sim = list(" ",2001); - model.in1 = in1; - model.out = out; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list(" ",2001); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(0); + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; label = list([[sci2exp(in1)],[sci2exp(out)],[strcat(sci2exp(this.rpar))],[this.funam]],list([])); gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } c_block.prototype.details = function c_block() { @@ -14108,7 +14108,7 @@ function c_block() { this.funam = arguments[0]["funam"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -14126,19 +14126,19 @@ function c_block() { this.o = int(this.o.slice()); no = size(this.o,1); tt = label[2-1]; - if (model.sim[1-1]!=this.funam||size(model.in1,"*")!=size(this.i,"*")||size(model.out,"*")!=size(this.o,"*")) { + if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { tt = []; } [ok,tt] = CFORTR(this.funam,tt,this.i,this.o); if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]); if (ok) { - model.sim[1-1] = this.funam; - model.rpar = this.rpar; + this.model.sim[('1', 'double')] = new ScilabString(this.funam); + this.model.rpar = this.rpar; label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; @@ -14150,23 +14150,23 @@ function c_block() { /* autogenerated from "macros/Misc/fortran_block.sci" */ function fortran_block() { fortran_block.prototype.define = function fortran_block() { - model = scicos_model(); - model.sim = list(" ",1001); - model.in1 = 1; - model.out = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = 0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list(" ",1001); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = new ScilabDouble(0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; this.funam = "forty"; - label = list([[sci2exp(model.in1)],[sci2exp(model.out)],[strcat(sci2exp(model.rpar))],[this.funam]],list([])); + label = list([[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[strcat(sci2exp(this.model.rpar))],[this.funam]],list([])); gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } fortran_block.prototype.details = function fortran_block() { @@ -14188,7 +14188,7 @@ function fortran_block() { this.funam = arguments[0]["funam"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -14206,19 +14206,19 @@ function fortran_block() { this.o = int(this.o.slice()); no = size(this.o,1); tt = label[2-1]; - if (model.sim[1-1]!=this.funam||size(model.in1,"*")!=size(this.i,"*")||size(model.out,"*")!=size(this.o,"*")) { + if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { tt = []; } [ok,tt] = FORTR(this.funam,tt,this.i,this.o); if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]); if (ok) { - model.sim[1-1] = this.funam; - model.rpar = this.rpar; + this.model.sim[('1', 'double')] = new ScilabString(this.funam); + this.model.rpar = this.rpar; label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; @@ -14230,15 +14230,15 @@ function fortran_block() { /* autogenerated from "macros/Misc/func_block.sci" */ function func_block() { func_block.prototype.define = function func_block() { - model = scicos_model(); - model.sim = " "; - model.in1 = 1; - model.out = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString(" "); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = "v=sin(u);y=u*v"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } func_block.prototype.details = function func_block() { @@ -14250,16 +14250,16 @@ function func_block() { return options; } func_block.prototype.set = function func_block() { - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; this.x = arg1; - model = this.x.model; + this.model = this.x.model; [ok,mac,exprs] = this.genfunc[exprs-1]; if (ok) { - model.sim = mac; + this.model.sim = new ScilabDouble(mac); graphics.exprs = exprs; - this.x.model = model; + this.x.model = this.model; this.x.graphics = graphics; } return new BasicBlock(this.x); @@ -14268,24 +14268,24 @@ function func_block() { /* autogenerated from "macros/Misc/generic_block.sci" */ function generic_block() { generic_block.prototype.define = function generic_block() { - model = scicos_model(); + this.model = scicos_model(); this.function_name = "sinblk"; this.funtyp = 1; - model.sim = list(this.function_name,this.funtyp); - model.in1 = 1; - model.out = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.firing)],["y"],["n"]]; + this.model.sim = list(this.function_name,this.funtyp); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; + label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.firing)],["y"],["n"]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } generic_block.prototype.details = function generic_block() { @@ -14325,7 +14325,7 @@ function generic_block() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -14371,20 +14371,20 @@ function generic_block() { } dep_ut = [this.depu,this.dept]; if (ok) { - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); } if (ok) { if (this.funtyp==3) { needcompile = 4; } - model.sim = list(this.function_name,this.funtyp); - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.firing = this.auto0; - model.dep_ut = dep_ut; - arg1.model = model; + this.model.sim = list(this.function_name,this.funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.dep_ut = dep_ut; + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -14398,24 +14398,24 @@ function generic_block() { /* autogenerated from "macros/Misc/generic_block2.sci" */ function generic_block2() { generic_block2.prototype.define = function generic_block2() { - model = scicos_model(); + this.model = scicos_model(); this.function_name = "sinblk"; this.funtyp = 1; - model.sim = list(this.function_name,this.funtyp); - model.in1 = 1; - model.out = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]]; + this.model.sim = list(this.function_name,this.funtyp); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; + label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } generic_block2.prototype.details = function generic_block2() { @@ -14459,7 +14459,7 @@ function generic_block2() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -14505,22 +14505,22 @@ function generic_block2() { } dep_ut = [this.depu,this.dept]; if (ok) { - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); } if (ok) { if (this.funtyp==3) { needcompile = 4; } - model.sim = list(this.function_name,this.funtyp); - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.firing = this.auto0; - model.nzcross = this.nzcr; - model.nmode = this.nmode; - model.dep_ut = dep_ut; - arg1.model = model; + this.model.sim = list(this.function_name,this.funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.nzcross = new ScilabDouble(this.nzcr); + this.model.nmode = new ScilabDouble(this.nmode); + this.model.dep_ut = dep_ut; + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -14534,20 +14534,20 @@ function generic_block2() { /* autogenerated from "macros/Misc/generic_block3.sci" */ function generic_block3() { generic_block3.prototype.define = function generic_block3() { - model = scicos_model(); + this.model = scicos_model(); this.function_name = "sinblk"; this.funtyp = 4; - model.sim = list(this.function_name,this.funtyp); - model.in1 = 1; - model.in2 = 1; - model.intyp = 1; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2]),sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]]; + this.model.sim = list(this.function_name,this.funtyp); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.dep_ut = [true,false]; + label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2]),sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } generic_block3.prototype.details = function generic_block3() { @@ -14599,7 +14599,7 @@ function generic_block3() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -14651,24 +14651,24 @@ function generic_block3() { } dep_ut = [this.depu,this.dept]; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); + [model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); } if (ok) { if (this.funtyp==3) { needcompile = 4; } - model.sim = list(this.function_name,this.funtyp); - model.state = this.xx; - model.dstate = this.z; - model.odstate = this.oz; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.opar = this.opar; - model.firing = this.auto0; - model.nzcross = this.nzcr; - model.nmode = this.nmode; - model.dep_ut = dep_ut; - arg1.model = model; + this.model.sim = list(this.function_name,this.funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.odstate = new ScilabDouble(this.oz); + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.opar = new ScilabDouble(this.opar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.nzcross = new ScilabDouble(this.nzcr); + this.model.nmode = new ScilabDouble(this.nmode); + this.model.dep_ut = dep_ut; + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; @@ -14691,23 +14691,23 @@ function scifunc_block() { typ = "c"; auto = []; this.rpar = []; - model = scicos_model(); - model.sim = list("scifunc",3); - model.in1 = in1; - model.out = out; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.opar = list(); - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("scifunc",3); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(0); + this.model.opar = list(); + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; exprs = list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } scifunc_block.prototype.details = function scifunc_block() { @@ -14740,7 +14740,7 @@ function scifunc_block() { this.lab = arguments[0]["lab"] needcompile = 0; this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; if (size(exprs[1-1],"*")==8) { @@ -14769,23 +14769,23 @@ function scifunc_block() { if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); if (ok) { auto = this.auto0; - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - if (model.ipar!=0) { - model.opar = model.ipar; - model.ipar = 0; - } - if (or(model.opar!=tt)) { + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + if (this.model.ipar!=0) { + this.model.opar = new ScilabDouble(this.model.ipar); + this.model.ipar = new ScilabDouble(0); + } + if (or(this.model.opar!=tt)) { needcompile = 4; } - model.opar = tt; - model.firing = auto; - model.dep_ut = dep_ut; - this.x.model = model; + this.model.opar = new ScilabDouble(tt); + this.model.firing = new ScilabDouble(auto); + this.model.dep_ut = new ScilabDouble(dep_ut); + this.x.model = this.model; exprs[2-1] = tt; graphics.exprs = exprs; this.x.graphics = graphics; @@ -14809,27 +14809,27 @@ function scifunc_block_m() { auto = []; this.rpar = []; it = 1; - model = scicos_model(); - model.sim = list("scifunc",3); - model.in1 = in1; - model.in2 = in1; - model.intyp = it; - model.out = out; - model.out2 = out; - model.outtyp = it; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.opar = list(); - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("scifunc",3); + this.model.in1 = new ScilabDouble(in1); + this.model.in2 = new ScilabDouble(in1); + this.model.intyp = new ScilabDouble(it); + this.model.out = new ScilabDouble(out); + this.model.out2 = new ScilabDouble(out); + this.model.outtyp = new ScilabDouble(it); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(0); + this.model.opar = list(); + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; exprs = list([[sci2exp([in1,in1])],[sci2exp([out,out])],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)],[sci2exp(0)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } scifunc_block_m.prototype.details = function scifunc_block_m() { @@ -14862,7 +14862,7 @@ function scifunc_block_m() { this.lab = arguments[0]["lab"] needcompile = 0; this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; while (true) { @@ -14888,23 +14888,23 @@ function scifunc_block_m() { if (!ok) { break; } - [model,graphics,ok] = set_io(model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co); + [model,graphics,ok] = set_io(this.model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co); if (ok) { auto = this.auto0; - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - if (model.ipar!=0) { - model.opar = model.ipar; - model.ipar = 0; - } - if (or(model.opar!=tt)) { + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + if (this.model.ipar!=0) { + this.model.opar = new ScilabDouble(this.model.ipar); + this.model.ipar = new ScilabDouble(0); + } + if (or(this.model.opar!=tt)) { needcompile = 4; } - model.opar = tt; - model.firing = auto; - model.dep_ut = dep_ut; - this.x.model = model; + this.model.opar = new ScilabDouble(tt); + this.model.firing = new ScilabDouble(auto); + this.model.dep_ut = new ScilabDouble(dep_ut); + this.x.model = this.model; exprs[2-1] = tt; graphics.exprs = exprs; this.x.graphics = graphics; @@ -14918,14 +14918,14 @@ function scifunc_block_m() { /* autogenerated from "macros/NonLinear/ABSBLK_f.sci" */ function ABSBLK_f() { ABSBLK_f.prototype.define = function ABSBLK_f() { - model = scicos_model(); - model.sim = list("absblk",1); - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("absblk",1); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } ABSBLK_f.prototype.details = function ABSBLK_f() { @@ -14945,17 +14945,17 @@ function ABSBLK_f() { function ABS_VALUE() { ABS_VALUE.prototype.define = function ABS_VALUE() { nu = -1; - model = scicos_model(); - model.sim = list("absolute_value",4); - model.in1 = nu; - model.out = nu; - model.nzcross = nu; - model.nmode = nu; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("absolute_value",4); + this.model.in1 = new ScilabDouble(nu); + this.model.out = new ScilabDouble(nu); + this.model.nzcross = new ScilabDouble(nu); + this.model.nmode = new ScilabDouble(nu); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string([1])]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ABS_VALUE.prototype.details = function ABS_VALUE() { @@ -14972,7 +14972,7 @@ function ABS_VALUE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); if (!ok) { @@ -14981,14 +14981,14 @@ function ABS_VALUE() { graphics.exprs = exprs; if (ok) { if (this.zcr!=0) { - model.nmode = -1; - model.nzcross = -1; + this.model.nmode = new ScilabDouble(-1); + this.model.nzcross = new ScilabDouble(-1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -14999,14 +14999,14 @@ function ABS_VALUE() { function COSBLK_f() { COSBLK_f.prototype.define = function COSBLK_f() { in1 = 1; - model = scicos_model(); - model.sim = "cosblk"; - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("cosblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } COSBLK_f.prototype.details = function COSBLK_f() { @@ -15031,20 +15031,20 @@ function DLRADAPT_f() { this.g = [[1],[1]]; this.last_u = []; this.last_y = [[0],[0]]; - model = scicos_model(); - model.sim = "dlradp"; - model.in1 = [[1],[1]]; - model.out = 1; - model.evtin = 1; - model.dstate = [[this.last_u],[this.last_y]]; - model.rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; - model.ipar = [[0],[2],[2]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("dlradp"); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[this.last_u],[this.last_y]]; + this.model.rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; + this.model.ipar = [[0],[2],[2]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.p)],[sci2exp(this.rn)],[sci2exp(this.rd,0)],[sci2exp(this.g)],[sci2exp(this.last_u)],[sci2exp(this.last_y)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLRADAPT_f.prototype.details = function DLRADAPT_f() { @@ -15071,7 +15071,7 @@ function DLRADAPT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.p,this.rn,this.rd,this.g,this.last_u,this.last_y,exprs] = scicos_getvalue("Set block parameters",["Vector of p mesh points","Numerator roots (one line for each mesh)","Denominator roots (one line for each mesh)","Vector of gain at mesh points","past inputs (Num degree values)","past outputs (Den degree values)"],list("vec",-1,"mat",[-1,-1],"mat",["size(%1,\'*\')","-1"],"vec","size(%1,\'*\')","vec","size(%2,2)","vec","size(%3,2)"),exprs); if (!ok) { @@ -15086,12 +15086,12 @@ function DLRADAPT_f() { } else { rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; ipar = [[m],[n],[npt]]; - model.dstate = [[this.last_u.slice()],[this.last_y.slice()]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.dstate = [[this.last_u.slice()],[this.last_y.slice()]]; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15103,16 +15103,16 @@ function EXPBLK_f() { EXPBLK_f.prototype.define = function EXPBLK_f() { in1 = 1; this.a = math.E; - model = scicos_model(); - model.sim = "expblk"; - model.in1 = -1; - model.out = -1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("expblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = ["%e"]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXPBLK_f.prototype.details = function EXPBLK_f() { @@ -15128,7 +15128,7 @@ function EXPBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -15141,9 +15141,9 @@ function EXPBLK_f() { message("a^u : a must be positive"); } else { graphics.exprs = exprs; - model.rpar = this.a; + this.model.rpar = new ScilabDouble(this.a); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15155,20 +15155,20 @@ function EXPBLK_m() { EXPBLK_m.prototype.define = function EXPBLK_m() { in1 = 1; this.a = math.E; - model = scicos_model(); - model.sim = list("expblk_m",4); - model.in1 = -1; - model.in2 = -2; - model.out = -1; - model.out2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("expblk_m",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = ["%e"]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXPBLK_m.prototype.details = function EXPBLK_m() { @@ -15184,7 +15184,7 @@ function EXPBLK_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -15197,9 +15197,9 @@ function EXPBLK_m() { message("a^u : a must be positive"); } else { graphics.exprs = exprs; - model.rpar = this.a; + this.model.rpar = new ScilabDouble(this.a); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15210,15 +15210,15 @@ function EXPBLK_m() { function FSV_f() { FSV_f.prototype.define = function FSV_f() { in1 = 1; - model = scicos_model(); - model.sim = list("fsv",1); - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("fsv",1); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } FSV_f.prototype.details = function FSV_f() { @@ -15240,17 +15240,17 @@ function INTRP2BLK_f() { this.a = [[0],[1]]; this.b = [[0],[1]]; this.c = [[0,1],[1,2]]; - model = scicos_model(); - model.sim = list("intrp2",1); - model.in1 = [[1],[1]]; - model.out = 1; - model.rpar = [[this.a],[this.b],[this.c.slice()]]; - model.ipar = [[2],[2]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("intrp2",1); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.a],[this.b],[this.c.slice()]]; + this.model.ipar = [[2],[2]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.a))],[strcat(sci2exp(this.b))],[strcat(sci2exp(this.c,0))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTRP2BLK_f.prototype.details = function INTRP2BLK_f() { @@ -15271,7 +15271,7 @@ function INTRP2BLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.a,this.b,this.c,exprs] = scicos_getvalue("Set Interpolation block parameters",["X coord.","Y coord.","Z values"],list("vec",-1,"vec",-1,"mat",[-1,-1]),exprs); if (!ok) { @@ -15284,10 +15284,10 @@ function INTRP2BLK_f() { } else { if (ok) { graphics.exprs = exprs; - model.rpar = [[this.a.slice()],[this.b.slice()],[this.c.slice()]]; - model.ipar = [[size(this.a,"*")],[size(this.b,"*")]]; + this.model.rpar = [[this.a.slice()],[this.b.slice()],[this.c.slice()]]; + this.model.ipar = [[size(this.a,"*")],[size(this.b,"*")]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15300,16 +15300,16 @@ function INTRPLBLK_f() { INTRPLBLK_f.prototype.define = function INTRPLBLK_f() { this.a = [[0],[1]]; this.b = [[0],[1]]; - model = scicos_model(); - model.sim = "intrpl"; - model.in1 = 1; - model.out = 1; - model.rpar = [[this.a],[this.b]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("intrpl"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.a],[this.b]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.a))],[strcat(sci2exp(this.b))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTRPLBLK_f.prototype.details = function INTRPLBLK_f() { @@ -15328,7 +15328,7 @@ function INTRPLBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.a,this.b,exprs] = scicos_getvalue("Set Interpolation block parameters",["X coord.","Y coord."],list("vec",-1,"vec",-1),exprs); if (!ok) { @@ -15341,9 +15341,9 @@ function INTRPLBLK_f() { } else { if (ok) { graphics.exprs = exprs; - model.rpar = [[this.a.slice()],[this.b.slice()]]; + this.model.rpar = [[this.a.slice()],[this.b.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15355,15 +15355,15 @@ function INTRPLBLK_f() { function INVBLK() { INVBLK.prototype.define = function INVBLK() { in1 = -1; - model = scicos_model(); - model.sim = list("invblk4",4); - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("invblk4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INVBLK.prototype.details = function INVBLK() { @@ -15383,15 +15383,15 @@ function INVBLK() { function INVBLK_f() { INVBLK_f.prototype.define = function INVBLK_f() { in1 = -1; - model = scicos_model(); - model.sim = "invblk"; - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("invblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INVBLK_f.prototype.details = function INVBLK_f() { @@ -15412,16 +15412,16 @@ function LOGBLK_f() { LOGBLK_f.prototype.define = function LOGBLK_f() { in1 = 1; this.a = math.E; - model = scicos_model(); - model.sim = "logblk"; - model.in1 = -1; - model.out = -1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("logblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = "%e"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOGBLK_f.prototype.details = function LOGBLK_f() { @@ -15437,7 +15437,7 @@ function LOGBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -15451,9 +15451,9 @@ function LOGBLK_f() { } else { if (ok) { graphics.exprs = exprs; - model.rpar = this.a; + this.model.rpar = new ScilabDouble(this.a); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15464,7 +15464,7 @@ function LOGBLK_f() { /* autogenerated from "macros/NonLinear/LOOKUP2D.sci" */ function LOOKUP2D() { LOOKUP2D.prototype.define = function LOOKUP2D() { - model = scicos_model(); + this.model = scicos_model(); this.xx = [1:4]; this.yy = [1:3]; this.zz = [[4,5,6],[16,19,20],[10,18,23],[6,3,-1]]; @@ -15472,16 +15472,16 @@ function LOOKUP2D() { Graf = "n"; Nx = length(this.xx); Ny = length(this.yy); - model.sim = list("lookup2d",4); - model.in1 = [[1],[1]]; - model.out = 1; - model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; - model.ipar = [[Nx],[Ny],[this.Method]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = list("lookup2d",4); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; + this.model.ipar = [[Nx],[Ny],[this.Method]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = list(strcat(sci2exp(this.xx)),strcat(sci2exp(this.yy)),strcat(sci2exp(this.zz)),sci2exp(this.Method),Graf); gr_i = []; - this.x = standard_define([2.5,2],model,exprs,gr_i); + this.x = standard_define([2.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOOKUP2D.prototype.details = function LOOKUP2D() { @@ -15504,7 +15504,7 @@ function LOOKUP2D() { this.Method = parseFloat(arguments[0]["Method"]) this.graf = arguments[0]["graf"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; ok = false; @@ -15564,10 +15564,10 @@ function LOOKUP2D() { curwin = save_curwin; gh.figure_id = curwin; } - model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; - model.ipar = [[nx],[ny],[mtd]]; + this.model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; + this.model.ipar = [[nx],[ny],[mtd]]; graphics.exprs = exprs; - this.x.model = model; + this.x.model = this.model; this.x.graphics = graphics; break; } @@ -15578,15 +15578,15 @@ function LOOKUP2D() { /* autogenerated from "macros/NonLinear/LOOKUP_f.sci" */ function LOOKUP_f() { LOOKUP_f.prototype.define = function LOOKUP_f() { - model = scicos_model(); - model.sim = "lookup"; - model.in1 = 1; - model.out = 1; - model.rpar = [[-2],[-1],[1],[2],[-1],[1],[-1],[1]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("lookup"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[-2],[-1],[1],[2],[-1],[1],[-1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } LOOKUP_f.prototype.details = function LOOKUP_f() { @@ -15601,8 +15601,8 @@ function LOOKUP_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - rpar = model.rpar; + this.model = arg1.model; + rpar = this.model.rpar; n = size(rpar,"*")/2; xx = rpar.slice(1-1,n); yy = rpar.slice(n+1-1,2*n); @@ -15622,9 +15622,9 @@ function LOOKUP_f() { ok = false; } if (ok) { - model.rpar = [[xx.slice()],[yy.slice()]]; + this.model.rpar = [[xx.slice()],[yy.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15634,16 +15634,16 @@ function LOOKUP_f() { /* autogenerated from "macros/NonLinear/MAXMIN.sci" */ function MAXMIN() { MAXMIN.prototype.define = function MAXMIN() { - model = scicos_model(); - model.sim = list("minmax",4); - model.out = 1; - model.in1 = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - model.ipar = 0; + this.model = scicos_model(); + this.model.sim = list("minmax",4); + this.model.out = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.model.ipar = new ScilabDouble(0); exprs = [string(transpose([2,1,1]))]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.style = "MAXMIN;displayedLabel=MAX"; return new BasicBlock(this.x); } @@ -15665,7 +15665,7 @@ function MAXMIN() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.mm,this.nin,this.zcr,exprs] = scicos_getvalue("Set Max/Min block parameters",["Min (1) or Max (2) ","Number of input vectors (1 or 2)","zero-crossing (1: yes, 0;no)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -15683,19 +15683,19 @@ function MAXMIN() { } if (ok) { if (this.nin==1) { - [model,graphics,ok] = check_io(model,graphics,-1,1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,1,[],[]); } else { - [model,graphics,ok] = check_io(model,graphics,[-1,-1],-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[-1,-1],-1,[],[]); } } if (ok) { - model.nzcross = this.zcr; + this.model.nzcross = new ScilabDouble(this.zcr); if (this.nin==1) { - model.nmode = abs(this.zcr); + this.model.nmode = new ScilabDouble(abs(this.zcr)); } else { - model.nmode = this.zcr; + this.model.nmode = new ScilabDouble(this.zcr); } - model.ipar = this.mm; + this.model.ipar = new ScilabDouble(this.mm); if (this.mm==1) { label = "MIN"; } else { @@ -15704,7 +15704,7 @@ function MAXMIN() { graphics.style = "MAXMIN;displayedLabel="+label; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15715,16 +15715,16 @@ function MAXMIN() { function MAX_f() { MAX_f.prototype.define = function MAX_f() { in1 = -1; - model = scicos_model(); - model.sim = "maxblk"; - model.in1 = in1; - model.out = 1; - model.dstate = [[0],[0]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("maxblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(1); + this.model.dstate = [[0],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MAX_f.prototype.details = function MAX_f() { @@ -15744,16 +15744,16 @@ function MAX_f() { function MIN_f() { MIN_f.prototype.define = function MIN_f() { in1 = -1; - model = scicos_model(); - model.sim = "minblk"; - model.in1 = in1; - model.out = 1; - model.dstate = [[0],[0]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("minblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(1); + this.model.dstate = [[0],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(in1); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MIN_f.prototype.details = function MIN_f() { @@ -15774,16 +15774,16 @@ function POWBLK_f() { POWBLK_f.prototype.define = function POWBLK_f() { in1 = 1; this.a = 1.5; - model = scicos_model(); - model.sim = "powblk"; - model.in1 = -1; - model.out = -1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("powblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = string(this.a); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } POWBLK_f.prototype.details = function POWBLK_f() { @@ -15799,7 +15799,7 @@ function POWBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -15810,15 +15810,15 @@ function POWBLK_f() { } graphics.exprs = exprs; if (this.a==int(this.a)) { - model.ipar = this.a; - model.rpar = []; + this.model.ipar = new ScilabDouble(this.a); + this.model.rpar = []; } else { - model.rpar = this.a; - model.ipar = []; + this.model.rpar = new ScilabDouble(this.a); + this.model.ipar = []; } - model.firing = []; + this.model.firing = []; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -15828,16 +15828,16 @@ function POWBLK_f() { function PRODUCT() { PRODUCT.prototype.define = function PRODUCT() { this.sgn = [[1],[-1]]; - model = scicos_model(); - model.sim = list("product",4); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.ipar = this.sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("product",4); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.ipar = this.sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(this.sgn); gr_i = []; - this.x = standard_define([2,3],model,exprs,gr_i); + this.x = standard_define([2,3],this.model,exprs,gr_i); return new Product(this.x); } PRODUCT.prototype.details = function PRODUCT() { @@ -15852,7 +15852,7 @@ function PRODUCT() { this.sgn = inverse(arguments[0]["sgn"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.sgn,exprs] = scicos_getvalue([[" Set multiplication block parameters"],["(multiplication is set with + 1, division with -1)"],[""]],"Number of inputs or sign vector",list("vec",-1),exprs); @@ -15883,13 +15883,13 @@ function PRODUCT() { } } if (ok) { - [model,graphics,ok] = check_io(model,graphics,in1,nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,nout,[],[]); } if (ok) { - model.ipar = this.sgn; + this.model.ipar = new ScilabDouble(this.sgn); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15899,13 +15899,13 @@ function PRODUCT() { /* autogenerated from "macros/NonLinear/PROD_f.sci" */ function PROD_f() { PROD_f.prototype.define = function PROD_f() { - model = scicos_model(); - model.sim = list("prod",2); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - this.x = standard_define([1,1],model,[],[]); + this.model = scicos_model(); + this.model.sim = list("prod",2); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.x = standard_define([1,1],this.model,[],[]); return new BasicBlock(this.x); } PROD_f.prototype.details = function PROD_f() { @@ -15926,17 +15926,17 @@ function QUANT_f() { QUANT_f.prototype.define = function QUANT_f() { this.pas = 0.1; this.meth = 1; - model = scicos_model(); - model.sim = "qzrnd"; - model.in1 = -1; - model.out = -1; - model.rpar = this.pas; - model.ipar = this.meth; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("qzrnd"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.pas); + this.model.ipar = new ScilabDouble(this.meth); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.pas)],[string(this.meth)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } QUANT_f.prototype.details = function QUANT_f() { @@ -15955,7 +15955,7 @@ function QUANT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.pas,this.meth,exprs] = scicos_getvalue("Set parameters",["Step","Quantization Type (1-4)"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -15965,21 +15965,21 @@ function QUANT_f() { message("Quantization Type must be from 1 to 4"); } else { rpar = this.pas; - model.rpar = rpar; - model.ipar = this.meth; + this.model.rpar = new ScilabDouble(rpar); + this.model.ipar = new ScilabDouble(this.meth); switch (this.meth) { case 1: - model.sim = "qzrnd"; + this.model.sim = new ScilabString("qzrnd"); case 2: - model.sim = "qztrn"; + this.model.sim = new ScilabString("qztrn"); case 3: - model.sim = "qzflr"; + this.model.sim = new ScilabString("qzflr"); case 4: - model.sim = "qzcel"; + this.model.sim = new ScilabString("qzcel"); } graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -15992,18 +15992,18 @@ function SATURATION() { this.minp = -1; this.maxp = 1; rpar = [[this.maxp],[this.minp]]; - model = scicos_model(); - model.sim = list("satur",4); - model.in1 = 1; - model.nzcross = 2; - model.nmode = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [true,false]; - exprs = [[string(this.maxp)],[string(this.minp)],[string(model.nmode)]]; + this.model = scicos_model(); + this.model.sim = list("satur",4); + this.model.in1 = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + exprs = [[string(this.maxp)],[string(this.minp)],[string(this.model.nmode)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SATURATION.prototype.details = function SATURATION() { @@ -16024,7 +16024,7 @@ function SATURATION() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,this.zeroc,exprs] = scicos_getvalue("Set Saturation parameters",["Upper limit","Lower limit","zero crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -16034,17 +16034,17 @@ function SATURATION() { message("Upper limit must be > Lower limit"); } else { rpar = [[this.maxp],[this.minp]]; - model.rpar = rpar; + this.model.rpar = rpar; if (this.zeroc!=0) { - model.nzcross = 2; - model.nmode = 1; + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); } else { - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16058,17 +16058,17 @@ function SAT_f() { this.maxp = 1; slope = 1; rpar = [[this.minp],[this.maxp],[slope]]; - model = scicos_model(); - model.sim = list("lusat",1); - model.in1 = 1; - model.nzcross = 2; - model.out = 1; - model.rpar = [[this.minp],[this.maxp],[slope]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("lusat",1); + this.model.in1 = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(2); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.minp],[this.maxp],[slope]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.minp)],[string(this.maxp)],[string(slope)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SAT_f.prototype.details = function SAT_f() { @@ -16089,7 +16089,7 @@ function SAT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.minp,this.maxp,this.pente,exprs] = scicos_getvalue("Set Saturation parameters",["Min","Max","Slope"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -16101,11 +16101,11 @@ function SAT_f() { message("Slope must be strictly positive"); } else { rpar = [[this.minp/this.pente],[this.maxp/this.pente],[this.pente]]; - model.rpar = rpar; - model.firing = []; + this.model.rpar = rpar; + this.model.firing = []; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16116,17 +16116,17 @@ function SAT_f() { function SIGNUM() { SIGNUM.prototype.define = function SIGNUM() { nu = -1; - model = scicos_model(); - model.sim = list("signum",4); - model.in1 = nu; - model.out = nu; - model.nzcross = nu; - model.nmode = nu; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("signum",4); + this.model.in1 = new ScilabDouble(nu); + this.model.out = new ScilabDouble(nu); + this.model.nzcross = new ScilabDouble(nu); + this.model.nmode = new ScilabDouble(nu); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string([1])]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SIGNUM.prototype.details = function SIGNUM() { @@ -16143,7 +16143,7 @@ function SIGNUM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); if (!ok) { @@ -16152,14 +16152,14 @@ function SIGNUM() { graphics.exprs = exprs; if (ok) { if (this.zcr!=0) { - model.nmode = -1; - model.nzcross = -1; + this.model.nmode = new ScilabDouble(-1); + this.model.nzcross = new ScilabDouble(-1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16169,15 +16169,15 @@ function SIGNUM() { /* autogenerated from "macros/NonLinear/SINBLK_f.sci" */ function SINBLK_f() { SINBLK_f.prototype.define = function SINBLK_f() { - model = scicos_model(); - model.sim = "sinblk"; - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sinblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SINBLK_f.prototype.details = function SINBLK_f() { @@ -16197,15 +16197,15 @@ function SINBLK_f() { function TANBLK_f() { TANBLK_f.prototype.define = function TANBLK_f() { in1 = -1; - model = scicos_model(); - model.sim = "tanblk"; - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("tanblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(in1); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TANBLK_f.prototype.details = function TANBLK_f() { @@ -16225,15 +16225,15 @@ function TANBLK_f() { /* autogenerated from "macros/NonLinear/TrigFun.sci" */ function TrigFun() { TrigFun.prototype.define = function TrigFun() { - model = scicos_model(); - model.sim = list("sin_blk",4); - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("sin_blk",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = "sin"; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TrigFun.prototype.details = function TrigFun() { @@ -16249,7 +16249,7 @@ function TrigFun() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; PREVAR_FF = [["sin"],["cos"],["tan"],["asin"],["acos"],["atan"],["sinh"],["cosh"],["tanh"],["asinh"],["acosh"],["atanh"]]; PREVAR_GG = [["Choose among "+strcat(PREVAR_FF.slice(1-1,4),", ")],[strcat(PREVAR_FF.slice(5-1,$),", ")]]; while (true) { @@ -16263,7 +16263,7 @@ function TrigFun() { graphics.exprs = exprs; execstr("model.sim=list(\'"+this.fun+"_blk\',4)"); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16273,17 +16273,17 @@ function TrigFun() { /* autogenerated from "macros/PDE/PDE.sci" */ function PDE() { PDE.prototype.define = function PDE() { - model = scicos_model(); - model.state = zeros(10,1); - model.sim = list("PDE",0); - model.in1 = [[1],[1],[1],[1],[1]]; - model.out = [[10],[0]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.state = new ScilabDouble(zeros(10,1)); + this.model.sim = list("PDE",0); + this.model.in1 = [[1],[1],[1],[1],[1]]; + this.model.out = [[10],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; params_pde = tlist([["paramspde"],["a"],["b"],["txt_exp"],["check_op1"],["a1"],["b1"],["check_op2"],["a2"],["b2"],["check_op3"],["a3"],["b3"],["check_op4"],["a4"],["b4"],["check_op5"],["a5"],["b5"],["check_op6"],["a6"],["b6"],["check_op7"],["a7"],["b7"],["discr_cst"],["discr_non_cst"],["signe"],["rad_automatique"],["rad_manuel"],["methode"],["ord1"],["ord2"],["ord3"],["degre"],["nnode"],["txt_pas"],["CI"],["dCI"],["CLa"],["CLa_exp"],["CLb"],["CLb_exp"],["points"]],"","","","0","","IN_EDP1(t)","0","","IN_EDP2(t)","0","","IN_EDP3(t)","0","","IN_EDP4(t)","0","","IN_EDP5(t)","0","","IN_EDP6(t)","0","","IN_EDP7(t)","0","0","0","0","0","0","","","","","","","","","0","IN_CL1(t)","0","IN_CL2(t)",""); label = list(params_pde,[],""); gr_i = []; - this.x = standard_define([3,3],model,label,gr_i); + this.x = standard_define([3,3],this.model,label,gr_i); return new BasicBlock(this.x); } PDE.prototype.details = function PDE() { @@ -16301,7 +16301,7 @@ function PDE() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; params_pde = label[1-1]; while (true) { [ln,fun]=where() @@ -16368,29 +16368,29 @@ function PDE() { out = [[Nbr_maillage],[size(mesures,"*")]]; } if ((flag_type==1)) { - model.sim = list(this.rdnom,2004); + this.model.sim = list(this.rdnom,2004); if ((find(oper==1)!=[])) { - model.state = zeros(2*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(2*Nbr_maillage,1)); } else { - model.state = zeros(Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(Nbr_maillage,1)); } } else if ((flag_type==2)) { - model.sim = list(this.rdnom,12004); + this.model.sim = list(this.rdnom,12004); if ((find(oper==1)!=[])) { if ((type_meth==3&&(find(oper==2)!=[]||find(oper==4)!=[]))) { - model.state = zeros(6*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(6*Nbr_maillage,1)); } else if ((type_meth==1)) { - model.state = zeros(4*Nbr,1); + this.model.state = new ScilabDouble(zeros(4*Nbr,1)); } else { - model.state = zeros(4*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(4*Nbr_maillage,1)); } } else { if ((type_meth==3&&(find(oper==2)!=[]||find(oper==4)!=[]))) { - model.state = zeros(4*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(4*Nbr_maillage,1)); } else if ((type_meth==1)) { - model.state = zeros(2*Nbr,1); + this.model.state = new ScilabDouble(zeros(2*Nbr,1)); } else { - model.state = zeros(2*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(2*Nbr_maillage,1)); } } } @@ -16399,13 +16399,13 @@ function PDE() { break; } if (!ok) { - [model,graphics,ok] = check_io(model,graphics,ones(k,1),out.slice(),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,ones(k,1),out.slice(),[],[]); } label[1-1] = params_pde; label[2-1] = tt; graphics.exprs = label; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -16420,20 +16420,20 @@ function AFFICH_m() { this.nt = 5; this.nd = 1; this.in1 = [1,1]; - model = scicos_model(); - model.sim = list("affich2",4); - model.in1 = this.in1[1-1][1-1]; - model.in2 = this.in1[1-1][2-1]; - model.evtin = 1; - model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; - model.ipar = [[this.font],[this.fontsize],[this.colr],[1000],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; - model.label = ""; - exprs = [[sci2exp([model.in1,model.in2])],[string(this.font)],[string(this.fontsize)],[string(this.colr)],[string(this.nt)],[string(this.nd)],[string(0)]]; + this.model = scicos_model(); + this.model.sim = list("affich2",4); + this.model.in1 = new ScilabDouble(this.in1[1-1][1-1]); + this.model.in2 = new ScilabDouble(this.in1[1-1][2-1]); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; + this.model.ipar = [[this.font],[this.fontsize],[this.colr],[1000],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; + this.model.label = new ScilabString(""); + exprs = [[sci2exp([this.model.in1,this.model.in2])],[string(this.font)],[string(this.fontsize)],[string(this.colr)],[string(this.nt)],[string(this.nd)],[string(0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new AfficheBlock(this.x); } AFFICH_m.prototype.details = function AFFICH_m() { @@ -16462,7 +16462,7 @@ function AFFICH_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,this.font,this.fontsize,this.colr,this.nt,this.nd,this.herit,exprs] = scicos_getvalue("Set parameters",["Input Size","Font number","Font size","Color","Total number of digits","Number of rational part digits","Block inherits (1) or not (0)"],list("mat",[1,2],"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -16496,15 +16496,15 @@ function AFFICH_m() { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(this.in1,1),list(),ones(1-this.herit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(this.in1,1),list(),ones(1-this.herit,1),[]); } if (ok) { - model.ipar = [[this.font],[this.fontsize],[this.colr],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; - model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; - model.evtin = ones(1-this.herit,1); + this.model.ipar = [[this.font],[this.fontsize],[this.colr],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; + this.model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; + this.model.evtin = new ScilabDouble(ones(1-this.herit,1)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16514,21 +16514,21 @@ function AFFICH_m() { /* autogenerated from "macros/Sinks/BARXY.sci" */ function BARXY() { BARXY.prototype.define = function BARXY() { - model = scicos_model(); + this.model = scicos_model(); this.xmin = -15; this.xmax = 15; this.ymin = -15; this.ymax = 15; - model.sim = list("BARXY_sim",5); - model.blocktype = "d"; - model.dep_ut = [true,false]; - model.in1 = [[-1],[-1]]; - model.intyp = [1]; - model.out = []; - model.evtin = [1]; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = 1; - this.x = standard_define([2,2],model,[],[]); + this.model.sim = list("BARXY_sim",5); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; + this.model.in1 = [[-1],[-1]]; + this.model.intyp = [1]; + this.model.out = []; + this.model.evtin = [1]; + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = new ScilabDouble(1); + this.x = standard_define([2,2],this.model,[],[]); this.x.graphics.in_implicit = ["E","E"]; this.x.graphics.out_implicit = []; this.x.graphics.exprs = [["-15"],["15"],["-15"],["15"],["1"]]; @@ -16556,7 +16556,7 @@ function BARXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.xmin,this.xmax,this.ymin,this.ymax,this.thickness,exprs] = scicos_getvalue("Set Scope parameters",["Xmin","Xmax","Ymin","Ymax","Segs Thickness"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -16578,11 +16578,11 @@ function BARXY() { if (!ok) { message(mess); } else { - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = this.thickness; + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = new ScilabDouble(this.thickness); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16603,20 +16603,20 @@ function CANIMXY() { this.ymin = -15; this.ymax = 15; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("canimxy",4); - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("canimxy",4); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[string(this.clrs)],[string(this.siz)],[string(this.win)],["[]"],["[]"],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CANIMXY.prototype.details = function CANIMXY() { @@ -16653,7 +16653,7 @@ function CANIMXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.xmin,this.xmax,this.ymin,this.ymax,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of Curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin","Xmax","Ymin","Ymax","Buffer size"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -16697,7 +16697,7 @@ function CANIMXY() { } else { in1 = this.nbr_curves*ones(2,1); in2 = ones(2,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -16706,11 +16706,11 @@ function CANIMXY() { } rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16731,20 +16731,20 @@ function CANIMXY3D() { this.vec_y = [[-15],[15]]; this.vec_z = [[-15],[15]]; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("canimxy3d",4); - model.in1 = [[1],[1],[1]]; - model.evtin = 1; - model.in2 = [[1],[1],[1]]; - model.intyp = [[1],[1],[1]]; - model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; - model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("canimxy3d",4); + this.model.in1 = [[1],[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.in2 = [[1],[1],[1]]; + this.model.intyp = [[1],[1],[1]]; + this.model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; + this.model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],["[]"],["[]"],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CANIMXY3D.prototype.details = function CANIMXY3D() { @@ -16781,7 +16781,7 @@ function CANIMXY3D() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.vec_x,this.vec_y,this.vec_z,this.param3ds,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin and Xmax","Ymin and Ymax","Zmin and Zmax","Alpha and Theta","Buffer size"],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs); if (!ok) { @@ -16841,7 +16841,7 @@ function CANIMXY3D() { } else { in1 = this.nbr_curves*ones(3,1); in2 = ones(3,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -16851,11 +16851,11 @@ function CANIMXY3D() { rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; size_siz = size(this.siz,"*"); ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16871,16 +16871,16 @@ function CEVENTSCOPE() { this.wdim = [[600],[400]]; this.wpos = [[-1],[-1]]; this.per = 30; - model = scicos_model(); - model.sim = list("cevscpe",4); - model.evtin = 1; - model.rpar = this.per; - model.ipar = [[this.win],[1],[this.clrs[this.nclock-1]],[this.wpos.slice()],[this.wdim.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cevscpe",4); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.per); + this.model.ipar = [[this.win],[1],[this.clrs[this.nclock-1]],[this.wpos.slice()],[this.wdim.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[sci2exp(this.nclock)],[strcat(sci2exp(this.clrs[this.nclock-1])," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.per)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CEVENTSCOPE.prototype.details = function CEVENTSCOPE() { @@ -16907,7 +16907,7 @@ function CEVENTSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nclock,this.clrs,this.win,this.wpos,this.wdim,this.per,exprs] = scicos_getvalue("Set Scope parameters",["Number of event inputs","colors c (>0) or mark (<0)","Output window number (-1 for automatic)","Output window position","Output window sizes","Refresh period"],list("vec",1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",1),exprs); this.nclock = int(this.nclock); @@ -16942,7 +16942,7 @@ function CEVENTSCOPE() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(),list(),ones(this.nclock,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(),list(),ones(this.nclock,1),[]); } else { message([["Some specified values are inconsistent:"],[" "],[mess]]); } @@ -16955,11 +16955,11 @@ function CEVENTSCOPE() { } rpar = this.per; ipar = [[this.win],[1],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -16977,16 +16977,16 @@ function CFSCOPE() { this.ymin = -15; this.ymax = 15; this.per = 30; - model = scicos_model(); - model.sim = list("cfscope",4); - model.evtin = 1; - model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim],[1],[1]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cfscope",4); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim],[1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[string([1])]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CFSCOPE.prototype.details = function CFSCOPE() { @@ -17019,7 +17019,7 @@ function CFSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.wu,exprs] = scicos_getvalue("Set Scope parameters",["Color (>0) or mark (<0) vector (8 entries)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin","Ymax","Refresh period","Buffer size","Links to view"],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",-1),exprs); if (!ok) { @@ -17072,13 +17072,13 @@ function CFSCOPE() { this.clrs[8-1] = 0; } ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()],[size(this.wu,"*")],[this.wu.slice()]]; - model.rpar = rpar; - model.ipar = ipar; - model.firing = []; - model.dep_ut = [true,false]; + this.model.rpar = rpar; + this.model.ipar = ipar; + this.model.firing = []; + this.model.dep_ut = [true,false]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17089,15 +17089,15 @@ function CFSCOPE() { function CLKOUTV_f() { CLKOUTV_f.prototype.define = function CLKOUTV_f() { this.prt = 1; - model = scicos_model(); - model.sim = "output"; - model.evtin = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("output"); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = string(this.prt); - this.x = standard_define([1,1],model,exprs," "); + this.x = standard_define([1,1],this.model,exprs," "); return new EventOutBlock(this.x); } CLKOUTV_f.prototype.details = function CLKOUTV_f() { @@ -17112,7 +17112,7 @@ function CLKOUTV_f() { this.prt = arguments[0]["prt"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.prt,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CLKOUTV_f")],[" "],["Event output port"]],"Port number",list("vec",1),exprs); @@ -17123,11 +17123,11 @@ function CLKOUTV_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - model.ipar = this.prt; - model.evtin = 1; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtin = new ScilabDouble(1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17198,15 +17198,15 @@ function CLKOUTV_f() { function CLKOUT_f() { CLKOUT_f.prototype.define = function CLKOUT_f() { this.prt = 1; - model = scicos_model(); - model.sim = "output"; - model.evtin = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("output"); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = string(this.prt); - this.x = standard_define([1,1],model,exprs," "); + this.x = standard_define([1,1],this.model,exprs," "); return new BasicBlock(this.x); } CLKOUT_f.prototype.details = function CLKOUT_f() { @@ -17221,7 +17221,7 @@ function CLKOUT_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { @@ -17233,12 +17233,12 @@ function CLKOUT_f() { if (this.prt<=0) { message("Port number must be a positive integer"); } else { - model.ipar = this.prt; - model.evtin = 1; - model.firing = []; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtin = new ScilabDouble(1); + this.model.firing = []; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17256,19 +17256,19 @@ function CMAT3D() { y = -1; size_x = 1; size_y = 1; - model = scicos_model(); - model.sim = list("cmat3d",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.evtin = 1; - model.ipar = [[this.cmin],[this.cmax],[size_c],[size_x],[size_y]]; - model.rpar = [[this.colormap.slice()],[this.x],[y]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cmat3d",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = [[this.cmin],[this.cmax],[size_c],[size_x],[size_y]]; + this.model.rpar = [[this.colormap.slice()],[this.x],[y]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.x)," ")],[strcat(string(y)," ")],[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CMAT3D.prototype.details = function CMAT3D() { @@ -17293,7 +17293,7 @@ function CMAT3D() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.vec_x,this.vec_y,this.colormap,this.cmin,this.cmax,exprs] = scicos_getvalue("Set Scope parameters",["Bounds Vector X (-1 for standard)","Bounds Vector Y (-1 for standard)","ColorMap","Zmin","Zmax"],list("vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),exprs); if (!ok) { @@ -17316,11 +17316,11 @@ function CMAT3D() { size_c = size(this.colormap.slice(),1); ipar = [[this.cmin],[this.cmax],[size_c],[size_x]]; rpar = [[this.colormap.slice()],[this.vec_x.slice()],[this.vec_y.slice()]]; - model.ipar = ipar; - model.rpar = rpar; + this.model.ipar = ipar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17336,19 +17336,19 @@ function CMATVIEW() { this.colormap = this.jetcolormap[size_c-1]; alpha_c = 0.24; beta_c = 1; - model = scicos_model(); - model.sim = list("cmatview",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.evtin = 1; - model.ipar = [[this.cmin],[this.cmax],[size_c]]; - model.rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cmatview",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = [[this.cmin],[this.cmax],[size_c]]; + this.model.rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CMATVIEW.prototype.details = function CMATVIEW() { @@ -17369,7 +17369,7 @@ function CMATVIEW() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.colormap,this.cmin,this.cmax,exprs] = scicos_getvalue("Set Scope parameters",["ColorMap","Minimum level range","Maximum level range"],list("vec",-1,"vec",1,"vec",1),exprs); if (!ok) { @@ -17390,11 +17390,11 @@ function CMATVIEW() { beta_c = sol[2-1]; ipar = [[this.cmin],[this.cmax],[size_c]]; rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; - model.ipar = ipar; - model.rpar = rpar; + this.model.ipar = ipar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17415,19 +17415,19 @@ function CMSCOPE() { this.per = [[30],[30]]; yy = [[transpose(this.ymin.slice())],[transpose(this.ymax.slice())]]; period = transpose(this.per.slice()); - model = scicos_model(); - model.sim = list("cmscope",4); - model.in1 = this.in1; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; - model.rpar = [[0],[period.slice()],[yy.slice()]]; - model.ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice(1-1,sum(this.in1))]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cmscope",4); + this.model.in1 = this.in1; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[0],[period.slice()],[yy.slice()]]; + this.model.ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice(1-1,sum(this.in1))]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.in1)," ")],[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp([])],[strcat(string(this.ymin)," ")],[strcat(string(this.ymax)," ")],[strcat(string(this.per)," ")],[string(this.N)],[string(0)],[emptystr()]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CMSCOPE.prototype.details = function CMSCOPE() { @@ -17464,7 +17464,7 @@ function CMSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.heritance,this.nom,exprs] = scicos_getvalue("Set Scope parameters",["Input ports sizes","Drawing colors (>0) or mark (<0)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin vector","Ymax vector","Refresh period","Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"],list("vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec",1,"vec",1,"str",1),exprs); if (!ok) { @@ -17524,7 +17524,7 @@ function CMSCOPE() { this.in1 = this.in1.slice(); a = size(this.in1,1); in2 = ones(a,1); - [model,graphics,ok] = set_io(model,graphics,list([this.in1,in2],ones(a,1)),list(),ones(1-this.heritance,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([this.in1,in2],ones(a,1)),list(),ones(1-this.heritance,1),[]); } if (ok) { if (this.wpos==[]) { @@ -17539,15 +17539,15 @@ function CMSCOPE() { rpar = [[0],[period.slice()],[yy.slice()]]; this.clrs = this.clrs.slice(1-1,sum(this.in1)); ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice()],[this.heritance]]; - model.evtin = ones(1-this.heritance,1); - model.dstate = []; - model.rpar = rpar; - model.ipar = ipar; - model.label = this.nom; + this.model.evtin = new ScilabDouble(ones(1-this.heritance,1)); + this.model.dstate = []; + this.model.rpar = rpar; + this.model.ipar = ipar; + this.model.label = new ScilabDouble(this.nom); graphics.id = this.nom; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17566,18 +17566,18 @@ function CSCOPE() { this.ymin = -15; this.ymax = 15; this.per = 30; - model = scicos_model(); - model.sim = list("cscope",4); - model.in1 = -1; - model.in2 = 1; - model.evtin = 1; - model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cscope",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[transpose(string(0))],[emptystr()]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CSCOPE.prototype.details = function CSCOPE() { @@ -17612,7 +17612,7 @@ function CSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.heritance,this.nom,exprs] = scicos_getvalue("Set Scope parameters",["Color (>0) or mark (<0) vector (8 entries)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin","Ymax","Refresh period","Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"str",1),exprs); if (!ok) { @@ -17651,7 +17651,7 @@ function CSCOPE() { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([-1,1],1),list(),ones(1-this.heritance,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,1],1),list(),ones(1-this.heritance,1),[]); } if (ok) { if (this.wpos==[]) { @@ -17662,14 +17662,14 @@ function CSCOPE() { } rpar = [[0],[this.ymin],[this.ymax],[this.per]]; ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; - model.rpar = rpar; - model.ipar = ipar; - model.evtin = ones(1-this.heritance,1); - model.label = this.nom; + this.model.rpar = rpar; + this.model.ipar = ipar; + this.model.evtin = new ScilabDouble(ones(1-this.heritance,1)); + this.model.label = new ScilabDouble(this.nom); graphics.id = this.nom; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17690,19 +17690,19 @@ function CSCOPXY() { this.ymin = -15; this.ymax = 15; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("cscopxy",4); - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cscopxy",4); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[sci2exp(this.clrs)],[sci2exp(this.siz)],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CSCOPXY.prototype.details = function CSCOPXY() { @@ -17739,7 +17739,7 @@ function CSCOPXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.xmin,this.xmax,this.ymin,this.ymax,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of Curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin","Xmax","Ymin","Ymax","Buffer size"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -17783,7 +17783,7 @@ function CSCOPXY() { } else { in1 = this.nbr_curves*ones(2,1); in2 = ones(2,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -17792,11 +17792,11 @@ function CSCOPXY() { } rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -17817,19 +17817,19 @@ function CSCOPXY3D() { this.vec_y = [[-15],[15]]; this.vec_z = [[-15],[15]]; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("cscopxy3d",4); - model.in1 = [[1],[1],[1]]; - model.in2 = [[1],[1],[1]]; - model.intyp = [[1],[1],[1]]; - model.evtin = 1; - model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; - model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cscopxy3d",4); + this.model.in1 = [[1],[1],[1]]; + this.model.in2 = [[1],[1],[1]]; + this.model.intyp = [[1],[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; + this.model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CSCOPXY3D.prototype.details = function CSCOPXY3D() { @@ -17866,7 +17866,7 @@ function CSCOPXY3D() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.vec_x,this.vec_y,this.vec_z,this.param3ds,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of curves","color (>0) or mark (<0)","Line or Mark Size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin and Xmax","Ymin and Ymax","Zmin and Zmax","Alpha and Theta","Buffer size"],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",2,"vec",2,"vec",2,"vec",2,"vec",1),exprs); if (!ok) { @@ -17920,7 +17920,7 @@ function CSCOPXY3D() { if (ok) { in1 = this.nbr_curves*ones(3,1); in2 = ones(3,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -17930,11 +17930,11 @@ function CSCOPXY3D() { rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; size_siz = size(this.siz,"*"); ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } else { message(mess); @@ -17946,21 +17946,21 @@ function CSCOPXY3D() { /* autogenerated from "macros/Sinks/OUTIMPL_f.sci" */ function OUTIMPL_f() { OUTIMPL_f.prototype.define = function OUTIMPL_f() { - model = scicos_model(); - model.in1 = [-1]; - model.in2 = [1]; + this.model = scicos_model(); + this.model.in1 = [-1]; + this.model.in2 = [1]; this.prt = 1; - model.sim = "outimpl"; - model.ipar = [1]; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model.sim = new ScilabString("outimpl"); + this.model.ipar = [1]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "PORT"; mo.inputs = "n"; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = "1"; gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; return new ImplicitOutBlock(this.x); } @@ -17977,7 +17977,7 @@ function OUTIMPL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[1-1]; } @@ -17990,14 +17990,14 @@ function OUTIMPL_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - if (model.ipar!=this.prt) { + if (this.model.ipar!=this.prt) { needcompile = 4; y = needcompile; } - model.ipar = this.prt; + this.model.ipar = new ScilabDouble(this.prt); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18009,17 +18009,17 @@ function OUT_f() { OUT_f.prototype.define = function OUT_f() { n = -1; this.prt = 1; - model = scicos_model(); - model.sim = "output"; - model.in1 = -1; - model.in2 = -2; - model.intyp = -1; - model.ipar = this.prt; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("output"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(-1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = string(this.prt); gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new ExplicitOutBlock(this.x); } OUT_f.prototype.details = function OUT_f() { @@ -18034,7 +18034,7 @@ function OUT_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,"*")==2) { exprs = exprs[1-1]; @@ -18048,10 +18048,10 @@ function OUT_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - model.ipar = this.prt; + this.model.ipar = new ScilabDouble(this.prt); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18065,22 +18065,22 @@ function TOWS_c() { this.nz = 128; this.varnam = "A"; this.herit = 0; - model = scicos_model(); - model.sim = list("tows_c",4); - model.in1 = [nu]; - model.in2 = -2; - model.intyp = -1; - model.out = []; - model.evtin = [1]; - model.evtout = []; - model.rpar = []; - model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("tows_c",4); + this.model.in1 = [nu]; + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(-1); + this.model.out = []; + this.model.evtin = [1]; + this.model.evtout = []; + this.model.rpar = []; + this.model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; gr_i = []; exprs = [[string(this.nz)],[string(this.varnam)],[string(this.herit)]]; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TOWS_c.prototype.details = function TOWS_c() { @@ -18100,7 +18100,7 @@ function TOWS_c() { this.herit = parseFloat(arguments[0]["herit"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.nz,this.varnam,this.herit,exprs] = scicos_getvalue("Set Xcos buffer block",["Size of buffer","Scilab variable name","Inherit (no:0, yes:1)"],list("vec",1,"str",1,"vec",1),exprs); @@ -18119,16 +18119,16 @@ function TOWS_c() { } execstr("if type("+this.varnam+") <> 17 | or(fieldnames("+this.varnam+") <> [\"values\"; \"time\"]) then"+" message([\"Protected variable name.\"; \"Please choose another variable name.\"]);"+" ok = %f;"+" end","errcatch"); if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([-1,-2],-1),list(),ones(1-this.herit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],-1),list(),ones(1-this.herit,1),[]); if (this.herit==1) { - model.blocktype = "x"; + this.model.blocktype = new ScilabString("x"); } else { - model.blocktype = "d"; + this.model.blocktype = new ScilabString("d"); } - model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; + this.model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18139,15 +18139,15 @@ function TOWS_c() { function TRASH_f() { TRASH_f.prototype.define = function TRASH_f() { in1 = -1; - model = scicos_model(); - model.sim = "trash"; - model.in1 = in1; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("trash"); + this.model.in1 = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TRASH_f.prototype.details = function TRASH_f() { @@ -18172,17 +18172,17 @@ function WFILE_f() { fname = "foo"; lunit = 0; this.N = 2; - model = scicos_model(); - model.sim = "writef"; - model.in1 = this.in1; - model.evtin = 1; - model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; - model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]]]; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("writef"); + this.model.in1 = new ScilabDouble(this.in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + this.model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } WFILE_f.prototype.details = function WFILE_f() { @@ -18210,8 +18210,8 @@ function WFILE_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; lunit = dstate[2-1]; fname = exprs[2-1]; frmt = exprs[3-1]; @@ -18254,13 +18254,13 @@ function WFILE_f() { if (prod(size(dstate))!=(nin+1)*this.N+2) { dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } - model.in1 = nin; - model.dstate = dstate; - model.ipar = ipar; - model.dep_ut = [true,false]; + this.model.in1 = new ScilabDouble(nin); + this.model.dstate = dstate; + this.model.ipar = ipar; + this.model.dep_ut = [true,false]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18277,17 +18277,17 @@ function WRITEAU_f() { this.swap = 0; lunit = 0; this.N = 2; - model = scicos_model(); - model.sim = list("writeau",2); - model.in1 = in1; - model.evtin = 1; - model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("writeau",2); + this.model.in1 = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; exprs = [string(this.N),string(this.swap)]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } WRITEAU_f.prototype.details = function WRITEAU_f() { @@ -18306,9 +18306,9 @@ function WRITEAU_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; - dstate = model.dstate; + this.model = arg1.model; + ipar = this.model.ipar; + dstate = this.model.dstate; lunit = dstate[2-1]; while (true) { [ok,this.N,this.swap,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","WRITEAU_f")],[" "],["Write \'.au\' sound file on audio device"]],["Buffer Size","Swap Mode (0:No, 1:Yes)"],list("vec",1,"vec",1),exprs); @@ -18334,12 +18334,12 @@ function WRITEAU_f() { if (prod(size(dstate))!=(nin+1)*this.N+2) { dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } - model.in1 = 1; - model.dstate = dstate; - model.ipar = ipar; + this.model.in1 = new ScilabDouble(1); + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18356,17 +18356,17 @@ function WRITEC_f() { this.swap = 0; lunit = 0; this.N = 2; - model = scicos_model(); - model.sim = list("writec",2); - model.in1 = this.in1; - model.evtin = 1; - model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("writec",2); + this.model.in1 = new ScilabDouble(this.in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N),string(this.swap)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } WRITEC_f.prototype.details = function WRITEC_f() { @@ -18391,9 +18391,9 @@ function WRITEC_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; - dstate = model.dstate; + this.model = arg1.model; + ipar = this.model.ipar; + dstate = this.model.dstate; lunit = dstate[2-1]; fname = exprs[2-1]; frmt = exprs[3-1]; @@ -18440,12 +18440,12 @@ function WRITEC_f() { if (prod(size(dstate))!=(nin+1)*this.N+2) { dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } - model.in1 = nin; - model.dstate = dstate; - model.ipar = ipar; + this.model.in1 = new ScilabDouble(nin); + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18456,16 +18456,16 @@ function WRITEC_f() { function CLKINV_f() { CLKINV_f.prototype.define = function CLKINV_f() { this.prt = 1; - model = scicos_model(); - model.sim = "input"; - model.evtout = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("input"); + this.model.evtout = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = string(this.prt); gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new EventInBlock(this.x); } CLKINV_f.prototype.details = function CLKINV_f() { @@ -18480,7 +18480,7 @@ function CLKINV_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { @@ -18492,12 +18492,12 @@ function CLKINV_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong values for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - model.ipar = this.prt; - model.evtout = 1; - model.firing = -1; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18508,15 +18508,15 @@ function CLKINV_f() { function CLKIN_f() { CLKIN_f.prototype.define = function CLKIN_f() { this.prt = 1; - model = scicos_model(); - model.sim = "input"; - model.evtout = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("input"); + this.model.evtout = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = string(this.prt); - this.x = standard_define([1,1],model,exprs," "); + this.x = standard_define([1,1],this.model,exprs," "); return new BasicBlock(this.x); } CLKIN_f.prototype.details = function CLKIN_f() { @@ -18531,7 +18531,7 @@ function CLKIN_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { @@ -18543,12 +18543,12 @@ function CLKIN_f() { if (this.prt<=0) { message("Port number must be a positive integer"); } else { - model.ipar = this.prt; - model.evtout = 1; - model.firing = -1; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18623,10 +18623,10 @@ function CLOCK_c() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs; - model = xx.model; - t0_old = model.firing; - dt_old = model.rpar[1-1]; - model_n = model; + this.model = xx.model; + t0_old = this.model.firing; + dt_old = this.model.rpar[1-1]; + model_n = this.model; while (true) { [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","CLOCK_c")],[" "],["Event clock generator"],[" "],[" Do not start if \'Initialisation Time\' is negative"],[" "]],["Period","Initialisation Time"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -18638,9 +18638,9 @@ function CLOCK_c() { } if (ok) { xx.graphics.exprs = this.exprs0; - model.rpar = [[this.dt],[this.t0]]; - model.firing = this.t0; - xx.model = model; + this.model.rpar = [[this.dt],[this.t0]]; + this.model.firing = new ScilabDouble(this.t0); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } @@ -18727,10 +18727,10 @@ function CLOCK_f() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs; - model = xx.model; - t0_old = model.firing; - dt_old = model.rpar; - model_n = model; + this.model = xx.model; + t0_old = this.model.firing; + dt_old = this.model.rpar; + model_n = this.model; while (true) { [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue("Set Clock block parameters",["Period","Init time"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -18742,9 +18742,9 @@ function CLOCK_f() { } if (ok) { xx.graphics.exprs = this.exprs0; - model.rpar = this.dt; - model.firing = this.t0; - xx.model = model; + this.model.rpar = new ScilabDouble(this.dt); + this.model.firing = new ScilabDouble(this.t0); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } @@ -18767,16 +18767,16 @@ function CLOCK_f() { function CONST() { CONST.prototype.define = function CONST() { this.C = 1; - model = scicos_model(); - model.sim = list("cstblk4",4); - model.in1 = []; - model.out = 1; - model.rpar = this.C; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk4",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.C); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(sci2exp(this.C)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONST.prototype.details = function CONST() { @@ -18792,7 +18792,7 @@ function CONST() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); if (!ok) { @@ -18805,11 +18805,11 @@ function CONST() { } else if (and(sz>1)) { message("C matrix is not supported, use CONST_m instead"); } else { - model.rpar = this.C.slice(); - model.out = nout; + this.model.rpar = this.C.slice(); + this.model.out = new ScilabDouble(nout); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18820,16 +18820,16 @@ function CONST() { function CONST_f() { CONST_f.prototype.define = function CONST_f() { this.C = 1; - model = scicos_model(); - model.sim = list("cstblk",1); - model.in1 = []; - model.out = 1; - model.rpar = this.C; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk",1); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.C); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(sci2exp(this.C)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONST_f.prototype.details = function CONST_f() { @@ -18845,7 +18845,7 @@ function CONST_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); if (!ok) { @@ -18855,11 +18855,11 @@ function CONST_f() { if (nout==0) { message("C must have at least one element"); } else { - model.rpar = this.C.slice(); - model.out = nout; + this.model.rpar = this.C.slice(); + this.model.out = new ScilabDouble(nout); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18870,19 +18870,19 @@ function CONST_f() { function CONST_m() { CONST_m.prototype.define = function CONST_m() { this.C = [1]; - model = scicos_model(); - model.sim = list("cstblk4",4); - model.in1 = []; - model.out = size(this.C,1); - model.in2 = []; - model.out2 = size(this.C,2); - model.rpar = this.C; - model.opar = list(); - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk4",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(size(this.C,1)); + this.model.in2 = []; + this.model.out2 = new ScilabDouble(size(this.C,2)); + this.model.rpar = this.C; + this.model.opar = list(); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = sci2exp(this.C); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONST_m.prototype.details = function CONST_m() { @@ -18898,7 +18898,7 @@ function CONST_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONST_m")],[" "],["Constant value generator"],[" "]],"Constant Value",list("vec",-1),exprs); if (!ok) { @@ -18908,8 +18908,8 @@ function CONST_m() { if (find(nout==0)!=[]) { block_parameter_error(msprintf("Wrong size for \'%s\' parameter","Constant Value"),"Constant value must have at least one element."); } else { - model.sim = list("cstblk4_m",4); - model.opar = list(this.C); + this.model.sim = list("cstblk4_m",4); + this.model.opar = list(this.C); if ((this.type[this.C-1]==1)) { if (isreal(this.C)) { ot = 1; @@ -18933,11 +18933,11 @@ function CONST_m() { ok = false; } if (ok) { - model.rpar = []; - [model,graphics,ok] = set_io(model,graphics,list(),list(nout,ot),[],[]); + this.model.rpar = []; + [model,graphics,ok] = set_io(this.model,graphics,list(),list(nout,ot),[],[]); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -18954,16 +18954,16 @@ function CURV_f() { axisdata = [[2],[10],[2],[10]]; ipar = [[size(xx,1)],[axisdata.slice()]]; rpar = [[xx],[yy],[rect.slice()]]; - model = scicos_model(); - model.sim = "intplt"; - model.in1 = []; - model.out = 1; - model.rpar = [[xx],[yy],[rect.slice()]]; - model.ipar = [[size(xx,1)],[axisdata.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("intplt"); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = [[xx],[yy],[rect.slice()]]; + this.model.ipar = [[size(xx,1)],[axisdata.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } CURV_f.prototype.details = function CURV_f() { @@ -18976,10 +18976,10 @@ function CURV_f() { } CURV_f.prototype.set = function CURV_f() { this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; - rpar = model.rpar; - ipar = model.ipar; + rpar = this.model.rpar; + ipar = this.model.ipar; n = ipar[1-1]; xx = rpar.slice(1-1,n); yy = rpar.slice(n+1-1,2*n); @@ -19000,14 +19000,14 @@ function CURV_f() { ok = false; } if (ok) { - model.sim = "intplt"; - model.firing = []; + this.model.sim = new ScilabString("intplt"); + this.model.firing = []; rect = gc[1-1]; - model.rpar = [[xx.slice()],[yy.slice()],[rect.slice()]]; + this.model.rpar = [[xx.slice()],[yy.slice()],[rect.slice()]]; axisdata = gc[2-1]; - model.ipar = [[size(xx,"*")],[axisdata.slice()]]; + this.model.ipar = [[size(xx,"*")],[axisdata.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19020,18 +19020,18 @@ function Counter() { this.minim = 0; this.maxim = 2; this.rule = 1; - model = scicos_model(); - model.sim = list("counter",4); - model.evtin = 1; - model.out = 1; - model.out2 = 1; - model.dstate = 0; - model.ipar = [[this.rule],[this.maxim],[this.minim]]; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("counter",4); + this.model.evtin = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.ipar = [[this.rule],[this.maxim],[this.minim]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [[string(this.minim)],[string(this.maxim)],[string(this.rule)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } Counter.prototype.details = function Counter() { @@ -19052,7 +19052,7 @@ function Counter() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.minim,this.maxim,this.rule,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","Counter")],[" "],["Integer counter generator"],[" "]],["Minimum","Maximum","Rule (1:Increment, 2:Decrement)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -19066,10 +19066,10 @@ function Counter() { block_parameter_error(msprintf("Wrong value for \'Rule\' parameter: %d",this.rule),msprintf("Must be in the interval %s.","[1,2]")); } else { graphics.exprs = exprs; - model.dstate = 0; - model.ipar = [[this.rule],[this.maxim],[this.minim]]; + this.model.dstate = new ScilabDouble(0); + this.model.ipar = [[this.rule],[this.maxim],[this.minim]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19084,9 +19084,9 @@ function FROMWSB() { scs_m_1.objs[2-1] = scicos_link(xx=[[295.37067],[295.37067],[233.23733],[233.23733],[295.37067],[295.37067]],yy=[[255.86971],[223.45067],[223.45067],[337.85067],[337.85067],[307.29829]],id="drawlink",thick=[0,0],ct=[5,-1],from=[1,1,0],to=[1,1,1]); scs_m_1.objs[3-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[358.9421,271.584],sz=[20,20],flip=true,theta=0,exprs="1",pin=4,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=-2,intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[4-1] = scicos_link(xx=[[338.9421],[358.9421]],yy=[[281.584],[281.584]],id="drawlink",thick=[0,0],ct=[1,1],from=[1,1,0],to=[3,1,1]); - model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=-2,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); + this.model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=-2,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); gr_i = []; - this.x = standard_define([5,2],model,[],gr_i); + this.x = standard_define([5,2],this.model,[],gr_i); return new BasicBlock(this.x); } FROMWSB.prototype.details = function FROMWSB() { @@ -19119,40 +19119,40 @@ function FROMWSB() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (!this.isequalbitwise[this.xxn-1][xx-1]) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)||or(this.model.in2!=model_n.in2)||or(this.model.out2!=model_n.out2)||or(this.model.outtyp!=model_n.outtyp)||or(this.model.intyp!=model_n.intyp)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; @@ -19175,20 +19175,20 @@ function FROMWS_c() { this.Method = 1; this.ZC = 1; this.OutEnd = 0; - model = scicos_model(); - model.sim = list("fromws_c",4); - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; - model.evtin = [1]; - model.evtout = [1]; - model.firing = [0]; - model.blocktype = "d"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("fromws_c",4); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; + this.model.evtin = [1]; + this.model.evtout = [1]; + this.model.firing = [0]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,true]; gr_i = []; exprs = [[string(this.varnam)],[string(this.Method)],[string(this.ZC)],[string(this.OutEnd)]]; - this.x = standard_define([3.5,2],model,exprs,gr_i); + this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } FROMWS_c.prototype.details = function FROMWS_c() { @@ -19211,7 +19211,7 @@ function FROMWS_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.varnam,this.Method,this.ZC,this.OutEnd,exprs] = scicos_getvalue("Set From_Workspace block parameters",["Variable name","Interpolation Method","Enable zero crossing(0:No, 1:Yes)?","Output at end(0:Zero, 1:Hold, 2:Repeat)"],list("str",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -19236,12 +19236,12 @@ function FROMWS_c() { ok = false; } if (ok) { - model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; - [model,graphics,ok] = set_io(model,graphics,list(),list([-1,-2],-1),1,1); + this.model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; + [model,graphics,ok] = set_io(this.model,graphics,list(),list([-1,-2],-1),1,1); if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19253,18 +19253,18 @@ function FROMWS_c() { function GENSIN_f() { GENSIN_f.prototype.define = function GENSIN_f() { rpar = [[1],[1],[0]]; - model = scicos_model(); - model.sim = "gensin"; - model.in1 = []; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.rpar = [[1],[1],[0]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gensin"); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.rpar = [[1],[1],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[string(rpar[1-1])],[string(rpar[2-1])],[string(rpar[3-1])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GENSIN_f.prototype.details = function GENSIN_f() { @@ -19285,7 +19285,7 @@ function GENSIN_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.M,this.F,this.P,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","GENSIN_f")],[" "],["Sine wave generator"],[" "]],["Magnitude","Frequency (rad/s)","Phase (rad)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -19296,13 +19296,13 @@ function GENSIN_f() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[],1,[],[]); - model.rpar = [[this.M],[this.F],[this.P]]; - model.out2 = 1; - model.outtyp = 1; + [model,graphics,ok] = check_io(this.model,graphics,[],1,[],[]); + this.model.rpar = [[this.M],[this.F],[this.P]]; + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19313,18 +19313,18 @@ function GENSIN_f() { function GENSQR_f() { GENSQR_f.prototype.define = function GENSQR_f() { this.Amplitude = 1; - model = scicos_model(); - model.sim = "gensqr"; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.evtin = 1; - model.dstate = this.Amplitude; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gensqr"); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.Amplitude); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = string(this.Amplitude); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GENSQR_f.prototype.details = function GENSQR_f() { @@ -19341,7 +19341,7 @@ function GENSQR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -19351,11 +19351,11 @@ function GENSQR_f() { break; } graphics.exprs = exprs; - model.dstate = this.Amplitude; - model.out2 = 1; - model.outtyp = 1; + this.model.dstate = new ScilabDouble(this.Amplitude); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); @@ -19381,36 +19381,36 @@ function GEN_SQR() { scs_m_1.objs[14-1] = scicos_link(xx=[[164.84097],[184.40238]],yy=[[289.42294],[288.75198]],id="drawlink",thick=[0,0],ct=[1,1],from=[4,1,0],to=[13,1,1]); scs_m_1.objs[15-1] = scicos_block(gui="SampleCLK",graphics=scicos_graphics(orig=[18.313686,403.57431],sz=[60,40],flip=true,theta=0,exprs=[["F/2"],["0"]],pin=[],pout=[],pein=[],peout=16,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="sampleclk",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=[[1/2],[0]],ipar=[],opar=list(),blocktype="d",firing=-1,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[16-1] = scicos_link(xx=[[48.313686],[48.229901]],yy=[[403.57431],[385.21998]],id="drawlink",thick=[0,0],ct=[5,-1],from=[15,1,0],to=[1,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.odstate = list(); - model.rpar = scs_m_1; - model.ipar = 1; - model.opar = list(); - model.blocktype = "h"; - model.firing = []; - model.dep_ut = [false,false]; - model.label = ""; - model.nzcross = 0; - model.nmode = 0; - model.equations = list(); + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.odstate = list(); + this.model.rpar = new ScilabDouble(scs_m_1); + this.model.ipar = new ScilabDouble(1); + this.model.opar = list(); + this.model.blocktype = new ScilabString("h"); + this.model.firing = []; + this.model.dep_ut = [false,false]; + this.model.label = new ScilabString(""); + 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 = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GEN_SQR.prototype.details = function GEN_SQR() { @@ -19466,20 +19466,20 @@ function GEN_SQR() { function Ground_g() { Ground_g.prototype.define = function Ground_g() { C = [0]; - model = scicos_model(); - model.sim = list("cstblk4_m",4); - model.in1 = []; - model.out = 1; - model.in2 = []; - model.out2 = 1; - model.outtyp = -1; - model.rpar = []; - model.opar = list(C); - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk4_m",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.in2 = []; + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(-1); + this.model.rpar = []; + this.model.opar = list(C); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } Ground_g.prototype.details = function Ground_g() { @@ -19498,21 +19498,21 @@ function Ground_g() { /* autogenerated from "macros/Sources/INIMPL_f.sci" */ function INIMPL_f() { INIMPL_f.prototype.define = function INIMPL_f() { - model = scicos_model(); - model.sim = "inimpl"; - model.out = [-1]; - model.out2 = [1]; - model.ipar = [1]; - model.dep_ut = [false,false]; - model.blocktype = "c"; + this.model = scicos_model(); + this.model.sim = new ScilabString("inimpl"); + this.model.out = [-1]; + this.model.out2 = [1]; + this.model.ipar = [1]; + this.model.dep_ut = [false,false]; + this.model.blocktype = new ScilabString("c"); mo = modelica(); mo.model = "PORT"; mo.outputs = "n"; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); this.prt = 1; exprs = "1"; gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); this.x.graphics.out_implicit = ["I"]; return new ImplicitInBlock(this.x); } @@ -19529,7 +19529,7 @@ function INIMPL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[1-1]; } @@ -19542,14 +19542,14 @@ function INIMPL_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - if (model.ipar!=this.prt) { + if (this.model.ipar!=this.prt) { needcompile = 4; y = needcompile; } - model.ipar = this.prt; + this.model.ipar = new ScilabDouble(this.prt); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19560,17 +19560,17 @@ function INIMPL_f() { function IN_f() { IN_f.prototype.define = function IN_f() { prt = 1; - model = scicos_model(); - model.sim = "input"; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = prt; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("input"); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = new ScilabDouble(prt); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = sci2exp(prt); gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new ExplicitInBlock(this.x); } IN_f.prototype.details = function IN_f() { @@ -19584,7 +19584,7 @@ function IN_f() { IN_f.prototype.set = function IN_f() { this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,"*")==2) { exprs = exprs[1-1]; @@ -19605,18 +19605,18 @@ function IN_f() { } else if (((ot<1||ot>9)&&(ot!=-1))) { message(_("Outport type must be a number between 1 and 9, or -1 for inheritance.")); } else { - if (model.ipar!=prt) { + if (this.model.ipar!=prt) { needcompile = 4; y = needcompile; } - model.ipar = prt; - model.firing = []; - model.out = otsz[1-1]; - model.out2 = otsz[2-1]; - model.outtyp = ot; + this.model.ipar = new ScilabDouble(prt); + this.model.firing = []; + this.model.out = new ScilabDouble(otsz[1-1]); + this.model.out2 = new ScilabDouble(otsz[2-1]); + this.model.outtyp = new ScilabDouble(ot); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19628,17 +19628,17 @@ function Modulo_Count() { Modulo_Count.prototype.define = function Modulo_Count() { this.ini_c = 0; this.base = 3; - model = scicos_model(); - model.sim = list("modulo_count",4); - model.evtin = 1; - model.out = 1; - model.dstate = this.ini_c; - model.ipar = this.base; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("modulo_count",4); + this.model.evtin = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.ini_c); + this.model.ipar = new ScilabDouble(this.base); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [[string(this.ini_c)],[string(this.base)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } Modulo_Count.prototype.details = function Modulo_Count() { @@ -19657,7 +19657,7 @@ function Modulo_Count() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.ini_c,this.base,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","Modulo_Count")],[" "],["Modulo counter (0 to N counter)"],[" "]],["Initial State (zero or positive number)","Upper Limit (positive number)"],list("vec",1,"vec",1),exprs); this.ini_c = int(this.ini_c); @@ -19671,10 +19671,10 @@ function Modulo_Count() { block_parameter_error(msprintf("Wrong values for \'Upper Limit\' parameter: %d.",this.base),"Strictly positive integer expected."); } else { graphics.exprs = exprs; - model.ipar = this.base; - model.dstate = this.ini_c; + this.model.ipar = new ScilabDouble(this.base); + this.model.dstate = new ScilabDouble(this.ini_c); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19696,36 +19696,36 @@ function PULSE_SC() { scs_m_1.objs[9-1] = scicos_link(xx=[[112.34974],[112.34974],[119.33985],[119.33985]],yy=[[274.21741],[248.21372],[248.21372],[231.80809]],id="drawlink",thick=[0,0],ct=[5,-1],from=[6,1,0],to=[3,1,1]); scs_m_1.objs[10-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[174.57795,196.09381],sz=[20,20],flip=true,theta=0,exprs="1",pin=11,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=-2,intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[11-1] = scicos_link(xx=[[154.57795],[174.57795]],yy=[[206.09381],[206.09381]],id="drawlink",thick=[0,0],ct=[1,1],from=[3,1,0],to=[10,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.odstate = list(); - model.rpar = scs_m_1; - model.ipar = 1; - model.opar = list(); - model.blocktype = "h"; - model.firing = []; - model.dep_ut = [false,false]; - model.label = ""; - model.nzcross = 0; - model.nmode = 0; - model.equations = list(); + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.odstate = list(); + this.model.rpar = new ScilabDouble(scs_m_1); + this.model.ipar = new ScilabDouble(1); + this.model.opar = list(); + this.model.blocktype = new ScilabString("h"); + this.model.firing = []; + this.model.dep_ut = [false,false]; + this.model.label = new ScilabString(""); + 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 = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } PULSE_SC.prototype.details = function PULSE_SC() { @@ -19786,18 +19786,18 @@ function RAMP() { this.iout = 0; this.stt = 0; rpar = [[this.slope],[this.stt],[this.iout]]; - model = scicos_model(); - model.sim = list("ramp",4); - model.in1 = []; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.nmode = 1; - model.nzcross = 1; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("ramp",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); + this.model.dep_ut = [false,true]; exprs = [string(rpar)]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RAMP.prototype.details = function RAMP() { @@ -19818,7 +19818,7 @@ function RAMP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.slope,this.stt,this.iout,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","RAMP")],[" "],["Ramp function"],[" "]],["Slope","Start Time","Initial Value"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -19827,10 +19827,10 @@ function RAMP() { if (this.stt<0) { block_parameter_error(msprintf("Wrong value for \'Start Time\' parameter: %e.",this.stt),"Null or positive integer expected."); } else { - model.rpar = [[this.slope],[this.stt],[this.iout]]; + this.model.rpar = [[this.slope],[this.stt],[this.iout]]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19845,18 +19845,18 @@ function RAND_f() { dt = 0; out = 1; this.flag = 0; - model = scicos_model(); - model.sim = "rndblk"; - model.out = out; - model.evtin = 1; - model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; - model.rpar = [[this.a.slice()],[this.b.slice()]]; - model.ipar = this.flag; - model.blocktype = "d"; - model.dep_ut = [false,false]; - exprs = [[string(this.flag)],[sci2exp(this.a.slice())],[sci2exp(this.b.slice())],[string(model.dstate[1-1])]]; + this.model = scicos_model(); + this.model.sim = new ScilabString("rndblk"); + this.model.out = new ScilabDouble(out); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; + this.model.rpar = [[this.a.slice()],[this.b.slice()]]; + this.model.ipar = new ScilabDouble(this.flag); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; + exprs = [[string(this.flag)],[sci2exp(this.a.slice())],[sci2exp(this.b.slice())],[string(this.model.dstate[1-1])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RAND_f.prototype.details = function RAND_f() { @@ -19879,12 +19879,12 @@ function RAND_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==5) { exprs = exprs.slice(1-1,3); } if (size(exprs,"*")==3) { - exprs = [[exprs],[string(model.dstate[1-1])]]; + exprs = [[exprs],[string(this.model.dstate[1-1])]]; } while (true) { [ok,this.flag,this.a,this.b,this.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 vector with equal sizes"],["seed is the seed of random number generator (integer<2**31)"]],["flag","A","B","seed"],list("vec",1,"vec",-1,"vec","size(%2,\'*\')","vec",1),exprs); @@ -19896,12 +19896,12 @@ function RAND_f() { } else { nout = size(this.a,"*"); graphics.exprs = exprs; - model.out = nout; - model.ipar = this.flag; - model.rpar = [[this.a.slice()],[this.b.slice()]]; - model.dstate = [[this.seed_c],[0*this.a.slice()]]; + this.model.out = new ScilabDouble(nout); + this.model.ipar = new ScilabDouble(this.flag); + this.model.rpar = [[this.a.slice()],[this.b.slice()]]; + this.model.dstate = [[this.seed_c],[0*this.a.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -19917,26 +19917,26 @@ function RAND_m() { this.flag = 0; function_name = "rndblk_m"; funtyp = 4; - model = scicos_model(); - model.sim = list(function_name,funtyp); - model.in1 = []; - 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*this.a.slice()]]; - model.rpar = [this.a.slice(),this.b.slice()]; - model.ipar = this.flag; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; - exprs = [[sci2exp(1)],[string(this.flag)],[sci2exp([this.a])],[sci2exp([this.b])],[sci2exp([model.dstate[1-1],int(rand()*(10^7-1))])]]; + this.model = scicos_model(); + this.model.sim = list(function_name,funtyp); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = []; + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = []; + this.model.state = []; + this.model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; + this.model.rpar = [this.a.slice(),this.b.slice()]; + this.model.ipar = new ScilabDouble(this.flag); + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; + exprs = [[sci2exp(1)],[string(this.flag)],[sci2exp([this.a])],[sci2exp([this.b])],[sci2exp([this.model.dstate[1-1],int(rand()*(10^7-1))])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RAND_m.prototype.details = function RAND_m() { @@ -19961,7 +19961,7 @@ function RAND_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==14) { exprs[9-1] = []; } @@ -19976,26 +19976,26 @@ function RAND_m() { out = size(this.a); if (this.typ==1) { function_name = "rndblk_m"; - model.rpar = [[real(this.a.slice())],[real(this.b.slice())]]; - model.dstate = [[this.seed_c[1-1]],[0*real(this.a.slice())]]; + this.model.rpar = [[real(this.a.slice())],[real(this.b.slice())]]; + this.model.dstate = [[this.seed_c[1-1]],[0*real(this.a.slice())]]; ot = 1; } else if (this.typ==2) { function_name = "rndblkz_m"; ot = 2; - model.rpar = [[real(this.a.slice())],[imag(this.a.slice())],[real(this.b.slice())],[imag(this.b.slice())]]; - model.dstate = [[this.seed_c.slice()],[0*[[real(this.a.slice())],[imag(this.a.slice())]]]]; + this.model.rpar = [[real(this.a.slice())],[imag(this.a.slice())],[real(this.b.slice())],[imag(this.b.slice())]]; + this.model.dstate = [[this.seed_c.slice()],[0*[[real(this.a.slice())],[imag(this.a.slice())]]]]; } else { message("Datatype is not supported"); ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([],[]),list(out,ot),1,[]); + [model,graphics,ok] = set_io(this.model,graphics,list([],[]),list(out,ot),1,[]); if (ok) { - model.sim = list(function_name,4); + this.model.sim = list(function_name,4); graphics.exprs = exprs; - model.ipar = this.flag; + this.model.ipar = new ScilabDouble(this.flag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -20018,17 +20018,17 @@ function READAU_f() { outmask = 1; ievt = 0; nout = size(outmask,"*"); - model = scicos_model(); - model.sim = list("readau",2); - model.out = nout; - model.evtin = 1; - model.dstate = [[1],[1],[lunit],[zeros(this.N*M,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[M],[this.swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("readau",2); + this.model.out = new ScilabDouble(nout); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[1],[1],[lunit],[zeros(this.N*M,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[M],[this.swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[fname],[string(this.N)],[string(this.swap)]]; gr_i = []; - this.x = standard_define([5,2],model,exprs,gr_i); + this.x = standard_define([5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } READAU_f.prototype.details = function READAU_f() { @@ -20049,10 +20049,10 @@ function READAU_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - out = model.out; - dstate = model.dstate; - ipar = model.ipar; + this.model = arg1.model; + out = this.model.out; + dstate = this.model.dstate; + ipar = this.model.ipar; imask = 9+ipar[1-1]; tmask = ipar[imask-1]; lunit = dstate[3-1]; @@ -20080,18 +20080,18 @@ function READAU_f() { } else if (this.swap!=0&&this.swap!=1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Swap Mode",this.swap),msprintf("Must be in the interval %s.","[0, 1]")); } else { - [model,graphics,ok] = check_io(model,graphics,[],1,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,[],1,1,[]); frmt1 = part(frmt1,1,3); if (ok) { ipar = [[length(this.fname1)],[this._str2code[frmt1-1]],[0],[this.N],[M],[this.swap],[offset,this._str2code[this.fname1-1]],[tmask1,outmask.slice()]]; if (prod(size(dstate))!=(this.N*M)+3) { dstate = [[-1],[-1],[lunit],[zeros(this.N*M,1)]]; } - model.dstate = dstate; - model.ipar = ipar; + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -20115,19 +20115,19 @@ function READC_f() { ievt = 0; nout = size(this.outmask,"*"); ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; - model = scicos_model(); - model.sim = list("readc",2); - model.out = nout; - model.evtin = 1; - model.evtout = []; - model.dstate = [[1],[1],[lunit],[zeros(this.N*this.M,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("readc",2); + this.model.out = new ScilabDouble(nout); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = []; + this.model.dstate = [[1],[1],[lunit],[zeros(this.N*this.M,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = [["[]"],[sci2exp(this.outmask)],[fname],[frmt],[string(this.M)],[string(this.N)],[string(this.offset)],[string(this.swap)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } READC_f.prototype.details = function READC_f() { @@ -20156,12 +20156,12 @@ function READC_f() { this.offset = parseFloat(arguments[0]["offset"]) this.swap = parseFloat(arguments[0]["swap"]) this.x = arg1; - model = this.x.model; + this.model = this.x.model; graphics = arg1.graphics; exprs = graphics.exprs; - out = model.out; - dstate = model.dstate; - ipar = model.ipar; + out = this.model.out; + dstate = this.model.dstate; + ipar = this.model.ipar; imask = 9+ipar[1-1]; tmask = ipar[imask-1]; lunit = dstate[3-1]; @@ -20214,23 +20214,23 @@ function READC_f() { outpt = 1; } out = size(this.outmask,"*"); - [model,graphics,ok] = check_io(model,graphics,[],out,1,outpt); + [model,graphics,ok] = check_io(this.model,graphics,[],out,1,outpt); this.frmt1 = part(this.frmt1,1,3); if (ok) { if (ievt==0) { - model.firing = -1; + this.model.firing = new ScilabDouble(-1); } else { - model.firing = 0; + this.model.firing = new ScilabDouble(0); } ipar = [[length(this.fname1)],[this._str2code[this.frmt1-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[this.fname1-1]],[this.tmask1],[this.outmask.slice()]]; if (prod(size(dstate))!=(this.N*this.M)+3) { dstate = [[-1],[-1],[lunit],[zeros(this.N*this.M,1)]]; } - model.dstate = dstate; - model.ipar = ipar; + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -20252,17 +20252,17 @@ function RFILE_f() { this.outmask = 1; ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; dstate = [[1],[1],[lunit],[zeros((nout)*this.N,1)]]; - model = scicos_model(); - model.sim = "readf"; - model.out = nout; - model.evtin = 1; - model.dstate = dstate; - model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("readf"); + this.model.out = new ScilabDouble(nout); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = dstate; + this.model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[sci2exp([])],[sci2exp(this.outmask)],[fname],[frmt],[string(this.N)],[sci2exp(out)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RFILE_f.prototype.details = function RFILE_f() { @@ -20287,9 +20287,9 @@ function RFILE_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; - ipar = model.ipar; + this.model = arg1.model; + dstate = this.model.dstate; + ipar = this.model.ipar; ievt = ipar[3-1]; this.N = ipar[4-1]; imask = 5+ipar[1-1]+ipar[2-1]; @@ -20337,22 +20337,22 @@ function RFILE_f() { ievt = 1; cout = 1; } - [model,graphics,ok] = check_io(model,graphics,[],nout,1,cout); + [model,graphics,ok] = check_io(this.model,graphics,[],nout,1,cout); if (ok) { if (ievt==0) { - model.firing = []; + this.model.firing = []; } else { - model.firing = 0; + this.model.firing = new ScilabDouble(0); } ipar = [[length(this.fname1)],[length(this.frmt1)],[ievt],[this.N],[this._str2code[this.fname1-1]],[this._str2code[this.frmt1-1]],[this.tmask1],[this.outmask.slice()]]; if (prod(size(dstate))!=(nout+ievt)*this.N+3) { dstate = [[-1],[-1],[lunit],[zeros((nout+ievt)*this.N,1)]]; } - model.dstate = dstate; - model.ipar = ipar; + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -20363,16 +20363,16 @@ function RFILE_f() { /* autogenerated from "macros/Sources/SAWTOOTH_f.sci" */ function SAWTOOTH_f() { SAWTOOTH_f.prototype.define = function SAWTOOTH_f() { - model = scicos_model(); - model.sim = "sawtth"; - model.out = 1; - model.evtin = 1; - model.dstate = 0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sawtth"); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = " "; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SAWTOOTH_f.prototype.details = function SAWTOOTH_f() { @@ -20392,20 +20392,20 @@ function SAWTOOTH_f() { function STEP() { STEP.prototype.define = function STEP() { rpar = [[0],[1]]; - model = scicos_model(); - model.sim = list("step_func",4); - model.evtin = 1; - model.evtout = 1; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.firing = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("step_func",4); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.firing = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [[string(1)],[string(rpar)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } STEP.prototype.details = function STEP() { @@ -20426,7 +20426,7 @@ function STEP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.temps,this.in1,this.fi,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","STEP_FUNCTION")],[" "],["Step Function"],[" "]],["Step Time","Initial Value","Final Value"],list("vec",1,"vec",-1,"vec",-1),exprs); if (!ok) { @@ -20445,21 +20445,21 @@ function STEP() { } } if (ok) { - model.out2 = 1; - model.outtyp = 1; - [model,graphics,ok] = check_io(model,graphics,[],size(this.fi,"*"),1,1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + [model,graphics,ok] = check_io(this.model,graphics,[],size(this.fi,"*"),1,1); } if (ok) { - model.firing = this.temps; + this.model.firing = new ScilabDouble(this.temps); if (this.temps==0) { rpar = [[this.fi],[this.fi]]; } else { rpar = [[this.in1],[this.fi]]; } - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -20476,25 +20476,25 @@ function STEP_FUNCTION() { scs_m_1.objs[4-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,0]; graphics.sz = [40,40]; graphics.pein = 4; graphics.peout = 4; graphics.pout = 3; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [80,10]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pin = 3; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; lnk = scs_m_1.objs[3-1]; lnk.from = [1,1,0]; @@ -20509,14 +20509,14 @@ function STEP_FUNCTION() { scs_m_1.objs[4-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } STEP_FUNCTION.prototype.details = function STEP_FUNCTION() { @@ -20548,37 +20548,37 @@ function STEP_FUNCTION() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (diffobjs(this.xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; @@ -20597,15 +20597,15 @@ function STEP_FUNCTION() { /* autogenerated from "macros/Sources/SampleCLK.sci" */ function SampleCLK() { SampleCLK.prototype.define = function SampleCLK() { - model = scicos_model(); - model.sim = "sampleclk"; - model.evtout = 1; - model.rpar = [1,0]; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sampleclk"); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [1,0]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = [[sci2exp(1)],[sci2exp(0)]]; - this.x = standard_define([2,2],model,exprs," "); + this.x = standard_define([2,2],this.model,exprs," "); return new BasicBlock(this.x); } SampleCLK.prototype.details = function SampleCLK() { @@ -20623,7 +20623,7 @@ function SampleCLK() { this.offset = arguments[0]["offset"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",1,"vec",1),exprs); @@ -20639,16 +20639,16 @@ function SampleCLK() { ok = false; } if (ok) { - if (or(model.rpar.slice()!=[[this.frequ],[this.offset]])) { + if (or(this.model.rpar.slice()!=[[this.frequ],[this.offset]])) { needcompile = 4; y = needcompile; } - model.rpar = [[this.frequ],[this.offset]]; - model.evtout = 1; - model.firing = -1; + this.model.rpar = [[this.frequ],[this.offset]]; + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } @@ -20668,9 +20668,9 @@ function Sigbuilder() { scs_m_1.objs[6-1] = scicos_link(xx=[[378.20616],[398.20616]],yy=[[626.18517],[626.18517]],id="drawlink",thick=[0,0],ct=[1,1],from=[1,1,0],to=[5,1,1]); scs_m_1.objs[7-1] = scicos_block(gui="CLKOUTV_f",graphics=scicos_graphics(orig=[339.49528,505.10704],sz=[20,30],flip=true,theta=0,exprs="1",pin=[],pout=[],pein=8,peout=[],gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="output",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=1,evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[8-1] = scicos_link(xx=[[349.49528],[349.49528]],yy=[[565.10704],[535.10704]],id="drawlink",thick=[0,0],ct=[5,-1],from=[3,1,0],to=[7,1,1]); - model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); + this.model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } Sigbuilder.prototype.details = function Sigbuilder() { @@ -20704,40 +20704,40 @@ function Sigbuilder() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (diffobjs(this.xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)||or(this.model.in2!=model_n.in2)||or(this.model.out2!=model_n.out2)||or(this.model.outtyp!=model_n.outtyp)||or(this.model.intyp!=model_n.intyp)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; @@ -20756,13 +20756,13 @@ function Sigbuilder() { /* autogenerated from "macros/Sources/TIME_f.sci" */ function TIME_f() { TIME_f.prototype.define = function TIME_f() { - model = scicos_model(); - model.sim = "timblk"; - model.out = 1; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("timblk"); + this.model.out = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } TIME_f.prototype.details = function TIME_f() { @@ -20784,16 +20784,16 @@ function TKSCALE() { this.a = -10; this.b = 10; this.f = 1; - model = scicos_model(); - model.sim = list("tkscaleblk",5); - model.out = 1; - model.evtin = 1; - model.rpar = [[this.a],[this.b],[this.f]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("tkscaleblk",5); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.a],[this.b],[this.f]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[sci2exp(this.a)],[sci2exp(this.b)],[sci2exp(this.f)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TKSCALE.prototype.details = function TKSCALE() { @@ -20814,13 +20814,13 @@ function TKSCALE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; [ok,this.a,this.b,this.f,exprs] = scicos_getvalue("Set scale block parameters",["Min value","Max value","Normalization"],list("vec",1,"vec",1,"vec",1),exprs); if (ok) { graphics.exprs = exprs; - model.rpar = [[this.a],[this.b],[this.f]]; + this.model.rpar = [[this.a],[this.b],[this.f]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; } return new BasicBlock(this.x); } @@ -20831,18 +20831,18 @@ function GENERAL_f() { rpar = [[0],[0],[0],[0]]; this.in1 = 1; this.out = 1; - model = scicos_model(); - model.sim = list("zcross",1); - model.nzcross = this.in1; - model.in1 = this.in1; - model.evtout = ones(this.out,1); - model.rpar = [[0],[0],[0],[0]]; - model.blocktype = "z"; - model.firing = -ones(this.out,1); - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.in1 = new ScilabDouble(this.in1); + this.model.evtout = new ScilabDouble(ones(this.out,1)); + this.model.rpar = [[0],[0],[0],[0]]; + this.model.blocktype = new ScilabString("z"); + this.model.firing = new ScilabDouble(-ones(this.out,1)); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.in1))],[strcat(sci2exp(this.out))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GENERAL_f.prototype.details = function GENERAL_f() { @@ -20861,15 +20861,15 @@ function GENERAL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - rpar = model.rpar; - this.in1 = model.in1; - this.out = model.evtout; + this.model = arg1.model; + rpar = this.model.rpar; + this.in1 = this.model.in1; + this.out = this.model.evtout; nin = sum(this.in1); nout = sum(this.out); [ok,this.in1,this.out,exprs] = scicos_getvalue("Set General Zero-Crossing parameters",["Input size","Number of event output"],list("vec",1,"vec",1),exprs); if (ok) { - [model,graphics,ok] = check_io(model,graphics,this.in1,[],[],ones(this.out,1)); + [model,graphics,ok] = check_io(this.model,graphics,this.in1,[],[],ones(this.out,1)); if (ok) { nout1 = this.out; nin1 = this.in1; @@ -20882,12 +20882,12 @@ function GENERAL_f() { result = x_mdialog("routing matrix",string(1,nout1),string(1,2^(2*nin1)),string(rp.slice().slice())); if (result!=[]) { rp.slice(1-1,nout1).slice(1-1,2*n) = evstr(result); - model.nzcross = this.in1; - model.rpar = rp.slice(); - model.firing = -ones(this.out,1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.rpar = rp.slice(); + this.model.firing = new ScilabDouble(-ones(this.out,1)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; } } } @@ -20897,17 +20897,17 @@ function GENERAL_f() { /* autogenerated from "macros/Threshold/NEGTOPOS_f.sci" */ function NEGTOPOS_f() { NEGTOPOS_f.prototype.define = function NEGTOPOS_f() { - model = scicos_model(); - model.sim = list("zcross",1); - model.nzcross = 1; - model.in1 = 1; - model.evtout = 1; - model.rpar = [[-1],[-1],[0],[-1]]; - model.blocktype = "z"; - model.firing = -1; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.nzcross = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[-1],[-1],[0],[-1]]; + this.model.blocktype = new ScilabString("z"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } NEGTOPOS_f.prototype.details = function NEGTOPOS_f() { @@ -20928,17 +20928,17 @@ function NEGTOPOS_f() { function POSTONEG_f() { POSTONEG_f.prototype.define = function POSTONEG_f() { rpar = [[-1],[-1],[-1],[0]]; - model = scicos_model(); - model.sim = list("zcross",1); - model.nzcross = 1; - model.in1 = 1; - model.evtout = 1; - model.rpar = [[-1],[-1],[-1],[0]]; - model.blocktype = "z"; - model.dep_ut = [true,false]; - model.firing = [-1]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.nzcross = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[-1],[-1],[-1],[0]]; + this.model.blocktype = new ScilabString("z"); + this.model.dep_ut = [true,false]; + this.model.firing = [-1]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } POSTONEG_f.prototype.details = function POSTONEG_f() { @@ -20960,18 +20960,18 @@ function ZCROSS_f() { ZCROSS_f.prototype.define = function ZCROSS_f() { rpar = [[-1],[-1],[0],[0]]; this.in1 = 1; - model = scicos_model(); - model.sim = list("zcross",1); - model.in1 = this.in1; - model.nzcross = this.in1; - model.evtout = 1; - model.rpar = [[-1],[-1],[0],[0]]; - model.blocktype = "z"; - model.firing = -1; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.in1 = new ScilabDouble(this.in1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[-1],[-1],[0],[0]]; + this.model.blocktype = new ScilabString("z"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [true,false]; exprs = strcat(sci2exp(this.in1)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ZCROSS_f.prototype.details = function ZCROSS_f() { @@ -20987,7 +20987,7 @@ function ZCROSS_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,exprs] = scicos_getvalue([["Set Zero-Crossing parameters"],["All surfaces must cross together"]],"Input size",list("vec",1),exprs); if (!ok) { @@ -21001,13 +21001,13 @@ function ZCROSS_f() { for (jj=1;jj<=this.in1;jj+=1) { kk = kk+2^(this.in1+jj-1); } - model.rpar = [[-ones(kk,1)],[zeros(2^(2*this.in1)-kk,1)]]; + this.model.rpar = [[-ones(kk,1)],[zeros(2^(2*this.in1)-kk,1)]]; graphics.exprs = exprs; - model.in1 = this.in1; - model.nzcross = this.in1; - model.firing = -1; + this.model.in1 = new ScilabDouble(this.in1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.firing = new ScilabDouble(-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/CLKFROM.js b/js/Branching/CLKFROM.js index 161e51d1..d94d654d 100644 --- a/js/Branching/CLKFROM.js +++ b/js/Branching/CLKFROM.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Branching/CLKFROM.sci" */ function CLKFROM() { CLKFROM.prototype.define = function CLKFROM() { - model = scicos_model(); - model.sim = "clkfrom"; - model.evtout = 1; - model.opar = list("A"); - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("clkfrom"); + this.model.evtout = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = "A"; - this.x = standard_define([2,1],model,exprs," "); + this.x = standard_define([2,1],this.model,exprs," "); this.x.graphics.id = "From"; return new BasicBlock(this.x); } @@ -25,23 +25,23 @@ function CLKFROM() { this.tag = arguments[0]["tag"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set block parameters","Tag",list("str",-1),exprs); if (!ok) { break; } - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } - model.opar = list(this.tag); - model.evtout = 1; - model.firing = -1; + this.model.opar = list(this.tag); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } needcompile = resume(needcompile) diff --git a/js/Branching/CLKFROM.pickle b/js/Branching/CLKFROM.pickle index d3c633ef..e687db34 100644 --- a/js/Branching/CLKFROM.pickle +++ b/js/Branching/CLKFROM.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -atp4 -Rp5 +aS'tag' +p4 +atp5 +Rp6 .(dp0 S'needcompile' p1 diff --git a/js/Branching/CLKGOTO.js b/js/Branching/CLKGOTO.js index 66dcb5f5..481d8644 100644 --- a/js/Branching/CLKGOTO.js +++ b/js/Branching/CLKGOTO.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/Branching/CLKGOTO.sci" */ function CLKGOTO() { 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 = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("clkgoto"); + this.model.evtin = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.ipar = new ScilabDouble(int(1)); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = [["A"],[sci2exp(1)]]; - this.x = standard_define([2,1],model,exprs," "); + this.x = standard_define([2,1],this.model,exprs," "); this.x.graphics.id = "Goto"; return new BasicBlock(this.x); } @@ -29,7 +29,7 @@ function CLKGOTO() { this.tagvis = parseFloat(arguments[0]["tagvis"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.tag,this.tagvis,exprs] = scicos_getvalue("Set block parameters",["Tag","Tag Visibility (1=Local 2=Scoped 3=Global)"],list("str",-1,"vec",1),exprs); @@ -42,17 +42,17 @@ function CLKGOTO() { } this.tagvis = int(this.tagvis); if (ok) { - if (((model.opar!=list(this.tag))||(model.ipar!=this.tagvis))) { + if (((this.model.opar!=list(this.tag))||(this.model.ipar!=this.tagvis))) { needcompile = 4; y = needcompile; } - model.opar = list(this.tag); - model.ipar = this.tagvis; - model.evtin = 1; - model.firing = -1; + this.model.opar = list(this.tag); + this.model.ipar = new ScilabDouble(this.tagvis); + this.model.evtin = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/CLKGOTO.pickle b/js/Branching/CLKGOTO.pickle index 5a2ae103..4edeac8a 100644 --- a/js/Branching/CLKGOTO.pickle +++ b/js/Branching/CLKGOTO.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -aS'tagvis' +aS'tag' p4 -atp5 -Rp6 +aS'tagvis' +p5 +atp6 +Rp7 .(dp0 S'needcompile' p1 diff --git a/js/Branching/CLKGotoTagVisibility.js b/js/Branching/CLKGotoTagVisibility.js index 89146bb1..9b0f0b3a 100644 --- a/js/Branching/CLKGotoTagVisibility.js +++ b/js/Branching/CLKGotoTagVisibility.js @@ -1,22 +1,22 @@ /* autogenerated from "macros/Branching/CLKGotoTagVisibility.sci" */ function CLKGotoTagVisibility() { CLKGotoTagVisibility.prototype.define = function CLKGotoTagVisibility() { - model = scicos_model(); - model.sim = "clkgototagvisibility"; - model.in1 = []; - model.in2 = []; - model.out = []; - model.out2 = []; - model.evtin = []; - model.intyp = 1; - model.outtyp = 1; - model.opar = list("A"); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("clkgototagvisibility"); + this.model.in1 = []; + this.model.in2 = []; + this.model.out = []; + this.model.out2 = []; + this.model.evtin = []; + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLKGotoTagVisibility.prototype.details = function CLKGotoTagVisibility() { @@ -33,21 +33,21 @@ function CLKGotoTagVisibility() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); + this.model.opar = list(this.tag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/CLKGotoTagVisibility.pickle b/js/Branching/CLKGotoTagVisibility.pickle index 79a3e1e2..b4869b90 100644 --- a/js/Branching/CLKGotoTagVisibility.pickle +++ b/js/Branching/CLKGotoTagVisibility.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -atp4 -Rp5 +aS'tag' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Branching/DEMUX.js b/js/Branching/DEMUX.js index 5e7565b7..ae6fcdd1 100644 --- a/js/Branching/DEMUX.js +++ b/js/Branching/DEMUX.js @@ -2,17 +2,17 @@ function DEMUX() { DEMUX.prototype.define = function DEMUX() { this.out = 2; - model = scicos_model(); - model.sim = list("multiplex",4); - model.in1 = 0; - model.out = -transpose([1:this.out]); - model.ipar = this.out; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("multiplex",4); + this.model.in1 = new ScilabDouble(0); + this.model.out = -transpose([1:this.out]); + this.model.ipar = new ScilabDouble(this.out); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; exprs = string(this.out); gr_i = []; - this.x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEMUX.prototype.details = function DEMUX() { @@ -29,7 +29,7 @@ function DEMUX() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("intvec",-1),exprs); if (!ok) { @@ -40,7 +40,7 @@ function DEMUX() { 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:this.out]),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,0,-transpose([1:this.out]),[],[]); } } else { if (size(this.out,"*")<2||or(this.out==0)||size(this.out,"*")>31) { @@ -52,7 +52,7 @@ function DEMUX() { } else { nin = sum(this.out); } - [model,graphics,ok] = check_io(model,graphics,nin,this.out.slice(),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,nin,this.out.slice(),[],[]); if (ok) { this.out = size(this.out,"*"); } @@ -60,9 +60,9 @@ function DEMUX() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.out; + this.model.ipar = new ScilabDouble(this.out); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/DEMUX.pickle b/js/Branching/DEMUX.pickle index 5d43b3b2..92ac3470 100644 --- a/js/Branching/DEMUX.pickle +++ b/js/Branching/DEMUX.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'out' +aS'model' p3 -atp4 -Rp5 +aS'out' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Branching/DEMUX_f.js b/js/Branching/DEMUX_f.js index 2338aaa1..425e2f90 100644 --- a/js/Branching/DEMUX_f.js +++ b/js/Branching/DEMUX_f.js @@ -2,17 +2,17 @@ function DEMUX_f() { DEMUX_f.prototype.define = function DEMUX_f() { this.out = 2; - model = scicos_model(); - model.sim = list("demux",1); - model.in1 = 0; - model.out = -transpose([1:this.out]); - model.ipar = this.out; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("demux",1); + this.model.in1 = new ScilabDouble(0); + this.model.out = -transpose([1:this.out]); + this.model.ipar = new ScilabDouble(this.out); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; exprs = string(this.out); gr_i = []; - this.x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEMUX_f.prototype.details = function DEMUX_f() { @@ -29,7 +29,7 @@ function DEMUX_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.out,exprs] = scicos_getvalue("Set DEMUX block parameters",["number of output ports or vector of sizes"],list("vec",-1),exprs); if (!ok) { @@ -40,7 +40,7 @@ function DEMUX_f() { 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:this.out]),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,0,-transpose([1:this.out]),[],[]); } } else { if (size(this.out,"*")<2||size(this.out,"*")>8||or(this.out==0)) { @@ -52,7 +52,7 @@ function DEMUX_f() { } else { nin = sum(this.out); } - [model,graphics,ok] = check_io(model,graphics,nin,this.out.slice(),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,nin,this.out.slice(),[],[]); if (ok) { this.out = size(this.out,"*"); } @@ -60,9 +60,9 @@ function DEMUX_f() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.out; + this.model.ipar = new ScilabDouble(this.out); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/DEMUX_f.pickle b/js/Branching/DEMUX_f.pickle index 5d43b3b2..92ac3470 100644 --- a/js/Branching/DEMUX_f.pickle +++ b/js/Branching/DEMUX_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'out' +aS'model' p3 -atp4 -Rp5 +aS'out' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Branching/ESELECT_f.js b/js/Branching/ESELECT_f.js index 4f68c633..9f72fae2 100644 --- a/js/Branching/ESELECT_f.js +++ b/js/Branching/ESELECT_f.js @@ -2,21 +2,21 @@ function ESELECT_f() { ESELECT_f.prototype.define = function ESELECT_f() { this.out = 2; - model = scicos_model(); - model.sim = list("eselect",-2); - model.in1 = 1; - model.in2 = 1; - model.intyp = -1; - model.evtin = 1; - model.evtout = ones(this.out,1); - model.blocktype = "l"; - model.firing = -ones(this.out,1); - model.dep_ut = [true,false]; - model.nmode = 0; - model.nzcross = 0; + this.model = scicos_model(); + this.model.sim = list("eselect",-2); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(ones(this.out,1)); + this.model.blocktype = new ScilabString("l"); + this.model.firing = new ScilabDouble(-ones(this.out,1)); + this.model.dep_ut = [true,false]; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); gr_i = []; - exprs = [[string(this.out)],[string(1)],[string(model.nmode)]]; - this.x = standard_define([4,2],model,exprs,gr_i); + exprs = [[string(this.out)],[string(1)],[string(this.model.nmode)]]; + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ESELECT_f.prototype.details = function ESELECT_f() { @@ -43,7 +43,7 @@ function ESELECT_f() { if (size(exprs,"*")==2) { exprs[3-1] = string(0); } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.out,this.inh,this.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) { @@ -61,15 +61,15 @@ function ESELECT_f() { if (this.out<2) { message("Block must have at least two output ports"); } else { - [model,graphics,ok] = check_io(model,graphics,1,[],this.inh,[ones(this.out,1)]); + [model,graphics,ok] = check_io(this.model,graphics,1,[],this.inh,[ones(this.out,1)]); if (ok) { graphics.exprs = exprs; - model.evtout = ones(this.out,1); - model.firing = -ones(this.out,1); + this.model.evtout = new ScilabDouble(ones(this.out,1)); + this.model.firing = new ScilabDouble(-ones(this.out,1)); this.x.graphics = graphics; - model.nmode = this.nmod; - model.nzcross = this.nmod; - this.x.model = model; + this.model.nmode = new ScilabDouble(this.nmod); + this.model.nzcross = new ScilabDouble(this.nmod); + this.x.model = this.model; break; } } diff --git a/js/Branching/ESELECT_f.pickle b/js/Branching/ESELECT_f.pickle index 072ff9e4..144d22f0 100644 --- a/js/Branching/ESELECT_f.pickle +++ b/js/Branching/ESELECT_f.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'inh' +aS'model' p3 -aS'nmod' +aS'inh' p4 -aS'out' +aS'nmod' p5 -atp6 -Rp7 +aS'out' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Branching/EXTRACTOR.js b/js/Branching/EXTRACTOR.js index c12592d9..c288817c 100644 --- a/js/Branching/EXTRACTOR.js +++ b/js/Branching/EXTRACTOR.js @@ -2,16 +2,16 @@ function EXTRACTOR() { EXTRACTOR.prototype.define = function EXTRACTOR() { this.ind = 1; - model = scicos_model(); - model.sim = list("extractor",4); - model.in1 = -1; - model.out = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - model.ipar = this.ind; + this.model = scicos_model(); + this.model.sim = list("extractor",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.model.ipar = new ScilabDouble(this.ind); exprs = [sci2exp(this.ind)]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXTRACTOR.prototype.details = function EXTRACTOR() { @@ -28,7 +28,7 @@ function EXTRACTOR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.ind,exprs] = scicos_getvalue("Set block parameters",["indices to extract"],list("vec",-1),exprs); if (!ok) { @@ -36,12 +36,12 @@ function EXTRACTOR() { } this.ind = int(this.ind); this.ind = this.ind.slice(); - [model,graphics,ok] = check_io(model,graphics,[-1],size(this.ind,1),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[-1],size(this.ind,1),[],[]); if (ok) { - model.ipar = this.ind; + this.model.ipar = this.ind; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/EXTRACTOR.pickle b/js/Branching/EXTRACTOR.pickle index 5f4e62f6..95e6c805 100644 --- a/js/Branching/EXTRACTOR.pickle +++ b/js/Branching/EXTRACTOR.pickle @@ -6,8 +6,10 @@ S'ind' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'[model,graphics,ok]' p1 diff --git a/js/Branching/FROM.js b/js/Branching/FROM.js index f3e50289..0fd7db4b 100644 --- a/js/Branching/FROM.js +++ b/js/Branching/FROM.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Branching/FROM.sci" */ function FROM() { FROM.prototype.define = function FROM() { - model = scicos_model(); - model.sim = "from"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = []; - model.opar = list("A"); - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("from"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = []; + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = ["A"]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.id = "From"; return new BasicBlock(this.x); } @@ -33,20 +33,20 @@ function FROM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - this.x.model = model; + this.model.opar = list(this.tag); + this.x.model = this.model; this.x.graphics = graphics; break; } diff --git a/js/Branching/FROM.pickle b/js/Branching/FROM.pickle index 2a9eb449..6d2190eb 100644 --- a/js/Branching/FROM.pickle +++ b/js/Branching/FROM.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -atp4 -Rp5 +aS'tag' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Branching/FROMMO.js b/js/Branching/FROMMO.js index e72205b8..0995e5cc 100644 --- a/js/Branching/FROMMO.js +++ b/js/Branching/FROMMO.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Branching/FROMMO.sci" */ function FROMMO() { FROMMO.prototype.define = function FROMMO() { - model = scicos_model(); - model.sim = "frommo"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = []; - model.opar = list("A"); - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("frommo"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = []; + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "frommo"; mo.outputs = "n"; exprs = ["A"]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); } @@ -36,20 +36,20 @@ function FROMMO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["Tag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - this.x.model = model; + this.model.opar = list(this.tag); + this.x.model = this.model; this.x.graphics = graphics; break; } diff --git a/js/Branching/FROMMO.pickle b/js/Branching/FROMMO.pickle index a7fc67ba..c6bd7bbd 100644 --- a/js/Branching/FROMMO.pickle +++ b/js/Branching/FROMMO.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -atp4 -Rp5 +aS'tag' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Branching/GOTO.js b/js/Branching/GOTO.js index 137b92df..9c9bca66 100644 --- a/js/Branching/GOTO.js +++ b/js/Branching/GOTO.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Branching/GOTO.sci" */ function GOTO() { GOTO.prototype.define = function GOTO() { - model = scicos_model(); - model.sim = "goto"; - model.in1 = -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 = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("goto"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(-1); + this.model.out = []; + this.model.out2 = []; + this.model.outtyp = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(int(1)); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [["A"],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.id = "Goto"; return new BasicBlock(this.x); } @@ -35,7 +35,7 @@ function GOTO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,this.tagvis,exprs] = scicos_getvalue("Set parameters",["Tag","Tag Visibility(1=Local 2=scoped 3= global)"],list("str",-1,"vec",1),exprs); if (!ok) { @@ -47,14 +47,14 @@ function GOTO() { ok = false; } if (ok) { - if (((model.ipar!=this.tagvis)||(model.opar!=list(this.tag)))) { + if (((this.model.ipar!=this.tagvis)||(this.model.opar!=list(this.tag)))) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - model.ipar = this.tagvis; - this.x.model = model; + this.model.opar = list(this.tag); + this.model.ipar = new ScilabDouble(this.tagvis); + this.x.model = this.model; this.x.graphics = graphics; arg1 = this.x; break; diff --git a/js/Branching/GOTO.pickle b/js/Branching/GOTO.pickle index 1b98e948..ecf6f7bb 100644 --- a/js/Branching/GOTO.pickle +++ b/js/Branching/GOTO.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -aS'tagvis' +aS'tag' p4 -atp5 -Rp6 +aS'tagvis' +p5 +atp6 +Rp7 .(dp0 S'tagvis' p1 diff --git a/js/Branching/GOTOMO.js b/js/Branching/GOTOMO.js index 037755d0..922112c4 100644 --- a/js/Branching/GOTOMO.js +++ b/js/Branching/GOTOMO.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Branching/GOTOMO.sci" */ function GOTOMO() { GOTOMO.prototype.define = function GOTOMO() { - model = scicos_model(); - model.sim = "gotomo"; - model.in1 = -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 = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gotomo"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = []; + this.model.out = []; + this.model.out2 = []; + this.model.outtyp = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(int(1)); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "gotomo"; mo.inputs = "p"; exprs = [["A"],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,1],model,exprs,gr_i); + this.x = standard_define([2,1],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); } @@ -38,7 +38,7 @@ function GOTOMO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,this.tagvis,exprs] = scicos_getvalue("Set parameters",["Tag","Tag Visibility(1=Local 2=scoped 3= global)"],list("str",-1,"vec",1),exprs); if (!ok) { @@ -50,14 +50,14 @@ function GOTOMO() { ok = false; } if (ok) { - if (((model.ipar!=this.tagvis)||(model.opar!=list(this.tag)))) { + if (((this.model.ipar!=this.tagvis)||(this.model.opar!=list(this.tag)))) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); - model.ipar = this.tagvis; - this.x.model = model; + this.model.opar = list(this.tag); + this.model.ipar = new ScilabDouble(this.tagvis); + this.x.model = this.model; this.x.graphics = graphics; arg1 = this.x; break; diff --git a/js/Branching/GOTOMO.pickle b/js/Branching/GOTOMO.pickle index 44de2d3b..03861f00 100644 --- a/js/Branching/GOTOMO.pickle +++ b/js/Branching/GOTOMO.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -aS'tagvis' +aS'tag' p4 -atp5 -Rp6 +aS'tagvis' +p5 +atp6 +Rp7 .(dp0 S'tagvis' p1 diff --git a/js/Branching/GotoTagVisibility.js b/js/Branching/GotoTagVisibility.js index f1f8b7f9..491bec8d 100644 --- a/js/Branching/GotoTagVisibility.js +++ b/js/Branching/GotoTagVisibility.js @@ -1,22 +1,22 @@ /* autogenerated from "macros/Branching/GotoTagVisibility.sci" */ function GotoTagVisibility() { GotoTagVisibility.prototype.define = function GotoTagVisibility() { - model = scicos_model(); - model.sim = "gototagvisibility"; - model.in1 = []; - model.in2 = []; - model.out = []; - model.out2 = []; - model.evtin = []; - model.intyp = 1; - model.outtyp = 1; - model.opar = list("A"); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gototagvisibility"); + this.model.in1 = []; + this.model.in2 = []; + this.model.out = []; + this.model.out2 = []; + this.model.evtin = []; + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GotoTagVisibility.prototype.details = function GotoTagVisibility() { @@ -33,21 +33,21 @@ function GotoTagVisibility() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); + this.model.opar = list(this.tag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/GotoTagVisibility.pickle b/js/Branching/GotoTagVisibility.pickle index 79a3e1e2..b4869b90 100644 --- a/js/Branching/GotoTagVisibility.pickle +++ b/js/Branching/GotoTagVisibility.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -atp4 -Rp5 +aS'tag' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Branching/GotoTagVisibilityMO.js b/js/Branching/GotoTagVisibilityMO.js index 3c8577b5..bd510468 100644 --- a/js/Branching/GotoTagVisibilityMO.js +++ b/js/Branching/GotoTagVisibilityMO.js @@ -1,22 +1,22 @@ /* autogenerated from "macros/Branching/GotoTagVisibilityMO.sci" */ function GotoTagVisibilityMO() { GotoTagVisibilityMO.prototype.define = function GotoTagVisibilityMO() { - model = scicos_model(); - model.sim = "gototagvisibilitymo"; - model.in1 = []; - model.in2 = []; - model.out = []; - model.out2 = []; - model.evtin = []; - model.intyp = 1; - model.outtyp = 1; - model.opar = list("A"); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gototagvisibilitymo"); + this.model.in1 = []; + this.model.in2 = []; + this.model.out = []; + this.model.out2 = []; + this.model.evtin = []; + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.opar = list("A"); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; exprs = "A"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GotoTagVisibilityMO.prototype.details = function GotoTagVisibilityMO() { @@ -33,21 +33,21 @@ function GotoTagVisibilityMO() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tag,exprs] = scicos_getvalue("Set parameters",["GotoTag"],list("str",-1),exprs); if (!ok) { break; } if (ok) { - if (model.opar!=list(this.tag)) { + if (this.model.opar!=list(this.tag)) { needcompile = 4; y = needcompile; } graphics.exprs = exprs; - model.opar = list(this.tag); + this.model.opar = list(this.tag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/GotoTagVisibilityMO.pickle b/js/Branching/GotoTagVisibilityMO.pickle index 79a3e1e2..b4869b90 100644 --- a/js/Branching/GotoTagVisibilityMO.pickle +++ b/js/Branching/GotoTagVisibilityMO.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'tag' +aS'model' p3 -atp4 -Rp5 +aS'tag' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Branching/ISELECT_f.js b/js/Branching/ISELECT_f.js index dec270a2..1d953eed 100644 --- a/js/Branching/ISELECT_f.js +++ b/js/Branching/ISELECT_f.js @@ -4,17 +4,17 @@ function ISELECT_f() { this.z0 = 0; out = [[-1],[-1]]; this.nout = 2; - model = scicos_model(); - model.sim = list("selector",2); - model.in1 = -1; - model.out = out; - model.evtin = ones(out); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector",2); + this.model.in1 = new ScilabDouble(-1); + this.model.out = out; + this.model.evtin = new ScilabDouble(ones(out)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nout)],[string(this.z0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ISELECT_f.prototype.details = function ISELECT_f() { @@ -33,7 +33,7 @@ function ISELECT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nout,this.z0,exprs] = scicos_getvalue("Set parameters",["number of outputs","initial connected output"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -42,12 +42,12 @@ function ISELECT_f() { if (this.z0>this.nout||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-1,-ones(this.nout,1),ones(this.nout,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,-ones(this.nout,1),ones(this.nout,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0-1; + this.model.dstate = new ScilabDouble(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/ISELECT_f.pickle b/js/Branching/ISELECT_f.pickle index 77d2410a..2ff73b61 100644 --- a/js/Branching/ISELECT_f.pickle +++ b/js/Branching/ISELECT_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -aS'nout' +aS'z0' p4 -atp5 -Rp6 +aS'nout' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Branching/ISELECT_m.js b/js/Branching/ISELECT_m.js index 0b4a226b..4a7a7852 100644 --- a/js/Branching/ISELECT_m.js +++ b/js/Branching/ISELECT_m.js @@ -3,26 +3,26 @@ function ISELECT_m() { ISELECT_m.prototype.define = function ISELECT_m() { this.z0 = 1; this.nout = 2; - model = scicos_model(); - model.sim = list("selector_m",4); - model.out = [[-1],[-1]]; - model.out2 = [[-2],[-2]]; - model.outtyp = 1; - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.evtout = []; - model.state = []; - model.rpar = []; - model.ipar = []; - model.firing = []; - model.evtin = ones(this.nout,1); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector_m",4); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-2],[-2]]; + this.model.outtyp = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.evtout = []; + this.model.state = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.firing = []; + this.model.evtin = new ScilabDouble(ones(this.nout,1)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(this.nout)],[sci2exp(this.z0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ISELECT_m.prototype.details = function ISELECT_m() { @@ -43,7 +43,7 @@ function ISELECT_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.typ,this.nout,this.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) { @@ -60,12 +60,12 @@ function ISELECT_m() { if (ok) { out = [-ones(this.nout,1),-2*ones(this.nout,1)]; in1 = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(this.nout,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.nout,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0; + this.model.dstate = new ScilabDouble(this.z0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/ISELECT_m.pickle b/js/Branching/ISELECT_m.pickle index 8d092c4a..ee1c723b 100644 --- a/js/Branching/ISELECT_m.pickle +++ b/js/Branching/ISELECT_m.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -aS'typ' +aS'z0' p4 -aS'nout' +aS'typ' p5 -atp6 -Rp7 +aS'nout' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/Branching/MUX.js b/js/Branching/MUX.js index 94582aaa..9c2fe761 100644 --- a/js/Branching/MUX.js +++ b/js/Branching/MUX.js @@ -2,16 +2,16 @@ function MUX() { MUX.prototype.define = function MUX() { this.in1 = 2; - model = scicos_model(); - model.sim = list("multiplex",4); - model.in1 = -transpose([1:this.in1]); - model.out = 0; - model.ipar = this.in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("multiplex",4); + this.model.in1 = -transpose([1:this.in1]); + this.model.out = new ScilabDouble(0); + this.model.ipar = new ScilabDouble(this.in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = string(this.in1); gr_i = []; - this.x = standard_define([.5,2],model,exprs,gr_i); + this.x = standard_define([.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MUX.prototype.details = function MUX() { @@ -27,7 +27,7 @@ function MUX() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("intvec",-1),exprs); if (!ok) { @@ -38,7 +38,7 @@ function MUX() { 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:this.in1]),0,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-transpose([1:this.in1]),0,[],[]); } } else { if (size(this.in1,"*")<2||or(this.in1==0)||size(this.in1,"*")>31) { @@ -50,7 +50,7 @@ function MUX() { } else { nout = sum(this.in1); } - [model,graphics,ok] = check_io(model,graphics,this.in1.slice(),nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.in1.slice(),nout,[],[]); if (ok) { this.in1 = size(this.in1,"*"); } @@ -58,9 +58,9 @@ function MUX() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.in1; + this.model.ipar = new ScilabDouble(this.in1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/MUX.pickle b/js/Branching/MUX.pickle index 0cab5c30..cfef69a4 100644 --- a/js/Branching/MUX.pickle +++ b/js/Branching/MUX.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'in1' +aS'model' p3 -atp4 -Rp5 +aS'in1' +p4 +atp5 +Rp6 .(dp0 S'[model,graphics,ok]' p1 diff --git a/js/Branching/MUX_f.js b/js/Branching/MUX_f.js index 1feace87..389b6e64 100644 --- a/js/Branching/MUX_f.js +++ b/js/Branching/MUX_f.js @@ -2,16 +2,16 @@ function MUX_f() { MUX_f.prototype.define = function MUX_f() { this.in1 = 2; - model = scicos_model(); - model.sim = list("mux",1); - model.in1 = -transpose([1:this.in1]); - model.out = 0; - model.ipar = this.in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mux",1); + this.model.in1 = -transpose([1:this.in1]); + this.model.out = new ScilabDouble(0); + this.model.ipar = new ScilabDouble(this.in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = string(this.in1); gr_i = []; - this.x = standard_define([0.5,2],model,exprs,gr_i); + this.x = standard_define([0.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MUX_f.prototype.details = function MUX_f() { @@ -27,7 +27,7 @@ function MUX_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("vec",-1),exprs); if (!ok) { @@ -38,7 +38,7 @@ function MUX_f() { 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:this.in1]),0,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-transpose([1:this.in1]),0,[],[]); } } else { if (size(this.in1,"*")<2||size(this.in1,"*")>8||or(this.in1==0)) { @@ -50,7 +50,7 @@ function MUX_f() { } else { nout = sum(this.in1); } - [model,graphics,ok] = check_io(model,graphics,this.in1.slice(),nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.in1.slice(),nout,[],[]); if (ok) { this.in1 = size(this.in1,"*"); } @@ -58,9 +58,9 @@ function MUX_f() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.in1; + this.model.ipar = new ScilabDouble(this.in1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/MUX_f.pickle b/js/Branching/MUX_f.pickle index 0cab5c30..cfef69a4 100644 --- a/js/Branching/MUX_f.pickle +++ b/js/Branching/MUX_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'in1' +aS'model' p3 -atp4 -Rp5 +aS'in1' +p4 +atp5 +Rp6 .(dp0 S'[model,graphics,ok]' p1 diff --git a/js/Branching/M_SWITCH.js b/js/Branching/M_SWITCH.js index f38c1991..dc5690e8 100644 --- a/js/Branching/M_SWITCH.js +++ b/js/Branching/M_SWITCH.js @@ -4,16 +4,16 @@ function M_SWITCH() { in1 = [[1],[-1],[-1]]; ipar = [[1],[3]]; this.nin = 2; - model = scicos_model(); - model.sim = list("mswitch",4); - model.in1 = in1; - model.out = -1; - model.ipar = ipar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mswitch",4); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = ipar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[string(ipar)]]; gr_i = []; - this.x = standard_define([2.5,2],model,exprs,gr_i); + this.x = standard_define([2.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } M_SWITCH.prototype.details = function M_SWITCH() { @@ -34,7 +34,7 @@ function M_SWITCH() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nin,this.base,this.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) { @@ -60,12 +60,12 @@ function M_SWITCH() { } it = [[-1],[-2*ones(this.nin,1)]]; ot = -2; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { graphics.exprs = exprs; - model.ipar = [[this.base],[this.rule]]; + this.model.ipar = [[this.base],[this.rule]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/M_SWITCH.pickle b/js/Branching/M_SWITCH.pickle index 7faf5b83..9dbe5728 100644 --- a/js/Branching/M_SWITCH.pickle +++ b/js/Branching/M_SWITCH.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'base' +aS'model' p3 -aS'nin' +aS'base' p4 -aS'rule' +aS'nin' p5 -atp6 -Rp7 +aS'rule' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Branching/NRMSOM_f.js b/js/Branching/NRMSOM_f.js index 72d5ea26..eee8baed 100644 --- a/js/Branching/NRMSOM_f.js +++ b/js/Branching/NRMSOM_f.js @@ -3,15 +3,15 @@ function NRMSOM_f() { NRMSOM_f.prototype.define = function NRMSOM_f() { in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = "junk"; - model.in1 = in1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("junk"); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string(this.nin)]; gr_i = []; - this.x = standard_define([.2,2],model,exprs,gr_i); + this.x = standard_define([.2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } NRMSOM_f.prototype.details = function NRMSOM_f() { @@ -28,17 +28,17 @@ function NRMSOM_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nin,exprs] = scicos_getvalue("Set parameters",["number of inputs"],list("vec",1),exprs); if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,[],[]); if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/NRMSOM_f.pickle b/js/Branching/NRMSOM_f.pickle index 2bcfc2d0..22db145e 100644 --- a/js/Branching/NRMSOM_f.pickle +++ b/js/Branching/NRMSOM_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'nin' +aS'model' p3 -atp4 -Rp5 +aS'nin' +p4 +atp5 +Rp6 .(dp0 S'[model,graphics,ok]' p1 diff --git a/js/Branching/RELAY_f.js b/js/Branching/RELAY_f.js index 53b3019b..f6e7f407 100644 --- a/js/Branching/RELAY_f.js +++ b/js/Branching/RELAY_f.js @@ -4,18 +4,18 @@ function RELAY_f() { i0 = 0; in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = list("relay",2); - model.in1 = in1; - model.out = -1; - model.evtin = ones(in1); - model.dstate = i0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,true]; + this.model = scicos_model(); + this.model.sim = list("relay",2); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(ones(in1)); + this.model.dstate = new ScilabDouble(i0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,true]; exprs = [[string(this.nin)],[string(i0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RELAY_f.prototype.details = function RELAY_f() { @@ -34,8 +34,8 @@ function RELAY_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; + this.model = arg1.model; + ipar = this.model.ipar; while (true) { [ok,this.nin,this.z0,exprs] = scicos_getvalue("Set parameters",["number of inputs","initial connected input"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -44,12 +44,12 @@ function RELAY_f() { if (this.z0>this.nin||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0-1; + this.model.dstate = new ScilabString(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/RELAY_f.pickle b/js/Branching/RELAY_f.pickle index 9b0e4396..cb033005 100644 --- a/js/Branching/RELAY_f.pickle +++ b/js/Branching/RELAY_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -aS'nin' +aS'z0' p4 -atp5 -Rp6 +aS'nin' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Branching/SCALAR2VECTOR.js b/js/Branching/SCALAR2VECTOR.js index 7167886d..60ef0c64 100644 --- a/js/Branching/SCALAR2VECTOR.js +++ b/js/Branching/SCALAR2VECTOR.js @@ -2,15 +2,15 @@ function SCALAR2VECTOR() { SCALAR2VECTOR.prototype.define = function SCALAR2VECTOR() { this.nout = -1; - model = scicos_model(); - model.sim = list("scalar2vector",4); - model.out = this.nout; - model.in1 = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("scalar2vector",4); + this.model.out = new ScilabDouble(this.nout); + this.model.in1 = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string([this.nout])]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SCALAR2VECTOR.prototype.details = function SCALAR2VECTOR() { @@ -27,7 +27,7 @@ function SCALAR2VECTOR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nout,exprs] = scicos_getvalue("Set block parameters",["size of output (-1: if don\'t know)"],list("vec",1),exprs); if (!ok) { @@ -39,12 +39,12 @@ function SCALAR2VECTOR() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[1],this.nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[1],this.nout,[],[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/SCALAR2VECTOR.pickle b/js/Branching/SCALAR2VECTOR.pickle index 4e1ae1ca..9443cd1e 100644 --- a/js/Branching/SCALAR2VECTOR.pickle +++ b/js/Branching/SCALAR2VECTOR.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'nout' +aS'model' p3 -atp4 -Rp5 +aS'nout' +p4 +atp5 +Rp6 .(dp0 S'[model,graphics,ok]' p1 diff --git a/js/Branching/SELECT_f.js b/js/Branching/SELECT_f.js index 4fc32b71..9ccb7401 100644 --- a/js/Branching/SELECT_f.js +++ b/js/Branching/SELECT_f.js @@ -4,17 +4,17 @@ function SELECT_f() { this.z0 = 0; in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = list("selector",2); - model.in1 = in1; - model.out = -1; - model.evtin = ones(in1); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector",2); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(ones(in1)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[string(this.z0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SELECT_f.prototype.details = function SELECT_f() { @@ -33,7 +33,7 @@ function SELECT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nin,this.z0,exprs] = scicos_getvalue("Set parameters",["number of inputs","initial connected input"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -42,12 +42,12 @@ function SELECT_f() { if (this.z0>this.nin||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,ones(this.nin,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0-1; + this.model.dstate = new ScilabDouble(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/SELECT_f.pickle b/js/Branching/SELECT_f.pickle index 7e86c06c..3520f25c 100644 --- a/js/Branching/SELECT_f.pickle +++ b/js/Branching/SELECT_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -aS'nin' +aS'z0' p4 -atp5 -Rp6 +aS'nin' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Branching/SELECT_m.js b/js/Branching/SELECT_m.js index 70c29d24..df5efac0 100644 --- a/js/Branching/SELECT_m.js +++ b/js/Branching/SELECT_m.js @@ -3,26 +3,26 @@ function SELECT_m() { SELECT_m.prototype.define = function SELECT_m() { this.z0 = 1; this.nin = 2; - model = scicos_model(); - model.sim = list("selector_m",4); - model.in1 = [[-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(this.nin,1); - model.dstate = this.z0; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("selector_m",4); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[-2],[-2]]; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtout = []; + this.model.state = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.firing = []; + this.model.evtin = new ScilabDouble(ones(this.nin,1)); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(this.nin)],[sci2exp(this.z0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SELECT_m.prototype.details = function SELECT_m() { @@ -43,7 +43,7 @@ function SELECT_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.typ,this.nin,this.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) { @@ -60,12 +60,12 @@ function SELECT_m() { if (ok) { in1 = [-ones(this.nin,1),-2*ones(this.nin,1)]; out = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(this.nin,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.nin,1),[]); if (ok) { graphics.exprs = exprs; - model.dstate = this.z0; + this.model.dstate = new ScilabDouble(this.z0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/SELECT_m.pickle b/js/Branching/SELECT_m.pickle index 37fe7154..5a45a1c4 100644 --- a/js/Branching/SELECT_m.pickle +++ b/js/Branching/SELECT_m.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -aS'typ' +aS'z0' p4 -aS'nin' +aS'typ' p5 -atp6 -Rp7 +aS'nin' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/Branching/SWITCH2.js b/js/Branching/SWITCH2.js index 4054ef85..d493aba9 100644 --- a/js/Branching/SWITCH2.js +++ b/js/Branching/SWITCH2.js @@ -5,19 +5,19 @@ function SWITCH2() { ipar = [0]; this.nzz = 1; rpar = 0; - model = scicos_model(); - model.sim = list("switch2",4); - model.in1 = in1; - model.out = -1; - model.ipar = ipar; - model.rpar = rpar; - model.nzcross = this.nzz; - model.nmode = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("switch2",4); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.model.nzcross = new ScilabDouble(this.nzz); + this.model.nmode = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(ipar)],[string(rpar)],[string(this.nzz)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SWITCH2.prototype.details = function SWITCH2() { @@ -38,7 +38,7 @@ function SWITCH2() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.rule,this.thra,this.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) { @@ -52,17 +52,17 @@ function SWITCH2() { this.rule = 2; } graphics.exprs = exprs; - model.ipar = this.rule; - model.rpar = this.thra; + this.model.ipar = new ScilabDouble(this.rule); + this.model.rpar = new ScilabDouble(this.thra); if (this.nzz!=0) { - model.nmode = 1; - model.nzcross = 1; + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Branching/SWITCH2.pickle b/js/Branching/SWITCH2.pickle index bfc98b77..54545311 100644 --- a/js/Branching/SWITCH2.pickle +++ b/js/Branching/SWITCH2.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'nzz' +aS'model' p3 -aS'rule' +aS'nzz' p4 -aS'thra' +aS'rule' p5 -atp6 -Rp7 +aS'thra' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Branching/SWITCH2_m.js b/js/Branching/SWITCH2_m.js index 6797c0b8..b43d42fd 100644 --- a/js/Branching/SWITCH2_m.js +++ b/js/Branching/SWITCH2_m.js @@ -4,23 +4,23 @@ function SWITCH2_m() { ipar = [0]; this.nzz = 1; rpar = 0; - model = scicos_model(); - model.sim = list("switch2_m",4); - model.in1 = [[-1],[1],[-1]]; - model.in2 = [[-2],[1],[-2]]; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = 1; - model.ipar = ipar; - model.rpar = rpar; - model.nzcross = this.nzz; - model.nmode = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("switch2_m",4); + this.model.in1 = [[-1],[1],[-1]]; + this.model.in2 = [[-2],[1],[-2]]; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.model.nzcross = new ScilabDouble(this.nzz); + this.model.nmode = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[string(ipar)],[string(rpar)],[string(this.nzz)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SWITCH2_m.prototype.details = function SWITCH2_m() { @@ -43,7 +43,7 @@ function SWITCH2_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.ot,this.rule,this.thra,this.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) { @@ -57,14 +57,14 @@ function SWITCH2_m() { this.rule = 2; } graphics.exprs = exprs; - model.ipar = this.rule; - model.rpar = this.thra; + this.model.ipar = new ScilabDouble(this.rule); + this.model.rpar = new ScilabDouble(this.thra); if (this.nzz!=0) { - model.nmode = 1; - model.nzcross = 1; + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } if (((this.ot<1)||(this.ot>8))&&(this.ot!=-1)) { message("Datatype is not supported"); @@ -74,13 +74,13 @@ function SWITCH2_m() { it[1-1] = this.ot; it[2-1] = 1; it[3-1] = this.ot; - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,this.ot),[],[]); + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,this.ot),[],[]); } if (ok) { this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/SWITCH2_m.pickle b/js/Branching/SWITCH2_m.pickle index 8c6b19b3..148e8e03 100644 --- a/js/Branching/SWITCH2_m.pickle +++ b/js/Branching/SWITCH2_m.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'nzz' p2 -aS'ot' +aS'rule' p3 -aS'nzz' +aS'thra' p4 -aS'rule' +aS'x' p5 -aS'thra' +aS'model' p6 -atp7 -Rp8 +aS'ot' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Branching/SWITCH_f.js b/js/Branching/SWITCH_f.js index 47b4f087..3e3a58c5 100644 --- a/js/Branching/SWITCH_f.js +++ b/js/Branching/SWITCH_f.js @@ -4,17 +4,17 @@ function SWITCH_f() { i0 = 0; in1 = [[-1],[-1]]; this.nin = 2; - model = scicos_model(); - model.sim = list("switchn",2); - model.in1 = in1; - model.out = -1; - model.ipar = i0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,true]; + this.model = scicos_model(); + this.model.sim = list("switchn",2); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = new ScilabDouble(i0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,true]; exprs = [[string(this.nin)],[string(i0+1)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SWITCH_f.prototype.details = function SWITCH_f() { @@ -33,8 +33,8 @@ function SWITCH_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; + this.model = arg1.model; + ipar = this.model.ipar; while (true) { [ok,this.nin,this.z0,exprs] = scicos_getvalue("Set switch parameters",["number of inputs","connected input"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -43,12 +43,12 @@ function SWITCH_f() { if (this.z0>this.nin||this.z0<=0) { message("initial connected input is not a valid input port number"); } else { - [model,graphics,ok] = check_io(model,graphics,-ones(this.nin,1),-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-ones(this.nin,1),-1,[],[]); if (ok) { graphics.exprs = exprs; - model.ipar = this.z0-1; + this.model.ipar = new ScilabString(this.z0-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Branching/SWITCH_f.pickle b/js/Branching/SWITCH_f.pickle index d1c178ee..68fdc9ce 100644 --- a/js/Branching/SWITCH_f.pickle +++ b/js/Branching/SWITCH_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -aS'nin' +aS'z0' p4 -atp5 -Rp6 +aS'nin' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/Electrical/CCS.js b/js/Electrical/CCS.js index 6754b973..2278d75e 100644 --- a/js/Electrical/CCS.js +++ b/js/Electrical/CCS.js @@ -4,7 +4,7 @@ function CCS() { ModelName = "CCS"; PrametersValue = []; ParametersName = []; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function CCS() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = []; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2.1,3],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2.1,3],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -61,7 +61,7 @@ function CCS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); } diff --git a/js/Electrical/CCS.pickle b/js/Electrical/CCS.pickle index e3c95720..e284307b 100644 --- a/js/Electrical/CCS.pickle +++ b/js/Electrical/CCS.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/Electrical/CVS.js b/js/Electrical/CVS.js index 59ffbd03..612038a5 100644 --- a/js/Electrical/CVS.js +++ b/js/Electrical/CVS.js @@ -4,7 +4,7 @@ function CVS() { ModelName = "CVS"; PrametersValue = []; ParametersName = []; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function CVS() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = []; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2.1,3],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2.1,3],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -61,7 +61,7 @@ function CVS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); } diff --git a/js/Electrical/CVS.pickle b/js/Electrical/CVS.pickle index e3c95720..e284307b 100644 --- a/js/Electrical/CVS.pickle +++ b/js/Electrical/CVS.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/Electrical/Capacitor.js b/js/Electrical/Capacitor.js index c2d112a7..50314eeb 100644 --- a/js/Electrical/Capacitor.js +++ b/js/Electrical/Capacitor.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Electrical/Capacitor.sci" */ function Capacitor() { Capacitor.prototype.define = function Capacitor() { - model = scicos_model(); + this.model = scicos_model(); this.C = 0.01; this.v = 0; - model.rpar = [[this.C],[this.v]]; - model.sim = "Capacitor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.C],[this.v]]; + this.model.sim = new ScilabString("Capacitor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Capacitor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list(["C","v"],list(this.C,this.v),[0,1]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = string([[this.C],[this.v]]); gr_i = []; - this.x = standard_define([2,1.1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1.1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -39,17 +39,17 @@ function Capacitor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,this.v,exprs] = scicos_getvalue("Set Capacitor block parameter",["C (F)","Initial Voltage"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = this.C; - model.equations.parameters[2-1] = list(this.C,this.v); + this.model.rpar = new ScilabDouble(this.C); + this.model.equations.parameters[('2', 'double')] = list(this.C,this.v); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Capacitor.pickle b/js/Electrical/Capacitor.pickle index f4f7f5eb..2b240ad5 100644 --- a/js/Electrical/Capacitor.pickle +++ b/js/Electrical/Capacitor.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'C' +aS'model' p3 -aS'v' +aS'C' p4 -atp5 -Rp6 +aS'v' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 @@ -31,9 +33,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -74,15 +76,15 @@ g5 sS'mo' p25 g2 -sS'model.dep_ut' +sS'x.graphics' p26 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p27 g13 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p28 -g5 +g13 sS'gr_i' p29 g13 diff --git a/js/Electrical/ConstantVoltage.js b/js/Electrical/ConstantVoltage.js index afb791b1..cd1c4d24 100644 --- a/js/Electrical/ConstantVoltage.js +++ b/js/Electrical/ConstantVoltage.js @@ -2,22 +2,22 @@ function ConstantVoltage() { ConstantVoltage.prototype.define = function ConstantVoltage() { this.V = 0.01; - model = scicos_model(); - model.rpar = this.V; - model.in1 = 1; - model.out = 1; - model.sim = "ConstantVoltage"; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.rpar = new ScilabDouble(this.V); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.sim = new ScilabString("ConstantVoltage"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "ConstantVoltage"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("V",list(this.V)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string(this.V); gr_i = []; - this.x = standard_define([1.5,1.1],model,exprs,list(gr_i,0)); + this.x = standard_define([1.5,1.1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -35,17 +35,17 @@ function ConstantVoltage() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.V,exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.V; - model.equations.parameters[2-1] = list(this.V); + this.model.rpar = new ScilabDouble(this.V); + this.model.equations.parameters[('2', 'double')] = list(this.V); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/ConstantVoltage.pickle b/js/Electrical/ConstantVoltage.pickle index 3f44287b..47de459a 100644 --- a/js/Electrical/ConstantVoltage.pickle +++ b/js/Electrical/ConstantVoltage.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'V' +aS'model' p3 -atp4 -Rp5 +aS'V' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 @@ -28,9 +30,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -71,15 +73,15 @@ g5 sS'mo' p24 g8 -sS'model.dep_ut' +sS'x.graphics' p25 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p26 g13 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p27 -g5 +g13 sS'gr_i' p28 g13 diff --git a/js/Electrical/CurrentSensor.js b/js/Electrical/CurrentSensor.js index e5beda39..2736b21f 100644 --- a/js/Electrical/CurrentSensor.js +++ b/js/Electrical/CurrentSensor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/CurrentSensor.sci" */ function CurrentSensor() { CurrentSensor.prototype.define = function CurrentSensor() { - model = scicos_model(); - model.in1 = 1; - model.out = [[1],[1]]; - model.sim = "CurrentSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.sim = new ScilabString("CurrentSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "CurrentSensor"; mo.inputs = "p"; mo.outputs = [["n"],["i"]]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new BasicBlock(this.x); diff --git a/js/Electrical/CurrentSensor.pickle b/js/Electrical/CurrentSensor.pickle index a76e4523..13759532 100644 --- a/js/Electrical/CurrentSensor.pickle +++ b/js/Electrical/CurrentSensor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Diode.js b/js/Electrical/Diode.js index 07c96fcc..318a1d5e 100644 --- a/js/Electrical/Diode.js +++ b/js/Electrical/Diode.js @@ -5,22 +5,22 @@ function Diode() { this.Vt = 0.04; this.Maxexp = 15; this.R = 1.e8; - model = scicos_model(); - model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; - model.in1 = 1; - model.out = 1; - model.sim = "Diode"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.sim = new ScilabString("Diode"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Diode"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string([[this.Ids],[this.Vt],[this.Maxexp],[this.R]]); gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -45,17 +45,17 @@ function Diode() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Ids,this.Vt,this.Maxexp,this.R,exprs] = scicos_getvalue("Set Diode block parameter",["Saturation cuurent (A)","Voltage equivalent to temperature (Volt)","Max exponent for linear continuation","R (ohm)"],list("vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; - model.equations.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); + this.model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; + this.model.equations.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Diode.pickle b/js/Electrical/Diode.pickle index 87390e96..f4ea0109 100644 --- a/js/Electrical/Diode.pickle +++ b/js/Electrical/Diode.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'Ids' p2 -aS'R' +aS'Maxexp' p3 -aS'Vt' +aS'R' p4 -aS'Ids' +aS'Vt' p5 -aS'Maxexp' +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Electrical/Ground.js b/js/Electrical/Ground.js index 4818f2da..3703cb30 100644 --- a/js/Electrical/Ground.js +++ b/js/Electrical/Ground.js @@ -1,19 +1,19 @@ /* autogenerated from "macros/Electrical/Ground.sci" */ function Ground() { Ground.prototype.define = function Ground() { - model = scicos_model(); - model.in1 = [1]; - model.out = []; - model.sim = "Ground"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = []; + this.model.sim = new ScilabString("Ground"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Ground"; mo.inputs = "p"; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = ""; gr_i = []; - this.x = standard_define([1,1],model,exprs,list(gr_i,0)); + this.x = standard_define([1,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new GroundBlock(this.x); diff --git a/js/Electrical/Ground.pickle b/js/Electrical/Ground.pickle index c84cf52a..4ffcd0a3 100644 --- a/js/Electrical/Ground.pickle +++ b/js/Electrical/Ground.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Gyrator.js b/js/Electrical/Gyrator.js index 988d2f0c..54f316eb 100644 --- a/js/Electrical/Gyrator.js +++ b/js/Electrical/Gyrator.js @@ -4,7 +4,7 @@ function Gyrator() { ModelName = "Gyrator"; PrametersValue = [[1],[1]]; ParametersName = [["G1"],["G2"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function Gyrator() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["1"],["1"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -65,7 +65,7 @@ function Gyrator() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/Gyrator.pickle b/js/Electrical/Gyrator.pickle index 8a6c5e65..eb017481 100644 --- a/js/Electrical/Gyrator.pickle +++ b/js/Electrical/Gyrator.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'G2' +aS'model' p3 -aS'G1' +aS'G2' p4 -atp5 -Rp6 +aS'G1' +p5 +atp6 +Rp7 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/IdealTransformer.js b/js/Electrical/IdealTransformer.js index 0eb36484..3279b603 100644 --- a/js/Electrical/IdealTransformer.js +++ b/js/Electrical/IdealTransformer.js @@ -4,7 +4,7 @@ function IdealTransformer() { ModelName = "IdealTransformer"; PrametersValue = [1]; ParametersName = ["N"]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function IdealTransformer() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = ["1"]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -63,7 +63,7 @@ function IdealTransformer() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/IdealTransformer.pickle b/js/Electrical/IdealTransformer.pickle index 80b6afcb..9afd07bb 100644 --- a/js/Electrical/IdealTransformer.pickle +++ b/js/Electrical/IdealTransformer.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'N' +aS'model' p3 -atp4 -Rp5 +aS'N' +p4 +atp5 +Rp6 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/Inductor.js b/js/Electrical/Inductor.js index f7452810..545ff3b0 100644 --- a/js/Electrical/Inductor.js +++ b/js/Electrical/Inductor.js @@ -1,23 +1,23 @@ /* autogenerated from "macros/Electrical/Inductor.sci" */ function Inductor() { Inductor.prototype.define = function Inductor() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.L = 1.e-5; - model.rpar = this.L; - model.sim = "Inductor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(this.L); + this.model.sim = new ScilabString("Inductor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Inductor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("L",list(this.L)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string(this.L); gr_i = []; - this.x = standard_define([2,0.9],model,exprs,list(gr_i,0)); + this.x = standard_define([2,0.9],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -35,17 +35,17 @@ function Inductor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.L,exprs] = scicos_getvalue("Set Inductor block parameter","L (H)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.L; - model.equations.parameters[2-1] = list(this.L); + this.model.rpar = new ScilabDouble(this.L); + this.model.equations.parameters[('2', 'double')] = list(this.L); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Inductor.pickle b/js/Electrical/Inductor.pickle index 7877e5f2..b199a360 100644 --- a/js/Electrical/Inductor.pickle +++ b/js/Electrical/Inductor.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'L' +aS'model' p3 -atp4 -Rp5 +aS'L' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 @@ -29,9 +31,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -71,15 +73,15 @@ g5 sS'mo' p24 g16 -sS'model.dep_ut' +sS'x.graphics' p25 -g8 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p26 g8 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p27 -g5 +g8 sS'gr_i' p28 g8 diff --git a/js/Electrical/MOTOR.js b/js/Electrical/MOTOR.js index c5b1a2c3..967936fb 100644 --- a/js/Electrical/MOTOR.js +++ b/js/Electrical/MOTOR.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Electrical/MOTOR.sci" */ function MOTOR() { MOTOR.prototype.define = function MOTOR() { - model = scicos_model(); - model.out = [[1],[1]]; - model.in1 = [1]; - model.sim = "motor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.out = [[1],[1]]; + this.model.in1 = [1]; + this.model.sim = new ScilabString("motor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; exprs = ""; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.out_implicit = [["I"],["I"]]; this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); diff --git a/js/Electrical/MOTOR.pickle b/js/Electrical/MOTOR.pickle index 9a3a7caa..a1c0ad46 100644 --- a/js/Electrical/MOTOR.pickle +++ b/js/Electrical/MOTOR.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/NMOS.js b/js/Electrical/NMOS.js index 06efb39c..a85923f3 100644 --- a/js/Electrical/NMOS.js +++ b/js/Electrical/NMOS.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Electrical/NMOS.sci" */ function NMOS() { NMOS.prototype.define = function NMOS() { - model = scicos_model(); + this.model = scicos_model(); this.W = 20.e-6; this.L = 6.e-6; this.Beta = 0.041e-3; @@ -11,20 +11,20 @@ function NMOS() { this.dW = -2.5e-6; this.dL = -1.5e-6; this.RDS = 1.e+7; - model.sim = "NMOS"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("NMOS"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "NMOS"; mo.outputs = [["D"],["B"],["S"]]; mo.inputs = "G"; mo.parameters = list([["W"],["L"],["Beta"],["Vt"],["K2"],["K5"],["dW"],["dL"],["RDS"]],[[this.W],[this.L],[this.Beta],[this.Vt],[this.K2],[this.K5],[this.dW],[this.dL],[this.RDS]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -59,16 +59,16 @@ function NMOS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set NMOS Transistor block parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); + this.model.equations.parameters[('2', 'double')] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/NMOS.pickle b/js/Electrical/NMOS.pickle index 3c7082ed..f0d4356c 100644 --- a/js/Electrical/NMOS.pickle +++ b/js/Electrical/NMOS.pickle @@ -22,8 +22,10 @@ aS'dW' p10 aS'x' p11 -atp12 -Rp13 +aS'model' +p12 +atp13 +Rp14 .(dp0 S'arg1' p1 @@ -51,38 +53,38 @@ g7 sS'model.in1' p11 g7 -sS'x.graphics' +sS'exprs' p12 -g2 -sS'mo.inputs' +S'matrix' p13 +sS'mo.inputs' +p14 g5 sS'Beta' -p14 +p15 g7 sS'x.graphics.in_implicit' -p15 -S'vector' p16 -sS'mo.parameters' +S'vector' p17 -g16 -sS'model.sim' +sS'mo.parameters' p18 +g17 +sS'model.sim' +p19 g5 sS'model.equations' -p19 +p20 g7 sS'RDS' -p20 +p21 g7 sS'mo.outputs' -p21 -S'matrix' p22 +g13 sS'x.graphics.out_implicit' p23 -g22 +g13 sS'L' p24 g7 @@ -93,7 +95,7 @@ sS'graphics.exprs' p26 NsS'typ' p27 -g16 +g17 sS'dW' p28 g7 @@ -106,24 +108,24 @@ g5 sS'mo' p31 g2 -sS'model.dep_ut' +sS'x.graphics' p32 -g16 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p33 -g16 -sS'exprs' +g17 +sS"model.equations.parameters[('2', 'double')]" p34 -g22 +g17 sS'gr_i' p35 -g16 +g17 sS'Vt' p36 g7 sS'y' p37 -g16 +g17 sS'x' p38 g7 diff --git a/js/Electrical/NPN.js b/js/Electrical/NPN.js index e8f8d167..9f7544db 100644 --- a/js/Electrical/NPN.js +++ b/js/Electrical/NPN.js @@ -4,7 +4,7 @@ function NPN() { ModelName = "NPN"; PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function NPN() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -95,7 +95,7 @@ function NPN() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/NPN.pickle b/js/Electrical/NPN.pickle index 16e61485..9363c864 100644 --- a/js/Electrical/NPN.pickle +++ b/js/Electrical/NPN.pickle @@ -38,8 +38,10 @@ aS'EMinMax' p18 aS'x' p19 -atp20 -Rp21 +aS'model' +p20 +atp21 +Rp22 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/OpAmp.js b/js/Electrical/OpAmp.js index df6e5e00..00935c08 100644 --- a/js/Electrical/OpAmp.js +++ b/js/Electrical/OpAmp.js @@ -3,22 +3,22 @@ function OpAmp() { OpAmp.prototype.define = function OpAmp() { S = []; Z = []; - model = scicos_model(); - model.sim = "OpAmp"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("OpAmp"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); - mo.model = model.sim; + mo.model = this.model.sim; mo.inputs = [["in_p"],["in_n"]]; mo.outputs = ["out"]; mo.parameters = list(S,Z); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - model.rpar = Z; + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.model.rpar = Z; exprs = string(Z); gr_i = []; - this.x = standard_define([3,5],model,exprs,gr_i); + this.x = standard_define([3,5],this.model,exprs,gr_i); this.x.graphics.in_implicit = [["I"],["I"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -41,16 +41,16 @@ function OpAmp() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (false) { [ok,this.OLGain,this.SatH,this.SatL,exprs] = scicos_getvalue("Set the Operational Amplifier parameters",["Open Loop Gain","Positive saturation voltage","Negative saturation voltage"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.OLGain,this.SatH,this.SatL); + this.model.equations.parameters[('2', 'double')] = list(this.OLGain,this.SatH,this.SatL); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/OpAmp.pickle b/js/Electrical/OpAmp.pickle index c1058a70..6f195636 100644 --- a/js/Electrical/OpAmp.pickle +++ b/js/Electrical/OpAmp.pickle @@ -6,12 +6,14 @@ S'SatH' p2 aS'x' p3 -aS'OLGain' +aS'model' p4 aS'SatL' p5 -atp6 -Rp7 +aS'OLGain' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 @@ -33,9 +35,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 S'matrix' @@ -79,15 +81,15 @@ g5 sS'mo' p26 g2 -sS'model.dep_ut' +sS'x.graphics' p27 -g15 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p28 g15 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p29 -g5 +g15 sS'gr_i' p30 g15 diff --git a/js/Electrical/PMOS.js b/js/Electrical/PMOS.js index 4d2a2d7f..077514cd 100644 --- a/js/Electrical/PMOS.js +++ b/js/Electrical/PMOS.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Electrical/PMOS.sci" */ function PMOS() { PMOS.prototype.define = function PMOS() { - model = scicos_model(); + this.model = scicos_model(); this.W = 50.0e-6; this.L = 6.0e-6; this.Beta = 0.0105e-3; @@ -11,20 +11,20 @@ function PMOS() { this.dW = -2.5e-6; this.dL = -2.1e-6; this.RDS = 1.e+7; - model.sim = "PMOS"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("PMOS"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PMOS"; mo.outputs = [["D"],["B"],["S"]]; mo.inputs = "G"; mo.parameters = list([["W"],["L"],["Beta"],["Vt"],["K2"],["K5"],["dW"],["dL"],["RDS"]],[[this.W],[this.L],[this.Beta],[this.Vt],[this.K2],[this.K5],[this.dW],[this.dL],[this.RDS]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -59,16 +59,16 @@ function PMOS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set PMOS Transistor parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); + this.model.equations.parameters[('2', 'double')] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/PMOS.pickle b/js/Electrical/PMOS.pickle index 3c7082ed..f0d4356c 100644 --- a/js/Electrical/PMOS.pickle +++ b/js/Electrical/PMOS.pickle @@ -22,8 +22,10 @@ aS'dW' p10 aS'x' p11 -atp12 -Rp13 +aS'model' +p12 +atp13 +Rp14 .(dp0 S'arg1' p1 @@ -51,38 +53,38 @@ g7 sS'model.in1' p11 g7 -sS'x.graphics' +sS'exprs' p12 -g2 -sS'mo.inputs' +S'matrix' p13 +sS'mo.inputs' +p14 g5 sS'Beta' -p14 +p15 g7 sS'x.graphics.in_implicit' -p15 -S'vector' p16 -sS'mo.parameters' +S'vector' p17 -g16 -sS'model.sim' +sS'mo.parameters' p18 +g17 +sS'model.sim' +p19 g5 sS'model.equations' -p19 +p20 g7 sS'RDS' -p20 +p21 g7 sS'mo.outputs' -p21 -S'matrix' p22 +g13 sS'x.graphics.out_implicit' p23 -g22 +g13 sS'L' p24 g7 @@ -93,7 +95,7 @@ sS'graphics.exprs' p26 NsS'typ' p27 -g16 +g17 sS'dW' p28 g7 @@ -106,24 +108,24 @@ g5 sS'mo' p31 g2 -sS'model.dep_ut' +sS'x.graphics' p32 -g16 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p33 -g16 -sS'exprs' +g17 +sS"model.equations.parameters[('2', 'double')]" p34 -g22 +g17 sS'gr_i' p35 -g16 +g17 sS'Vt' p36 g7 sS'y' p37 -g16 +g17 sS'x' p38 g7 diff --git a/js/Electrical/PNP.js b/js/Electrical/PNP.js index ecb4cc99..836bf673 100644 --- a/js/Electrical/PNP.js +++ b/js/Electrical/PNP.js @@ -4,7 +4,7 @@ function PNP() { ModelName = "PNP"; PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function PNP() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -95,7 +95,7 @@ function PNP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/PNP.pickle b/js/Electrical/PNP.pickle index 16e61485..9363c864 100644 --- a/js/Electrical/PNP.pickle +++ b/js/Electrical/PNP.pickle @@ -38,8 +38,10 @@ aS'EMinMax' p18 aS'x' p19 -atp20 -Rp21 +aS'model' +p20 +atp21 +Rp22 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/PotentialSensor.js b/js/Electrical/PotentialSensor.js index 9ef7202b..98959cd1 100644 --- a/js/Electrical/PotentialSensor.js +++ b/js/Electrical/PotentialSensor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/PotentialSensor.sci" */ function PotentialSensor() { PotentialSensor.prototype.define = function PotentialSensor() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; - model.rpar = []; - model.sim = "PotentialSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; + this.model.rpar = []; + this.model.sim = new ScilabString("PotentialSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PotentialSensor"; mo.inputs = "p"; mo.outputs = ["v"]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); gr_i = []; - this.x = standard_define([2,2],model,"",list(gr_i,0)); + this.x = standard_define([2,2],this.model,"",list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["E"]; return new BasicBlock(this.x); diff --git a/js/Electrical/PotentialSensor.pickle b/js/Electrical/PotentialSensor.pickle index f97bffc2..5e42e801 100644 --- a/js/Electrical/PotentialSensor.pickle +++ b/js/Electrical/PotentialSensor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Resistor.js b/js/Electrical/Resistor.js index be2d95bf..b1e2354c 100644 --- a/js/Electrical/Resistor.js +++ b/js/Electrical/Resistor.js @@ -1,23 +1,23 @@ /* autogenerated from "macros/Electrical/Resistor.sci" */ function Resistor() { Resistor.prototype.define = function Resistor() { - model = scicos_model(); + this.model = scicos_model(); this.R = 0.01; - model.rpar = this.R; - model.sim = "resistor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(this.R); + this.model.sim = new ScilabString("resistor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Resistor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("R",list(this.R)); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = string(this.R); gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -35,17 +35,17 @@ function Resistor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.R,exprs] = scicos_getvalue("Set Resistor block parameter","R (ohm)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.R; - model.equations.parameters[2-1] = list(this.R); + this.model.rpar = new ScilabDouble(this.R); + this.model.equations.parameters[('2', 'double')] = list(this.R); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Resistor.pickle b/js/Electrical/Resistor.pickle index fa394c32..ee2c3eeb 100644 --- a/js/Electrical/Resistor.pickle +++ b/js/Electrical/Resistor.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'R' +aS'model' p3 -atp4 -Rp5 +aS'R' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 @@ -29,9 +31,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -71,15 +73,15 @@ g5 sS'mo' p24 g2 -sS'model.dep_ut' +sS'x.graphics' p25 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p26 g13 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p27 -g5 +g13 sS'gr_i' p28 g13 diff --git a/js/Electrical/SineVoltage.js b/js/Electrical/SineVoltage.js index cd36b471..4b6f5c2b 100644 --- a/js/Electrical/SineVoltage.js +++ b/js/Electrical/SineVoltage.js @@ -1,27 +1,27 @@ /* autogenerated from "macros/Electrical/SineVoltage.sci" */ function SineVoltage() { SineVoltage.prototype.define = function SineVoltage() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.V = 1; this.ph = 0; this.frq = 1; this.offset = 0; this.start = 0; - model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; - model.sim = "SineVoltage"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; + this.model.sim = new ScilabString("SineVoltage"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "SineVoltage"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list([["V"],["phase"],["freqHz"],["offset"],["startTime"]],list(this.V,this.ph,this.frq,this.offset,this.start)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [[string(this.V)],[string(this.ph)],[string(this.frq)],[string(this.offset)],[string(this.start)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -48,17 +48,17 @@ function SineVoltage() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.V,this.ph,this.frq,this.offset,this.start,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","phase (rad)","Frequency (Hz)","Voltageoffset (V)","Timeoffset (s)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; - model.equations.parameters[2-1] = list(this.V,this.ph,this.frq,this.offset,this.start); + this.model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; + this.model.equations.parameters[('2', 'double')] = list(this.V,this.ph,this.frq,this.offset,this.start); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/SineVoltage.pickle b/js/Electrical/SineVoltage.pickle index 8e37a926..0a6e8a72 100644 --- a/js/Electrical/SineVoltage.pickle +++ b/js/Electrical/SineVoltage.pickle @@ -12,10 +12,12 @@ aS'offset' p5 aS'x' p6 -aS'ph' +aS'model' p7 -atp8 -Rp9 +aS'ph' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 @@ -38,46 +40,46 @@ p9 sS'model.in1' p10 g9 -sS'x.graphics' +sS'exprs' p11 -g2 -sS'mo.inputs' +S'matrix' p12 +sS'mo.inputs' +p13 g6 sS'start' -p13 +p14 g4 sS'frq' -p14 +p15 g4 sS'x.graphics.in_implicit' -p15 +p16 g9 sS'ph' -p16 +p17 g4 sS'mo.parameters' -p17 +p18 g9 sS'model.sim' -p18 +p19 g6 sS'V' -p19 +p20 g4 sS'model.equations' -p20 +p21 g4 sS'mo.outputs' -p21 +p22 g6 sS'x.graphics.out_implicit' -p22 +p23 g9 sS'model.rpar' -p23 -S'matrix' p24 +g12 sS'graphics.exprs' p25 NsS'typ' @@ -89,15 +91,15 @@ g6 sS'graphics' p28 g2 -sS'model.dep_ut' +sS'x.graphics' p29 -g9 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p30 g9 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p31 -g24 +g9 sS'gr_i' p32 g9 diff --git a/js/Electrical/Switch.js b/js/Electrical/Switch.js index eff6b74e..3eafb101 100644 --- a/js/Electrical/Switch.js +++ b/js/Electrical/Switch.js @@ -1,26 +1,26 @@ /* autogenerated from "macros/Electrical/Switch.sci" */ function Switch() { Switch.prototype.define = function Switch() { - model = scicos_model(); + this.model = scicos_model(); this.Ron = 0.01; this.Roff = 1e5; S = [["Ron"],["Roff"]]; Z = eval(S); - model.sim = "Switch"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("Switch"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); - mo.model = model.sim; + mo.model = this.model.sim; mo.inputs = [["p"],["inp"]]; mo.outputs = "n"; mo.parameters = list(S,Z); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - model.rpar = Z; + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.model.rpar = new ScilabDouble(Z); exprs = string(Z); gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = [["I"],["E"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -41,16 +41,16 @@ function Switch() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Ron,this.Roff,exprs] = scicos_getvalue("Set non-ideal electrical switch parameters",["Resistance in On state (Ohm)","Resistance in Off state (Ohm)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.Ron,this.Roff); + this.model.equations.parameters[('2', 'double')] = list(this.Ron,this.Roff); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Switch.pickle b/js/Electrical/Switch.pickle index aa8da9b7..7c389ff0 100644 --- a/js/Electrical/Switch.pickle +++ b/js/Electrical/Switch.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'Roff' +aS'model' p3 -aS'Ron' +aS'Roff' p4 -atp5 -Rp6 +aS'Ron' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 @@ -31,9 +33,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 S'matrix' @@ -83,15 +85,15 @@ g8 sS'mo' p28 g2 -sS'model.dep_ut' +sS'x.graphics' p29 -g15 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p30 g15 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p31 -g5 +g15 sS'gr_i' p32 g15 diff --git a/js/Electrical/VVsourceAC.js b/js/Electrical/VVsourceAC.js index 228d84ac..d693c9e1 100644 --- a/js/Electrical/VVsourceAC.js +++ b/js/Electrical/VVsourceAC.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Electrical/VVsourceAC.sci" */ function VVsourceAC() { VVsourceAC.prototype.define = function VVsourceAC() { - model = scicos_model(); - model.in1 = [[1],[1]]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [[1],[1]]; + this.model.out = [1]; VA = 220; this.FR = 50; - model.rpar = [this.FR]; - model.sim = "VVsourceAC"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [this.FR]; + this.model.sim = new ScilabString("VVsourceAC"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VVsourceAC"; mo.inputs = ["p","VA"]; mo.outputs = "n"; mo.parameters = list(["f"],list(this.FR)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [string(this.FR)]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -37,17 +37,17 @@ function VVsourceAC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Frequency (Hz)"],list("vec",-1),exprs); if (!ok) { break; } - model.rpar = [this.FR]; - model.equations.parameters[2-1] = list(this.FR); + this.model.rpar = [this.FR]; + this.model.equations.parameters[('2', 'double')] = list(this.FR); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/VVsourceAC.pickle b/js/Electrical/VVsourceAC.pickle index 09f887d5..92fec777 100644 --- a/js/Electrical/VVsourceAC.pickle +++ b/js/Electrical/VVsourceAC.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'FR' +aS'model' p3 -atp4 -Rp5 +aS'FR' +p4 +atp5 +Rp6 .(dp0 S'FR' p1 @@ -37,9 +39,9 @@ sS'model.in1' p12 S'matrix' p13 -sS'x.graphics' +sS'exprs' p14 -g6 +g11 sS'mo.inputs' p15 g11 @@ -75,13 +77,13 @@ g4 sS'mo' p26 g2 -sS'model.dep_ut' +sS'x.graphics' p27 -g11 -sS'model.equations.parameters[2-1]' +g6 +sS'model.dep_ut' p28 g11 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p29 g11 sS'gr_i' diff --git a/js/Electrical/VariableResistor.js b/js/Electrical/VariableResistor.js index 2244df08..f9aaff39 100644 --- a/js/Electrical/VariableResistor.js +++ b/js/Electrical/VariableResistor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/VariableResistor.sci" */ function VariableResistor() { VariableResistor.prototype.define = function VariableResistor() { - model = scicos_model(); - model.sim = "VariableResistor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("VariableResistor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VariableResistor"; mo.inputs = ["p","R"]; mo.outputs = "n"; - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); diff --git a/js/Electrical/VariableResistor.pickle b/js/Electrical/VariableResistor.pickle index a8d46cd4..850419e5 100644 --- a/js/Electrical/VariableResistor.pickle +++ b/js/Electrical/VariableResistor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/VoltageSensor.js b/js/Electrical/VoltageSensor.js index 74af23d8..b32c3766 100644 --- a/js/Electrical/VoltageSensor.js +++ b/js/Electrical/VoltageSensor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/VoltageSensor.sci" */ function VoltageSensor() { VoltageSensor.prototype.define = function VoltageSensor() { - model = scicos_model(); - model.in1 = 1; - model.out = [[1],[1]]; - model.sim = "VoltageSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.sim = new ScilabString("VoltageSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VoltageSensor"; mo.inputs = "p"; mo.outputs = [["n"],["v"]]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new VoltageSensorBlock(this.x); diff --git a/js/Electrical/VoltageSensor.pickle b/js/Electrical/VoltageSensor.pickle index a76e4523..13759532 100644 --- a/js/Electrical/VoltageSensor.pickle +++ b/js/Electrical/VoltageSensor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/VsourceAC.js b/js/Electrical/VsourceAC.js index 9dd180d9..c1cf8acc 100644 --- a/js/Electrical/VsourceAC.js +++ b/js/Electrical/VsourceAC.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Electrical/VsourceAC.sci" */ function VsourceAC() { VsourceAC.prototype.define = function VsourceAC() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.VA = 220; this.FR = 50; - model.rpar = [[this.VA],[this.FR]]; - model.sim = "VsourceAC"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.VA],[this.FR]]; + this.model.sim = new ScilabString("VsourceAC"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VsourceAC"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list([["VA"],["f"]],list(this.VA,this.FR)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [[string(this.VA)],[string(this.FR)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -39,17 +39,17 @@ function VsourceAC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.VA,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","Frequency (Hz)"],list("vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.VA],[this.FR]]; - model.equations.parameters[2-1] = list(this.VA,this.FR); + this.model.rpar = [[this.VA],[this.FR]]; + this.model.equations.parameters[('2', 'double')] = list(this.VA,this.FR); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/VsourceAC.pickle b/js/Electrical/VsourceAC.pickle index b545ba61..2922295d 100644 --- a/js/Electrical/VsourceAC.pickle +++ b/js/Electrical/VsourceAC.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'FR' +aS'model' p3 -aS'VA' +aS'FR' p4 -atp5 -Rp6 +aS'VA' +p5 +atp6 +Rp7 .(dp0 S'FR' p1 @@ -38,34 +40,34 @@ p11 sS'model.in1' p12 g11 -sS'x.graphics' +sS'exprs' p13 -g6 -sS'mo.inputs' +S'matrix' p14 +sS'mo.inputs' +p15 g4 sS'x.graphics.in_implicit' -p15 +p16 g11 sS'mo.parameters' -p16 +p17 g11 sS'VA' -p17 +p18 g2 sS'model.equations' -p18 +p19 g2 sS'mo.outputs' -p19 +p20 g4 sS'x.graphics.out_implicit' -p20 +p21 g11 sS'model.rpar' -p21 -S'matrix' p22 +g14 sS'graphics.exprs' p23 NsS'typ' @@ -77,15 +79,15 @@ g4 sS'mo' p26 g2 -sS'model.dep_ut' +sS'x.graphics' p27 -g11 -sS'model.equations.parameters[2-1]' +g6 +sS'model.dep_ut' p28 g11 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p29 -g22 +g11 sS'gr_i' p30 g11 diff --git a/js/Events/ANDLOG_f.js b/js/Events/ANDLOG_f.js index 8e71e1d9..31deaa17 100644 --- a/js/Events/ANDLOG_f.js +++ b/js/Events/ANDLOG_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Events/ANDLOG_f.sci" */ function ANDLOG_f() { ANDLOG_f.prototype.define = function ANDLOG_f() { - model = scicos_model(); - model.sim = "andlog"; - model.out = 1; - model.evtin = [[1],[1]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("andlog"); + this.model.out = new ScilabDouble(1); + this.model.evtin = [[1],[1]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([3,3],model,[],gr_i); + this.x = standard_define([3,3],this.model,[],gr_i); return new BasicBlock(this.x); } ANDLOG_f.prototype.details = function ANDLOG_f() { diff --git a/js/Events/ANDLOG_f.pickle b/js/Events/ANDLOG_f.pickle index 497f51ed..27c4e0b1 100644 --- a/js/Events/ANDLOG_f.pickle +++ b/js/Events/ANDLOG_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Events/CLKSOMV_f.js b/js/Events/CLKSOMV_f.js index baea70e3..093e9ece 100644 --- a/js/Events/CLKSOMV_f.js +++ b/js/Events/CLKSOMV_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Events/CLKSOMV_f.sci" */ function CLKSOMV_f() { CLKSOMV_f.prototype.define = function CLKSOMV_f() { - model = scicos_model(); - model.sim = "sum"; - model.evtin = [[1],[1],[1]]; - model.evtout = 1; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sum"); + this.model.evtin = [[1],[1],[1]]; + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } CLKSOMV_f.prototype.details = function CLKSOMV_f() { diff --git a/js/Events/CLKSOMV_f.pickle b/js/Events/CLKSOMV_f.pickle index 8958249b..b77c7073 100644 --- a/js/Events/CLKSOMV_f.pickle +++ b/js/Events/CLKSOMV_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Events/CLKSOM_f.js b/js/Events/CLKSOM_f.js index 74a102a3..2f2c9c3b 100644 --- a/js/Events/CLKSOM_f.js +++ b/js/Events/CLKSOM_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Events/CLKSOM_f.sci" */ function CLKSOM_f() { CLKSOM_f.prototype.define = function CLKSOM_f() { - model = scicos_model(); - model.sim = "sum"; - model.evtin = [[1],[1],[1]]; - model.evtout = 1; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sum"); + this.model.evtin = [[1],[1],[1]]; + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([1,1]/1.2,model,[],gr_i); + this.x = standard_define([1,1]/1.2,this.model,[],gr_i); return new BasicBlock(this.x); } CLKSOM_f.prototype.details = function CLKSOM_f() { diff --git a/js/Events/CLKSOM_f.pickle b/js/Events/CLKSOM_f.pickle index 8958249b..b77c7073 100644 --- a/js/Events/CLKSOM_f.pickle +++ b/js/Events/CLKSOM_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Events/CLKSPLIT_f.js b/js/Events/CLKSPLIT_f.js index b16b6b61..222bd91f 100644 --- a/js/Events/CLKSPLIT_f.js +++ b/js/Events/CLKSPLIT_f.js @@ -1,14 +1,14 @@ /* autogenerated from "macros/Events/CLKSPLIT_f.sci" */ function CLKSPLIT_f() { CLKSPLIT_f.prototype.define = function CLKSPLIT_f() { - model = scicos_model(); - model.sim = "split"; - model.evtin = 1; - model.evtout = [[1],[1]]; - model.blocktype = "d"; - model.firing = [false,false,false]; - model.dep_ut = [false,false]; - this.x = standard_define([1,1]/3,model,[],[]); + this.model = scicos_model(); + this.model.sim = new ScilabString("split"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = [false,false,false]; + this.model.dep_ut = [false,false]; + this.x = standard_define([1,1]/3,this.model,[],[]); return new BasicBlock(this.x); } CLKSPLIT_f.prototype.details = function CLKSPLIT_f() { diff --git a/js/Events/CLKSPLIT_f.pickle b/js/Events/CLKSPLIT_f.pickle index 8d8dc46f..1c54c2e8 100644 --- a/js/Events/CLKSPLIT_f.pickle +++ b/js/Events/CLKSPLIT_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Events/END_c.js b/js/Events/END_c.js index c9d0dec4..ec7627e1 100644 --- a/js/Events/END_c.js +++ b/js/Events/END_c.js @@ -2,16 +2,16 @@ function END_c() { END_c.prototype.define = function END_c() { this.tf = 100000000; - model = scicos_model(); - model.sim = list("scicosexit",4); - model.evtin = 1; - model.evtout = 1; - model.firing = this.tf; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("scicosexit",4); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(this.tf); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = string(this.tf); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } END_c.prototype.details = function END_c() { @@ -28,7 +28,7 @@ function END_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tf,exprs] = scicos_getvalue("Set final simulation time",["Final simulation time"],list("vec",1),exprs); if (!ok) { @@ -36,9 +36,9 @@ function END_c() { } if (ok) { graphics.exprs = exprs; - model.firing = this.tf; + this.model.firing = new ScilabDouble(this.tf); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Events/END_c.pickle b/js/Events/END_c.pickle index 98f3289d..84e9ac57 100644 --- a/js/Events/END_c.pickle +++ b/js/Events/END_c.pickle @@ -6,8 +6,10 @@ S'tf' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTDLY_c.js b/js/Events/EVTDLY_c.js index 75989e4e..8d659cdc 100644 --- a/js/Events/EVTDLY_c.js +++ b/js/Events/EVTDLY_c.js @@ -3,17 +3,17 @@ function EVTDLY_c() { EVTDLY_c.prototype.define = function EVTDLY_c() { this.dt = 0.1; this.ff = 0.0; - model = scicos_model(); - model.sim = list("evtdly4",4); - model.evtin = 1; - model.evtout = 1; - model.rpar = [[this.dt],[this.ff]]; - model.blocktype = "d"; - model.firing = this.ff; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("evtdly4",4); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[this.dt],[this.ff]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(this.ff); + this.model.dep_ut = [false,false]; exprs = [[string(this.dt)],[sci2exp(this.ff)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTDLY_c.prototype.details = function EVTDLY_c() { @@ -32,7 +32,7 @@ function EVTDLY_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.dt,this.ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" to disable any output event."]],["Delay","Date of initial output event"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -44,10 +44,10 @@ function EVTDLY_c() { } if (ok) { graphics.exprs = exprs; - model.rpar = [[this.dt],[this.ff]]; - model.firing = this.ff; + this.model.rpar = [[this.dt],[this.ff]]; + this.model.firing = new ScilabDouble(this.ff); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Events/EVTDLY_c.pickle b/js/Events/EVTDLY_c.pickle index 722994a2..cc0b23ac 100644 --- a/js/Events/EVTDLY_c.pickle +++ b/js/Events/EVTDLY_c.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'dt' +aS'model' p3 -aS'ff' +aS'dt' p4 -atp5 -Rp6 +aS'ff' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTDLY_f.js b/js/Events/EVTDLY_f.js index 6086f551..80e0455b 100644 --- a/js/Events/EVTDLY_f.js +++ b/js/Events/EVTDLY_f.js @@ -3,17 +3,17 @@ function EVTDLY_f() { EVTDLY_f.prototype.define = function EVTDLY_f() { this.dt = 0.1; this.ff = this.dt; - model = scicos_model(); - model.sim = "evtdly"; - model.evtin = 1; - model.evtout = 1; - model.rpar = this.dt; - model.blocktype = "d"; - model.firing = this.ff; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("evtdly"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.dt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(this.ff); + this.model.dep_ut = [false,false]; exprs = [[string(this.dt)],[sci2exp(this.ff)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTDLY_f.prototype.details = function EVTDLY_f() { @@ -32,7 +32,7 @@ function EVTDLY_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.dt,this.ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" if no initial event required"]],["Delay","Date of initial output event"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -44,10 +44,10 @@ function EVTDLY_f() { } if (ok) { graphics.exprs = exprs; - model.rpar = this.dt; - model.firing = this.ff; + this.model.rpar = new ScilabDouble(this.dt); + this.model.firing = new ScilabDouble(this.ff); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Events/EVTDLY_f.pickle b/js/Events/EVTDLY_f.pickle index dff4286c..9668c749 100644 --- a/js/Events/EVTDLY_f.pickle +++ b/js/Events/EVTDLY_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'dt' +aS'model' p3 -aS'ff' +aS'dt' p4 -atp5 -Rp6 +aS'ff' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTGEN_f.js b/js/Events/EVTGEN_f.js index 88f22b4a..4bb35f72 100644 --- a/js/Events/EVTGEN_f.js +++ b/js/Events/EVTGEN_f.js @@ -2,15 +2,15 @@ function EVTGEN_f() { EVTGEN_f.prototype.define = function EVTGEN_f() { this.tt = 0; - model = scicos_model(); - model.sim = "trash"; - model.evtout = 1; - model.blocktype = "d"; - model.firing = this.tt; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("trash"); + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(this.tt); + this.model.dep_ut = [false,false]; exprs = string(this.tt); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTGEN_f.prototype.details = function EVTGEN_f() { @@ -27,18 +27,18 @@ function EVTGEN_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.tt,exprs] = scicos_getvalue("Set Event time",["Event Time"],list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - if (model.firing!=this.tt) { - model.firing = this.tt; + if (this.model.firing!=this.tt) { + this.model.firing = new ScilabDouble(this.tt); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Events/EVTGEN_f.pickle b/js/Events/EVTGEN_f.pickle index d2e715ce..b39db62c 100644 --- a/js/Events/EVTGEN_f.pickle +++ b/js/Events/EVTGEN_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'tt' +aS'model' p3 -atp4 -Rp5 +aS'tt' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTVARDLY.js b/js/Events/EVTVARDLY.js index 8ec13eb1..5d66c02e 100644 --- a/js/Events/EVTVARDLY.js +++ b/js/Events/EVTVARDLY.js @@ -1,18 +1,18 @@ /* autogenerated from "macros/Events/EVTVARDLY.sci" */ function EVTVARDLY() { EVTVARDLY.prototype.define = function EVTVARDLY() { - model = scicos_model(); - model.sim = list("evtvardly",4); - model.in1 = 1; - model.evtin = 1; - model.evtout = 1; - model.blocktype = "d"; - model.firing = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - exprs = string(model.firing); + this.model = scicos_model(); + this.model.sim = list("evtvardly",4); + this.model.in1 = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + exprs = string(this.model.firing); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EVTVARDLY.prototype.details = function EVTVARDLY() { @@ -28,16 +28,16 @@ function EVTVARDLY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.fir,exprs] = scicos_getvalue("Set parameter of variable event delay","Initial event firing time (<0 if absent)",list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - model.firing = this.fir; + this.model.firing = new ScilabDouble(this.fir); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Events/EVTVARDLY.pickle b/js/Events/EVTVARDLY.pickle index 62147d8d..107dea5b 100644 --- a/js/Events/EVTVARDLY.pickle +++ b/js/Events/EVTVARDLY.pickle @@ -6,8 +6,10 @@ S'fir' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Events/HALT_f.js b/js/Events/HALT_f.js index 91f1f1dd..efea87ed 100644 --- a/js/Events/HALT_f.js +++ b/js/Events/HALT_f.js @@ -2,16 +2,16 @@ function HALT_f() { HALT_f.prototype.define = function HALT_f() { this.n = 0; - model = scicos_model(); - model.sim = "hltblk"; - model.evtin = 1; - model.dstate = 0; - model.ipar = 0; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("hltblk"); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.ipar = new ScilabDouble(0); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = string(this.n); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } HALT_f.prototype.details = function HALT_f() { @@ -28,7 +28,7 @@ function HALT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.n,exprs] = scicos_getvalue("Set Halt block parameters",["State on halt"],list("vec",1),exprs); if (!ok) { @@ -36,9 +36,9 @@ function HALT_f() { } if (ok) { graphics.exprs = exprs; - model.ipar = this.n; + this.model.ipar = new ScilabDouble(this.n); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Events/HALT_f.pickle b/js/Events/HALT_f.pickle index 0d272b1c..eea3c5a5 100644 --- a/js/Events/HALT_f.pickle +++ b/js/Events/HALT_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'n' +aS'model' p3 -atp4 -Rp5 +aS'n' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Events/IFTHEL_f.js b/js/Events/IFTHEL_f.js index 0f74c9f1..ad55f013 100644 --- a/js/Events/IFTHEL_f.js +++ b/js/Events/IFTHEL_f.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Events/IFTHEL_f.sci" */ function IFTHEL_f() { IFTHEL_f.prototype.define = function IFTHEL_f() { - model = scicos_model(); - model.sim = list("ifthel",-1); - model.in1 = 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,false]; - model.nmode = 1; - model.nzcross = 1; + this.model = scicos_model(); + this.model.sim = list("ifthel",-1); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.blocktype = new ScilabString("l"); + this.model.firing = [-1,-1]; + this.model.dep_ut = [true,false]; + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); gr_i = []; - exprs = [[string(model.in1)],[string(model.nmode)]]; - this.x = standard_define([3,3],model,exprs,gr_i); + exprs = [[string(this.model.in1)],[string(this.model.nmode)]]; + this.x = standard_define([3,3],this.model,exprs,gr_i); return new BasicBlock(this.x); } IFTHEL_f.prototype.details = function IFTHEL_f() { @@ -34,7 +34,7 @@ function IFTHEL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (exprs==[]) { exprs = string(1); } @@ -46,22 +46,22 @@ function IFTHEL_f() { if (!ok) { break; } - model.dep_ut = [true,false]; + this.model.dep_ut = [true,false]; if (this.nmod!=0) { this.nmod = 1; } if (this.inh!=1) { this.inh = []; } - [model,graphics,ok] = check_io(model,graphics,1,[],this.inh,[[1],[1]]); + [model,graphics,ok] = check_io(this.model,graphics,1,[],this.inh,[[1],[1]]); if (ok) { graphics.exprs = exprs; - model.evtin = this.inh; - model.sim[2-1] = -1; - model.nmode = this.nmod; - model.nzcross = this.nmod; + this.model.evtin = this.inh; + this.model.sim[('2', 'double')] = new ScilabDouble(-1); + this.model.nmode = new ScilabDouble(this.nmod); + this.model.nzcross = new ScilabDouble(this.nmod); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Events/IFTHEL_f.pickle b/js/Events/IFTHEL_f.pickle index 41611e51..ed2f956d 100644 --- a/js/Events/IFTHEL_f.pickle +++ b/js/Events/IFTHEL_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'inh' +aS'model' p3 -aS'nmod' +aS'inh' p4 -atp5 -Rp6 +aS'nmod' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 @@ -60,24 +62,24 @@ sS'model.evtout' p19 S'matrix' p20 -sS'model.nmode' +sS"model.sim[('2', 'double')]" p21 g6 -sS'graphics.exprs' +sS'model.nmode' p22 +g6 +sS'graphics.exprs' +p23 g16 sS'model.nzcross' -p23 +p24 g6 sS'[model,graphics,ok]' -p24 +p25 g6 sS'model.blocktype' -p25 -g16 -sS'model.sim[2-1]' p26 -g6 +g16 sS'model.dep_ut' p27 g8 diff --git a/js/Events/MFCLCK_f.js b/js/Events/MFCLCK_f.js index e3b49352..e529ebb3 100644 --- a/js/Events/MFCLCK_f.js +++ b/js/Events/MFCLCK_f.js @@ -3,19 +3,19 @@ function MFCLCK_f() { MFCLCK_f.prototype.define = function MFCLCK_f() { this.nn = 2; this.dt = 0.1; - model = scicos_model(); - model.sim = "mfclck"; - model.evtin = 1; - model.evtout = [[1],[1]]; - model.dstate = 0; - model.rpar = this.dt; - model.ipar = this.nn; - model.blocktype = "d"; - model.firing = [-1,0]; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("mfclck"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.dstate = new ScilabDouble(0); + this.model.rpar = new ScilabDouble(this.dt); + this.model.ipar = new ScilabDouble(this.nn); + this.model.blocktype = new ScilabString("d"); + this.model.firing = [-1,0]; + this.model.dep_ut = [false,false]; exprs = [[string(this.dt)],[string(this.nn)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MFCLCK_f.prototype.details = function MFCLCK_f() { @@ -34,17 +34,17 @@ function MFCLCK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; [ok,this.dt,this.nn,exprs] = scicos_getvalue("Set Multifrequency clock parameters",["basic period (1/f)","multiply by (n)"],list("vec",1,"vec",1),exprs); if (ok) { - model.ipar = this.nn; - model.rpar = this.dt; - hh = model.firing; + this.model.ipar = new ScilabDouble(this.nn); + this.model.rpar = new ScilabDouble(this.dt); + hh = this.model.firing; hh[2-1] = 0; - model.firing = hh; + this.model.firing = hh; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; } return new BasicBlock(this.x); } diff --git a/js/Events/MFCLCK_f.pickle b/js/Events/MFCLCK_f.pickle index cfe24411..ef1a472e 100644 --- a/js/Events/MFCLCK_f.pickle +++ b/js/Events/MFCLCK_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'dt' +aS'model' p3 -aS'nn' +aS'dt' p4 -atp5 -Rp6 +aS'nn' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Events/M_freq.js b/js/Events/M_freq.js index 9d9d7da7..56413dab 100644 --- a/js/Events/M_freq.js +++ b/js/Events/M_freq.js @@ -1,18 +1,18 @@ /* autogenerated from "macros/Events/M_freq.sci" */ function M_freq() { M_freq.prototype.define = function M_freq() { - model = scicos_model(); - model.sim = list("m_frequ",4); - model.evtout = [[1],[1],[1]]; - model.evtin = 1; - model.rpar = []; - model.opar = list([[1,1,0],[1,1,1],[1,3,2]],1,0,0); - model.blocktype = "d"; - model.firing = [0,-1,-1]; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("m_frequ",4); + this.model.evtout = [[1],[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = []; + this.model.opar = list([[1,1,0],[1,1,1],[1,3,2]],1,0,0); + this.model.blocktype = new ScilabString("d"); + this.model.firing = [0,-1,-1]; + this.model.dep_ut = [false,false]; exprs = [[sci2exp([[1],[2]])],[sci2exp([[0],[0]])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } M_freq.prototype.details = function M_freq() { @@ -30,7 +30,7 @@ function M_freq() { this.offset = inverse(arguments[0]["offset"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",-1,"vec",-1),exprs); @@ -53,18 +53,18 @@ function M_freq() { [m,den,off,count,m1,fir,this.frequ,this.offset,ok] = mfrequ_clk(this.frequ,this.offset); } if (ok) { - model.opar = list(m,double(den),off,count); + this.model.opar = list(m,double(den),off,count); mn = (2^size(m1,"*"))-1; - [model,graphics,ok] = set_io(model,graphics,list(),list(),1,ones(mn,1)); + [model,graphics,ok] = set_io(this.model,graphics,list(),list(),1,ones(mn,1)); if (mn>3) { graphics.sz = [40+(mn-3)*10,40]; } else { graphics.sz = [50,40]; } - model.firing = fir; + this.model.firing = new ScilabDouble(fir); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Events/M_freq.pickle b/js/Events/M_freq.pickle index d7305484..22f23762 100644 --- a/js/Events/M_freq.pickle +++ b/js/Events/M_freq.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'fr' p2 -aS'frequ' -p3 aS'of' +p3 +aS'frequ' p4 -aS'fr' -p5 aS'offset' +p5 +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Events/VirtualCLK0.js b/js/Events/VirtualCLK0.js index 15757f71..f3040a9b 100644 --- a/js/Events/VirtualCLK0.js +++ b/js/Events/VirtualCLK0.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/Events/VirtualCLK0.sci" */ function VirtualCLK0() { VirtualCLK0.prototype.define = function VirtualCLK0() { - model = scicos_model(); - model.sim = "vrtclk0"; - model.evtin = 1; - model.opar = list(); - model.ipar = []; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("vrtclk0"); + this.model.evtin = new ScilabDouble(1); + this.model.opar = list(); + this.model.ipar = []; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = []; - this.x = standard_define([2,2],model,exprs," "); + this.x = standard_define([2,2],this.model,exprs," "); return new BasicBlock(this.x); } VirtualCLK0.prototype.details = function VirtualCLK0() { diff --git a/js/Events/VirtualCLK0.pickle b/js/Events/VirtualCLK0.pickle index 2afe7018..4665ec16 100644 --- a/js/Events/VirtualCLK0.pickle +++ b/js/Events/VirtualCLK0.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Events/freq_div.js b/js/Events/freq_div.js index 50719b16..ca64c706 100644 --- a/js/Events/freq_div.js +++ b/js/Events/freq_div.js @@ -14,61 +14,61 @@ function freq_div() { scs_m_1.objs[10-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,-100]; graphics.sz = [60,40]; graphics.exprs = [["0"],["3"]]; - model.dstate = 3; - model.ipar = 3; + this.model.dstate = new ScilabDouble(3); + this.model.ipar = new ScilabDouble(3); graphics.pout = 7; graphics.pein = 10; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [120,0]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.peout = 6; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; blk = scs_m_1.objs[3-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [130,-160]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pein = 8; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[3-1] = blk; blk = scs_m_1.objs[4-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [100,-100]; graphics.sz = [60,40]; graphics.exprs = [["1"],["0"]]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pin = 7; graphics.pein = 9; graphics.peout = [[0],[8]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[4-1] = blk; blk = scs_m_1.objs[5-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [127,-33]; graphics.sz = [7,7]; graphics.pein = 6; graphics.peout = [[9],[10]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[5-1] = blk; lnk = scs_m_1.objs[6-1]; lnk.ct = [5,-1]; @@ -98,13 +98,13 @@ function freq_div() { scs_m_1.objs[10-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.evtin = 1; - model.evtout = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } freq_div.prototype.details = function freq_div() { @@ -138,7 +138,7 @@ function freq_div() { xxn = xx; graphics = xx.graphics; exprs = graphics.exprs; - model = xx.model; + this.model = xx.model; while (true) { [ok,%ph,%df,exprs] = scicos_getvalue("Set frequency division block parameters",["Phase (0 to division factor -1)","Division factor"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -153,45 +153,45 @@ function freq_div() { %ph = %df-1; } graphics.exprs = exprs; - model.ipar = %df; - model.dstate = %ph; + this.model.ipar = new ScilabDouble(%df); + this.model.dstate = new ScilabDouble(%ph); xxn.graphics = graphics; - xxn.model = model; + xxn.model = this.model; break; } } if (diffobjs(xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; diff --git a/js/Events/freq_div.pickle b/js/Events/freq_div.pickle index 871373c9..9960bc07 100644 --- a/js/Events/freq_div.pickle +++ b/js/Events/freq_div.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'%df' +aS'model' p3 -aS'%ph' +aS'%df' p4 -atp5 -Rp6 +aS'%ph' +p5 +atp6 +Rp7 .(dp0 S'lnk.ct' p1 diff --git a/js/Hydraulics/Bache.js b/js/Hydraulics/Bache.js index 54150992..fb253e57 100644 --- a/js/Hydraulics/Bache.js +++ b/js/Hydraulics/Bache.js @@ -3,9 +3,9 @@ function Bache() { Bache.prototype.define = function Bache() { in1 = 2; out = 3; - model = scicos_model(); - model.in1 = [-transpose([1:in1])]; - model.out = [-transpose([1:out])]; + this.model = scicos_model(); + this.model.in1 = [-transpose([1:in1])]; + this.model.out = [-transpose([1:out])]; this.Patm = 1.013e5; this.A = 1; this.ze1 = 40; @@ -15,21 +15,21 @@ function Bache() { this.z0 = 30; this.T0 = 290; this.p_rho = 0; - model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; - model.sim = "Bache"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; + this.model.sim = new ScilabString("Bache"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Bache"; mo.inputs = ["Ce1","Ce2"]; mo.outputs = ["Cs1","Cs2","yNiveau"]; mo.parameters = list([["Patm"],["A"],["ze1"],["ze2"],["zs1"],["zs2"],["z0"],["T0"],["p_rho"]],[[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.Patm)],[string(this.A)],[string(this.ze1)],[string(this.ze2)],[string(this.zs1)],[string(this.zs2)],[string(this.z0)],[string(this.T0)],[string(this.p_rho)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = [["I"],["I"]]; this.x.graphics.out_implicit = [["I"],["I"],["E"]]; return new BasicBlock(this.x); @@ -64,17 +64,17 @@ function Bache() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Patm,this.A,this.ze1,this.ze2,this.zs1,this.zs2,this.z0,this.T0,this.p_rho,exprs] = scicos_getvalue("Parametres de la bache",["Pression dans le ciel de la bache : Patm (Pa)","Section de la bache : A (m2)","Altitude du piquage d entrée 1: ze1 (m)","Altitude du piquage d entrée 2: ze2 (m)","Altitude du piquage de sortie 1: zs1 (m)","Altitude du piquage de sortie 2: zs2 (m)","Altitude initiale du fluide : z0 (m)","Température initiale du fluide : T0 (K)","Si >0, masse volumique imposée du fluide : p_rho (kg/m3)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; - model.equations.parameters[2-1] = list(this.Patm,this.A,this.ze1,this.ze2,this.zs1,this.zs2,this.z0,this.T0,this.p_rho); + this.model.rpar = [[this.Patm],[this.A],[this.ze1],[this.ze2],[this.zs1],[this.zs2],[this.z0],[this.T0],[this.p_rho]]; + this.model.equations.parameters[('2', 'double')] = list(this.Patm,this.A,this.ze1,this.ze2,this.zs1,this.zs2,this.z0,this.T0,this.p_rho); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Hydraulics/Bache.pickle b/js/Hydraulics/Bache.pickle index 7008cb8e..6e508ab9 100644 --- a/js/Hydraulics/Bache.pickle +++ b/js/Hydraulics/Bache.pickle @@ -20,10 +20,12 @@ aS'p_rho' p9 aS'x' p10 -aS'Patm' +aS'model' p11 -atp12 -Rp13 +aS'Patm' +p12 +atp13 +Rp14 .(dp0 S'arg1' p1 @@ -54,23 +56,23 @@ g8 sS'zs2' p12 g8 -sS'x.graphics' +sS'exprs' p13 -g2 -sS'z0' +S'matrix' p14 +sS'z0' +p15 g8 sS'mo.inputs' -p15 -S'vector' p16 -sS'x.graphics.in_implicit' +S'vector' p17 -S'matrix' +sS'x.graphics.in_implicit' p18 +g14 sS'mo.parameters' p19 -g16 +g17 sS'Patm' p20 g8 @@ -85,16 +87,16 @@ p23 g8 sS'mo.outputs' p24 -g16 +g17 sS'x.graphics.out_implicit' p25 -g18 +g14 sS'in1' p26 g8 sS'model.rpar' p27 -g18 +g14 sS'ze2' p28 g8 @@ -108,31 +110,31 @@ sS'graphics.exprs' p31 NsS'typ' p32 -g16 +g17 sS'model.blocktype' p33 g5 sS'mo' p34 g2 -sS'model.dep_ut' +sS'x.graphics' p35 -g16 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p36 -g16 -sS'exprs' +g17 +sS"model.equations.parameters[('2', 'double')]" p37 -g18 +g17 sS'gr_i' p38 -g16 +g17 sS'p_rho' p39 g8 sS'y' p40 -g16 +g17 sS'x' p41 g8 diff --git a/js/Hydraulics/Flowmeter.js b/js/Hydraulics/Flowmeter.js index fa275941..06d4ec54 100644 --- a/js/Hydraulics/Flowmeter.js +++ b/js/Hydraulics/Flowmeter.js @@ -4,7 +4,7 @@ function Flowmeter() { ModelName = "Flowmeter"; PrametersValue = 1; ParametersName = "Qini"; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function Flowmeter() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = new ScilabDouble(PrametersValue); mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = "1"; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -62,7 +62,7 @@ function Flowmeter() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (false) { diff --git a/js/Hydraulics/Flowmeter.pickle b/js/Hydraulics/Flowmeter.pickle index 3a232f23..fb9cc3d1 100644 --- a/js/Hydraulics/Flowmeter.pickle +++ b/js/Hydraulics/Flowmeter.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'Qini' +aS'model' p3 -atp4 -Rp5 +aS'Qini' +p4 +atp5 +Rp6 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Hydraulics/PerteDP.js b/js/Hydraulics/PerteDP.js index c9fd922e..de0ebb69 100644 --- a/js/Hydraulics/PerteDP.js +++ b/js/Hydraulics/PerteDP.js @@ -1,30 +1,30 @@ /* autogenerated from "macros/Hydraulics/PerteDP.sci" */ function PerteDP() { PerteDP.prototype.define = function PerteDP() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.L = 10; this.D = 0.2; this.lambda = 0.03; this.z1 = 0; this.z2 = 0; this.p_rho = 0; - model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; - model.sim = "PerteDP"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; + this.model.sim = new ScilabString("PerteDP"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PerteDP"; mo.inputs = "C1"; mo.outputs = "C2"; mo.parameters = list([["L"],["D"],["lambda"],["z1"],["z2"],["p_rho"]],[[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.L)],[string(this.D)],[string(this.lambda)],[string(this.z1)],[string(this.z2)],[string(this.p_rho)]]; gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -53,17 +53,17 @@ function PerteDP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho,exprs] = scicos_getvalue("Parametres du tuyau",["Longueur du tube : L (m)","Diamètre interne du tube : D (m)","Coefficient de perte de charge-frottement(S.U) : lambda","Altitude entrée tuyauterie : z1 (m)","Altitude sortie tuyauterie : z2 (m)","Si >0, masse volumique imposée fu fluide : p_rho (kg/m3)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; - model.equations.parameters[2-1] = list(this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho); + this.model.rpar = [[this.L],[this.D],[this.lambda],[this.z1],[this.z2],[this.p_rho]]; + this.model.equations.parameters[('2', 'double')] = list(this.L,this.D,this.lambda,this.z1,this.z2,this.p_rho); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Hydraulics/PerteDP.pickle b/js/Hydraulics/PerteDP.pickle index ab82549b..755f9964 100644 --- a/js/Hydraulics/PerteDP.pickle +++ b/js/Hydraulics/PerteDP.pickle @@ -10,14 +10,16 @@ aS'p_rho' p4 aS'x' p5 -aS'z1' +aS'model' p6 -aS'z2' +aS'z1' p7 -aS'lambda' +aS'z2' p8 -atp9 -Rp10 +aS'lambda' +p9 +atp10 +Rp11 .(dp0 S'arg1' p1 @@ -39,46 +41,46 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 -sS'mo.inputs' +S'matrix' p11 +sS'mo.inputs' +p12 g5 sS'x.graphics.in_implicit' -p12 -S'vector' p13 -sS'mo.parameters' +S'vector' p14 -g13 -sS'model.sim' +sS'mo.parameters' p15 +g14 +sS'model.sim' +p16 g5 sS'model.equations' -p16 +p17 g8 sS'D' -p17 +p18 g8 sS'mo.outputs' -p18 +p19 g5 sS'x.graphics.out_implicit' -p19 -g13 -sS'L' p20 +g14 +sS'L' +p21 g8 sS'model.rpar' -p21 -S'matrix' p22 +g11 sS'graphics.exprs' p23 NsS'typ' p24 -g13 +g14 sS'z1' p25 g8 @@ -91,24 +93,24 @@ g5 sS'mo' p28 g2 -sS'model.dep_ut' +sS'x.graphics' p29 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p30 -g13 -sS'exprs' +g14 +sS"model.equations.parameters[('2', 'double')]" p31 -g22 +g14 sS'gr_i' p32 -g13 +g14 sS'p_rho' p33 g8 sS'y' p34 -g13 +g14 sS'x' p35 g8 diff --git a/js/Hydraulics/PuitsP.js b/js/Hydraulics/PuitsP.js index 0eec1711..34c11d39 100644 --- a/js/Hydraulics/PuitsP.js +++ b/js/Hydraulics/PuitsP.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Hydraulics/PuitsP.sci" */ function PuitsP() { PuitsP.prototype.define = function PuitsP() { - model = scicos_model(); + this.model = scicos_model(); this.P0 = 100000; this.T0 = 290; this.H0 = 100000; this.option_temperature = 1; - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.sim = "Puits"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.sim = new ScilabString("Puits"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Puits"; mo.inputs = ["C"]; mo.parameters = list([["P0"],["T0"],["H0"],["option_temperature"]],[[this.P0],[this.T0],[this.H0],[this.option_temperature]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); exprs = [[string(this.P0)],[string(this.T0)],[string(this.H0)],[string(this.option_temperature)]]; gr_i = []; - this.x = standard_define([2.5,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2.5,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); } @@ -42,17 +42,17 @@ function PuitsP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.P0,this.T0,this.H0,this.option_temperature,exprs] = scicos_getvalue("Paramètres du puits",["Pression de la source : P0 (Pa)","Temperature de la source : T0 (K)","Enthalpie spécifique de la source : H0 (J/kg)","1:température fixée - 2:enthalpie fixée : option_temperature"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.equations.parameters[2-1] = list(this.P0,this.T0,this.H0,this.option_temperature); + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.equations.parameters[('2', 'double')] = list(this.P0,this.T0,this.H0,this.option_temperature); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Hydraulics/PuitsP.pickle b/js/Hydraulics/PuitsP.pickle index 376ca2f2..1fa7bcc7 100644 --- a/js/Hydraulics/PuitsP.pickle +++ b/js/Hydraulics/PuitsP.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'P0' p2 -aS'P0' +aS'H0' p3 -aS'option_temperature' +aS'T0' p4 -aS'H0' +aS'x' p5 -aS'T0' +aS'model' p6 -atp7 -Rp8 +aS'option_temperature' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 @@ -32,35 +34,35 @@ NsS'model.in1' p7 S'double' p8 -sS'x.graphics' +sS'exprs' p9 -g2 -sS'mo.inputs' +S'matrix' p10 -S'vector' +sS'mo.inputs' p11 -sS'x.graphics.in_implicit' +S'vector' p12 -g11 -sS'option_temperature' +sS'x.graphics.in_implicit' p13 +g12 +sS'option_temperature' +p14 g8 sS'mo.parameters' -p14 -g11 -sS'model.sim' p15 +g12 +sS'model.sim' +p16 g5 sS'P0' -p16 +p17 g8 sS'model.equations' -p17 +p18 g8 sS'model.rpar' -p18 -S'matrix' p19 +g10 sS'T0' p20 g8 @@ -68,28 +70,28 @@ sS'graphics.exprs' p21 NsS'typ' p22 -g11 +g12 sS'model.blocktype' p23 g5 sS'mo' p24 g2 -sS'model.dep_ut' +sS'x.graphics' p25 -g11 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p26 -g11 -sS'exprs' +g12 +sS"model.equations.parameters[('2', 'double')]" p27 -g19 +g12 sS'gr_i' p28 -g11 +g12 sS'y' p29 -g11 +g12 sS'x' p30 g8 diff --git a/js/Hydraulics/SourceP.js b/js/Hydraulics/SourceP.js index d5030f9b..2ed928b6 100644 --- a/js/Hydraulics/SourceP.js +++ b/js/Hydraulics/SourceP.js @@ -1,26 +1,26 @@ /* autogenerated from "macros/Hydraulics/SourceP.sci" */ function SourceP() { SourceP.prototype.define = function SourceP() { - model = scicos_model(); + this.model = scicos_model(); this.P0 = 300000; this.T0 = 290; this.H0 = 100000; this.option_temperature = 1; - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.sim = "Source"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.sim = new ScilabString("Source"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Source"; mo.inputs = []; mo.outputs = ["C"]; mo.parameters = list([["P0"],["T0"],["H0"],["option_temperature"]],[[this.P0],[this.T0],[this.H0],[this.option_temperature]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.P0)],[string(this.T0)],[string(this.H0)],[string(this.option_temperature)]]; gr_i = []; - this.x = standard_define([2.5,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2.5,2],this.model,exprs,list(gr_i,0)); this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); } @@ -44,17 +44,17 @@ function SourceP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.P0,this.T0,this.H0,this.option_temperature,exprs] = scicos_getvalue("Paramètres du puits",["Pression de la source : P0 (Pa)","Temperature de la source : T0 (K)","Enthalpie spécifique de la source : H0 (J/kg)","1:température fixée - 2:enthalpie fixée : option_temperature"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; - model.equations.parameters[2-1] = list(this.P0,this.T0,this.H0,this.option_temperature); + this.model.rpar = [[this.P0],[this.T0],[this.H0],[this.option_temperature]]; + this.model.equations.parameters[('2', 'double')] = list(this.P0,this.T0,this.H0,this.option_temperature); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Hydraulics/SourceP.pickle b/js/Hydraulics/SourceP.pickle index a1a50cb2..7f345a90 100644 --- a/js/Hydraulics/SourceP.pickle +++ b/js/Hydraulics/SourceP.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'P0' p2 -aS'P0' +aS'H0' p3 -aS'option_temperature' +aS'T0' p4 -aS'H0' +aS'x' p5 -aS'T0' +aS'model' p6 -atp7 -Rp8 +aS'option_temperature' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 @@ -35,38 +37,38 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 -sS'mo.inputs' +S'matrix' p11 -S'vector' +sS'mo.inputs' p12 -sS'option_temperature' +S'vector' p13 +sS'option_temperature' +p14 g8 sS'mo.parameters' -p14 -g12 -sS'model.sim' p15 +g13 +sS'model.sim' +p16 g5 sS'P0' -p16 +p17 g8 sS'model.equations' -p17 +p18 g8 sS'mo.outputs' -p18 -g12 -sS'x.graphics.out_implicit' p19 -g12 -sS'model.rpar' +g13 +sS'x.graphics.out_implicit' p20 -S'matrix' +g13 +sS'model.rpar' p21 +g11 sS'T0' p22 g8 @@ -74,28 +76,28 @@ sS'graphics.exprs' p23 NsS'typ' p24 -g12 +g13 sS'model.blocktype' p25 g5 sS'mo' p26 g2 -sS'model.dep_ut' +sS'x.graphics' p27 -g12 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p28 -g12 -sS'exprs' +g13 +sS"model.equations.parameters[('2', 'double')]" p29 -g21 +g13 sS'gr_i' p30 -g12 +g13 sS'y' p31 -g12 +g13 sS'x' p32 g8 diff --git a/js/Hydraulics/VanneReglante.js b/js/Hydraulics/VanneReglante.js index b4be5f45..c36ad94e 100644 --- a/js/Hydraulics/VanneReglante.js +++ b/js/Hydraulics/VanneReglante.js @@ -1,26 +1,26 @@ /* autogenerated from "macros/Hydraulics/VanneReglante.sci" */ function VanneReglante() { VanneReglante.prototype.define = function VanneReglante() { - model = scicos_model(); - model.in1 = [[1],[1]]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [[1],[1]]; + this.model.out = [1]; this.Cvmax = 8005.42; this.p_rho = 0; - model.rpar = [[this.Cvmax],[this.p_rho]]; - model.sim = "VanneReglante"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.Cvmax],[this.p_rho]]; + this.model.sim = new ScilabString("VanneReglante"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VanneReglante"; mo.inputs = ["C1","Ouv"]; mo.outputs = "C2"; mo.parameters = list([["Cvmax"],["p_rho"]],[[this.Cvmax],[this.p_rho]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.Cvmax)],[string(this.p_rho)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = [["I"],["E"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -41,17 +41,17 @@ function VanneReglante() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Cvmax,this.p_rho,exprs] = scicos_getvalue("Paramètres de la vanne reglante",["Cvmax","p_rho"],list("vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.Cvmax],[this.p_rho]]; - model.equations.parameters[2-1] = list(this.Cvmax,this.p_rho); + this.model.rpar = [[this.Cvmax],[this.p_rho]]; + this.model.equations.parameters[('2', 'double')] = list(this.Cvmax,this.p_rho); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Hydraulics/VanneReglante.pickle b/js/Hydraulics/VanneReglante.pickle index 8712cb87..6b7df4fd 100644 --- a/js/Hydraulics/VanneReglante.pickle +++ b/js/Hydraulics/VanneReglante.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'p_rho' +aS'model' p3 -aS'Cvmax' +aS'p_rho' p4 -atp5 -Rp6 +aS'Cvmax' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 @@ -34,20 +36,20 @@ g7 sS'model.in1' p10 g7 -sS'x.graphics' +sS'exprs' p11 -g2 -sS'mo.inputs' +S'matrix' p12 -S'vector' +sS'mo.inputs' p13 -sS'x.graphics.in_implicit' +S'vector' p14 -S'matrix' +sS'x.graphics.in_implicit' p15 +g12 sS'mo.parameters' p16 -g13 +g14 sS'model.sim' p17 g5 @@ -59,39 +61,39 @@ p19 g5 sS'x.graphics.out_implicit' p20 -g13 +g14 sS'model.rpar' p21 -g15 +g12 sS'graphics.exprs' p22 NsS'typ' p23 -g13 +g14 sS'model.blocktype' p24 g5 sS'mo' p25 g2 -sS'model.dep_ut' +sS'x.graphics' p26 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p27 -g13 -sS'exprs' +g14 +sS"model.equations.parameters[('2', 'double')]" p28 -g15 +g14 sS'gr_i' p29 -g13 +g14 sS'p_rho' p30 g7 sS'y' p31 -g13 +g14 sS'x' p32 g7 diff --git a/js/IntegerOp/BITCLEAR.js b/js/IntegerOp/BITCLEAR.js index a854f731..715efd0a 100644 --- a/js/IntegerOp/BITCLEAR.js +++ b/js/IntegerOp/BITCLEAR.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/IntegerOp/BITCLEAR.sci" */ function BITCLEAR() { BITCLEAR.prototype.define = function BITCLEAR() { - model = scicos_model(); - model.sim = list("bit_clear_32",4); - model.in1 = 1; - model.in2 = 1; - model.out = 1; - model.out2 = 1; - model.intyp = 3; - model.outtyp = 3; - model.opar = list(int32(0)); - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("bit_clear_32",4); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.opar = list(int32(0)); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BITCLEAR.prototype.details = function BITCLEAR() { @@ -33,13 +33,13 @@ function BITCLEAR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITCLEAR")],[" "],["Clear a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; if (floor(this.bit)!=this.bit) { block_parameter_error(msprintf("Wrong type for \'%s\' parameter: %5.1f.","Index of Bit",this.bit),"Must be integer."); ok = false; @@ -51,7 +51,7 @@ function BITCLEAR() { this.bit = uint32(this.bit); n = (2^32-1)-2^this.bit; n = uint32(n); - model.sim = list("bit_clear_32",4); + this.model.sim = list("bit_clear_32",4); } } else if ((this.Datatype==4)||(this.Datatype==7)) { if (this.bit>15||this.bit<0) { @@ -61,7 +61,7 @@ function BITCLEAR() { this.bit = uint16(this.bit); n = (2^16-1)-2^this.bit; n = uint16(n); - model.sim = list("bit_clear_16",4); + this.model.sim = list("bit_clear_16",4); } } else if ((this.Datatype==5)||(this.Datatype==8)) { if (this.bit>7||this.bit<0) { @@ -71,7 +71,7 @@ function BITCLEAR() { this.bit = uint8(this.bit); n = (2^8-1)-2^this.bit; n = uint8(n); - model.sim = list("bit_clear_8",4); + this.model.sim = list("bit_clear_8",4); } } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",this.Datatype),msprintf("Must be in the interval %s.","[3, 8]")); @@ -81,13 +81,13 @@ function BITCLEAR() { it = this.Datatype; ot = this.Datatype; out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { graphics.exprs = exprs; - model.opar = list(n); + this.model.opar = list(n); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/IntegerOp/BITCLEAR.pickle b/js/IntegerOp/BITCLEAR.pickle index f19d284e..e6db28df 100644 --- a/js/IntegerOp/BITCLEAR.pickle +++ b/js/IntegerOp/BITCLEAR.pickle @@ -6,10 +6,12 @@ S'Datatype' p2 aS'x' p3 -aS'bit' +aS'model' p4 -atp5 -Rp6 +aS'bit' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/BITSET.js b/js/IntegerOp/BITSET.js index ff9b5a7a..01591724 100644 --- a/js/IntegerOp/BITSET.js +++ b/js/IntegerOp/BITSET.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/IntegerOp/BITSET.sci" */ function BITSET() { BITSET.prototype.define = function BITSET() { - model = scicos_model(); - model.sim = list("bit_set_32",4); - model.in1 = 1; - model.in2 = 1; - model.out = 1; - model.out2 = 1; - model.intyp = 3; - model.outtyp = 3; - model.opar = list(uint32(0)); - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("bit_set_32",4); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.opar = list(uint32(0)); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BITSET.prototype.details = function BITSET() { @@ -33,13 +33,13 @@ function BITSET() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITSET")],[" "],["Set a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; if (floor(this.bit)!=this.bit) { block_parameter_error(msprintf("Wrong type for \'%s\' parameter: %5.1f.","Index of Bit",this.bit),"Must be integer."); ok = false; @@ -52,7 +52,7 @@ function BITSET() { this.bit = uint32(this.bit); n = 2^this.bit; n = uint32(n); - model.sim = list("bit_set_32",4); + this.model.sim = list("bit_set_32",4); } else if ((this.Datatype==4)||(this.Datatype==7)) { if (this.bit>15||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 15]")); @@ -61,7 +61,7 @@ function BITSET() { this.bit = uint16(this.bit); n = 2^this.bit; n = uint16(n); - model.sim = list("bit_set_16",4); + this.model.sim = list("bit_set_16",4); } else if ((this.Datatype==5)||(this.Datatype==8)) { if (this.bit>7||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 7]")); @@ -70,7 +70,7 @@ function BITSET() { this.bit = uint8(this.bit); n = 2^this.bit; n = uint8(n); - model.sim = list("bit_set_8",4); + this.model.sim = list("bit_set_8",4); } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",this.Datatype),msprintf("Must be in the interval %s.","[3, 8]")); ok = false; @@ -79,13 +79,13 @@ function BITSET() { it = this.Datatype; ot = this.Datatype; out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { graphics.exprs = exprs; - model.opar = list(n); + this.model.opar = list(n); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/IntegerOp/BITSET.pickle b/js/IntegerOp/BITSET.pickle index f19d284e..e6db28df 100644 --- a/js/IntegerOp/BITSET.pickle +++ b/js/IntegerOp/BITSET.pickle @@ -6,10 +6,12 @@ S'Datatype' p2 aS'x' p3 -aS'bit' +aS'model' p4 -atp5 -Rp6 +aS'bit' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/CONVERT.js b/js/IntegerOp/CONVERT.js index 22a27d4d..79db9513 100644 --- a/js/IntegerOp/CONVERT.js +++ b/js/IntegerOp/CONVERT.js @@ -2,21 +2,21 @@ function CONVERT() { CONVERT.prototype.define = function CONVERT() { sgn = 2; - model = scicos_model(); - model.sim = list("convert",4); - model.in1 = -1; - model.out = -1; - model.in2 = -2; - model.out2 = -2; - model.intyp = 1; - model.outtyp = 3; - model.rpar = []; - model.ipar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("convert",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(3); + this.model.rpar = []; + this.model.ipar = new ScilabDouble(sgn); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONVERT.prototype.details = function CONVERT() { @@ -36,7 +36,7 @@ function CONVERT() { this.np = arguments[0]["np"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.it,this.ot,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONVERT")],[" "],["Type conversion"],[" "]],["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1,"vec",1),exprs); @@ -59,321 +59,321 @@ function CONVERT() { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Output Type",this.ot),msprintf("Must be in the interval %s.","[1, 8]")); ok = false; } - model.sim = list("convert",4); + this.model.sim = list("convert",4); if ((this.it==this.ot)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else { if ((this.np==0)) { if ((this.it==1)) { if ((this.ot==3)) { - model.ipar = 2; + this.model.ipar = new ScilabDouble(2); } else if ((this.ot==4)) { - model.ipar = 3; + this.model.ipar = new ScilabDouble(3); } else if ((this.ot==5)) { - model.ipar = 4; + this.model.ipar = new ScilabDouble(4); } else if ((this.ot==6)) { - model.ipar = 5; + this.model.ipar = new ScilabDouble(5); } else if ((this.ot==7)) { - model.ipar = 6; + this.model.ipar = new ScilabDouble(6); } else if ((this.ot==8)) { - model.ipar = 7; + this.model.ipar = new ScilabDouble(7); } } else if ((this.it==3)) { if ((this.ot==1)) { - model.ipar = 8; + this.model.ipar = new ScilabDouble(8); } else if ((this.ot==4)) { - model.ipar = 9; + this.model.ipar = new ScilabDouble(9); } else if ((this.ot==5)) { - model.ipar = 10; + this.model.ipar = new ScilabDouble(10); } else if ((this.ot==6)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==7)) { - model.ipar = 11; + this.model.ipar = new ScilabDouble(11); } else if ((this.ot==8)) { - model.ipar = 12; + this.model.ipar = new ScilabDouble(12); } } else if ((this.it==4)) { if ((this.ot==1)) { - model.ipar = 13; + this.model.ipar = new ScilabDouble(13); } else if ((this.ot==3)) { - model.ipar = 14; + this.model.ipar = new ScilabDouble(14); } else if ((this.ot==5)) { - model.ipar = 15; + this.model.ipar = new ScilabDouble(15); } else if ((this.ot==6)) { - model.ipar = 16; + this.model.ipar = new ScilabDouble(16); } else if ((this.ot==7)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==8)) { - model.ipar = 17; + this.model.ipar = new ScilabDouble(17); } } else if ((this.it==5)) { if ((this.ot==1)) { - model.ipar = 18; + this.model.ipar = new ScilabDouble(18); } else if ((this.ot==3)) { - model.ipar = 19; + this.model.ipar = new ScilabDouble(19); } else if ((this.ot==4)) { - model.ipar = 20; + this.model.ipar = new ScilabDouble(20); } else if ((this.ot==6)) { - model.ipar = 21; + this.model.ipar = new ScilabDouble(21); } else if ((this.ot==7)) { - model.ipar = 22; + this.model.ipar = new ScilabDouble(22); } else if ((this.ot==8)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } } else if ((this.it==6)) { if ((this.ot==1)) { - model.ipar = 23; + this.model.ipar = new ScilabDouble(23); } else if ((this.ot==3)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==4)) { - model.ipar = 24; + this.model.ipar = new ScilabDouble(24); } else if ((this.ot==5)) { - model.ipar = 25; + this.model.ipar = new ScilabDouble(25); } else if ((this.ot==7)) { - model.ipar = 26; + this.model.ipar = new ScilabDouble(26); } else if ((this.ot==8)) { - model.ipar = 27; + this.model.ipar = new ScilabDouble(27); } } else if ((this.it==7)) { if ((this.ot==1)) { - model.ipar = 28; + this.model.ipar = new ScilabDouble(28); } else if ((this.ot==3)) { - model.ipar = 29; + this.model.ipar = new ScilabDouble(29); } else if ((this.ot==4)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==5)) { - model.ipar = 30; + this.model.ipar = new ScilabDouble(30); } else if ((this.ot==6)) { - model.ipar = 31; + this.model.ipar = new ScilabDouble(31); } else if ((this.ot==8)) { - model.ipar = 32; + this.model.ipar = new ScilabDouble(32); } } else if ((this.it==8)) { if ((this.ot==1)) { - model.ipar = 33; + this.model.ipar = new ScilabDouble(33); } else if ((this.ot==3)) { - model.ipar = 34; + this.model.ipar = new ScilabDouble(34); } else if ((this.ot==4)) { - model.ipar = 35; + this.model.ipar = new ScilabDouble(35); } else if ((this.ot==5)) { - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); } else if ((this.ot==6)) { - model.ipar = 36; + this.model.ipar = new ScilabDouble(36); } else if ((this.ot==7)) { - model.ipar = 37; + this.model.ipar = new ScilabDouble(37); } } } else if ((this.np==1)) { if ((this.it==1)) { if ((this.ot==3)) { - model.ipar = 38; + this.model.ipar = new ScilabDouble(38); } else if ((this.ot==4)) { - model.ipar = 39; + this.model.ipar = new ScilabDouble(39); } else if ((this.ot==5)) { - model.ipar = 40; + this.model.ipar = new ScilabDouble(40); } else if ((this.ot==6)) { - model.ipar = 41; + this.model.ipar = new ScilabDouble(41); } else if ((this.ot==7)) { - model.ipar = 42; + this.model.ipar = new ScilabDouble(42); } else if ((this.ot==8)) { - model.ipar = 43; + this.model.ipar = new ScilabDouble(43); } } else if ((this.it==3)) { if ((this.ot==1)) { - model.ipar = 8; + this.model.ipar = new ScilabDouble(8); } else if ((this.ot==4)) { - model.ipar = 44; + this.model.ipar = new ScilabDouble(44); } else if ((this.ot==5)) { - model.ipar = 45; + this.model.ipar = new ScilabDouble(45); } else if ((this.ot==6)) { - model.ipar = 46; + this.model.ipar = new ScilabDouble(46); } else if ((this.ot==7)) { - model.ipar = 47; + this.model.ipar = new ScilabDouble(47); } else if ((this.ot==8)) { - model.ipar = 48; + this.model.ipar = new ScilabDouble(48); } } else if ((this.it==4)) { if ((this.ot==1)) { - model.ipar = 13; + this.model.ipar = new ScilabDouble(13); } else if ((this.ot==3)) { - model.ipar = 14; + this.model.ipar = new ScilabDouble(14); } else if ((this.ot==5)) { - model.ipar = 49; + this.model.ipar = new ScilabDouble(49); } else if ((this.ot==6)) { - model.ipar = 50; + this.model.ipar = new ScilabDouble(50); } else if ((this.ot==7)) { - model.ipar = 51; + this.model.ipar = new ScilabDouble(51); } else if ((this.ot==8)) { - model.ipar = 52; + this.model.ipar = new ScilabDouble(52); } } else if ((this.it==5)) { if ((this.ot==1)) { - model.ipar = 18; + this.model.ipar = new ScilabDouble(18); } else if ((this.ot==3)) { - model.ipar = 19; + this.model.ipar = new ScilabDouble(19); } else if ((this.ot==4)) { - model.ipar = 20; + this.model.ipar = new ScilabDouble(20); } else if ((this.ot==6)) { - model.ipar = 53; + this.model.ipar = new ScilabDouble(53); } else if ((this.ot==7)) { - model.ipar = 54; + this.model.ipar = new ScilabDouble(54); } else if ((this.ot==8)) { - model.ipar = 55; + this.model.ipar = new ScilabDouble(55); } } else if ((this.it==6)) { if ((this.ot==1)) { - model.ipar = 23; + this.model.ipar = new ScilabDouble(23); } else if ((this.ot==3)) { - model.ipar = 56; + this.model.ipar = new ScilabDouble(56); } else if ((this.ot==4)) { - model.ipar = 57; + this.model.ipar = new ScilabDouble(57); } else if ((this.ot==5)) { - model.ipar = 58; + this.model.ipar = new ScilabDouble(58); } else if ((this.ot==7)) { - model.ipar = 59; + this.model.ipar = new ScilabDouble(59); } else if ((this.ot==8)) { - model.ipar = 60; + this.model.ipar = new ScilabDouble(60); } } else if ((this.it==7)) { if ((this.ot==1)) { - model.ipar = 28; + this.model.ipar = new ScilabDouble(28); } else if ((this.ot==3)) { - model.ipar = 29; + this.model.ipar = new ScilabDouble(29); } else if ((this.ot==4)) { - model.ipar = 61; + this.model.ipar = new ScilabDouble(61); } else if ((this.ot==5)) { - model.ipar = 62; + this.model.ipar = new ScilabDouble(62); } else if ((this.ot==6)) { - model.ipar = 31; + this.model.ipar = new ScilabDouble(31); } else if ((this.ot==8)) { - model.ipar = 63; + this.model.ipar = new ScilabDouble(63); } } else if ((this.it==8)) { if ((this.ot==1)) { - model.ipar = 33; + this.model.ipar = new ScilabDouble(33); } else if ((this.ot==3)) { - model.ipar = 34; + this.model.ipar = new ScilabDouble(34); } else if ((this.ot==4)) { - model.ipar = 35; + this.model.ipar = new ScilabDouble(35); } else if ((this.ot==5)) { - model.ipar = 64; + this.model.ipar = new ScilabDouble(64); } else if ((this.ot==6)) { - model.ipar = 36; + this.model.ipar = new ScilabDouble(36); } else if ((this.ot==7)) { - model.ipar = 37; + this.model.ipar = new ScilabDouble(37); } } } else if ((this.np==2)) { if ((this.it==1)) { if ((this.ot==3)) { - model.ipar = 65; + this.model.ipar = new ScilabDouble(65); } else if ((this.ot==4)) { - model.ipar = 66; + this.model.ipar = new ScilabDouble(66); } else if ((this.ot==5)) { - model.ipar = 67; + this.model.ipar = new ScilabDouble(67); } else if ((this.ot==6)) { - model.ipar = 68; + this.model.ipar = new ScilabDouble(68); } else if ((this.ot==7)) { - model.ipar = 69; + this.model.ipar = new ScilabDouble(69); } else if ((this.ot==8)) { - model.ipar = 70; + this.model.ipar = new ScilabDouble(70); } } else if ((this.it==3)) { if ((this.ot==1)) { - model.ipar = 8; + this.model.ipar = new ScilabDouble(8); } else if ((this.ot==4)) { - model.ipar = 71; + this.model.ipar = new ScilabDouble(71); } else if ((this.ot==5)) { - model.ipar = 72; + this.model.ipar = new ScilabDouble(72); } else if ((this.ot==6)) { - model.ipar = 73; + this.model.ipar = new ScilabDouble(73); } else if ((this.ot==7)) { - model.ipar = 74; + this.model.ipar = new ScilabDouble(74); } else if ((this.ot==8)) { - model.ipar = 75; + this.model.ipar = new ScilabDouble(75); } } else if ((this.it==4)) { if ((this.ot==1)) { - model.ipar = 13; + this.model.ipar = new ScilabDouble(13); } else if ((this.ot==3)) { - model.ipar = 14; + this.model.ipar = new ScilabDouble(14); } else if ((this.ot==5)) { - model.ipar = 76; + this.model.ipar = new ScilabDouble(76); } else if ((this.ot==6)) { - model.ipar = 77; + this.model.ipar = new ScilabDouble(77); } else if ((this.ot==7)) { - model.ipar = 78; + this.model.ipar = new ScilabDouble(78); } else if ((this.ot==8)) { - model.ipar = 79; + this.model.ipar = new ScilabDouble(79); } } else if ((this.it==5)) { if ((this.ot==1)) { - model.ipar = 18; + this.model.ipar = new ScilabDouble(18); } else if ((this.ot==3)) { - model.ipar = 19; + this.model.ipar = new ScilabDouble(19); } else if ((this.ot==4)) { - model.ipar = 20; + this.model.ipar = new ScilabDouble(20); } else if ((this.ot==6)) { - model.ipar = 80; + this.model.ipar = new ScilabDouble(80); } else if ((this.ot==7)) { - model.ipar = 81; + this.model.ipar = new ScilabDouble(81); } else if ((this.ot==8)) { - model.ipar = 82; + this.model.ipar = new ScilabDouble(82); } } else if ((this.it==6)) { if ((this.ot==1)) { - model.ipar = 23; + this.model.ipar = new ScilabDouble(23); } else if ((this.ot==3)) { - model.ipar = 83; + this.model.ipar = new ScilabDouble(83); } else if ((this.ot==4)) { - model.ipar = 84; + this.model.ipar = new ScilabDouble(84); } else if ((this.ot==5)) { - model.ipar = 85; + this.model.ipar = new ScilabDouble(85); } else if ((this.ot==7)) { - model.ipar = 86; + this.model.ipar = new ScilabDouble(86); } else if ((this.ot==8)) { - model.ipar = 87; + this.model.ipar = new ScilabDouble(87); } } else if ((this.it==7)) { if ((this.ot==1)) { - model.ipar = 28; + this.model.ipar = new ScilabDouble(28); } else if ((this.ot==3)) { - model.ipar = 29; + this.model.ipar = new ScilabDouble(29); } else if ((this.ot==4)) { - model.ipar = 88; + this.model.ipar = new ScilabDouble(88); } else if ((this.ot==5)) { - model.ipar = 89; + this.model.ipar = new ScilabDouble(89); } else if ((this.ot==6)) { - model.ipar = 31; + this.model.ipar = new ScilabDouble(31); } else if ((this.ot==8)) { - model.ipar = 90; + this.model.ipar = new ScilabDouble(90); } } else if ((this.it==8)) { if ((this.ot==1)) { - model.ipar = 33; + this.model.ipar = new ScilabDouble(33); } else if ((this.ot==3)) { - model.ipar = 34; + this.model.ipar = new ScilabDouble(34); } else if ((this.ot==4)) { - model.ipar = 35; + this.model.ipar = new ScilabDouble(35); } else if ((this.ot==5)) { - model.ipar = 91; + this.model.ipar = new ScilabDouble(91); } else if ((this.ot==6)) { - model.ipar = 36; + this.model.ipar = new ScilabDouble(36); } else if ((this.ot==7)) { - model.ipar = 37; + this.model.ipar = new ScilabDouble(37); } } } } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(out,this.ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(out,this.ot),[],[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/IntegerOp/CONVERT.pickle b/js/IntegerOp/CONVERT.pickle index d341b99c..d6c96c75 100644 --- a/js/IntegerOp/CONVERT.pickle +++ b/js/IntegerOp/CONVERT.pickle @@ -6,12 +6,14 @@ S'np' p2 aS'x' p3 -aS'ot' +aS'model' p4 -aS'it' +aS'ot' p5 -atp6 -Rp7 +aS'it' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/DFLIPFLOP.js b/js/IntegerOp/DFLIPFLOP.js index 4504f55d..b8c6a7a5 100644 --- a/js/IntegerOp/DFLIPFLOP.js +++ b/js/IntegerOp/DFLIPFLOP.js @@ -76,20 +76,20 @@ function DFLIPFLOP() { scs_m.objs[42-1] = scicos_link(xx=[[253.72572],[253.72156]],yy=[[309.29537],[305.95927]],id="drawlink",thick=[0,0],ct=[5,-1],from=[41,1,0],to=[4,1,1]); scs_m.objs[43-1] = scicos_link(xx=[[253.72572],[312.19705],[312.19705]],yy=[[309.29537],[309.29537],[299.28749]],id="drawlink",thick=[0,0],ct=[5,-1],from=[41,2,0],to=[32,1,1]); scs_m.objs[44-1] = scicos_link(xx=[[279.98293],[279.98293],[325.53038],[325.53038]],yy=[[372.50232],[315.89455],[315.89455],[299.28749]],id="drawlink",thick=[0,0],ct=[5,-1],from=[2,2,0],to=[32,2,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1],[1]]; - model.in2 = [[1],[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,1,1]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1],[1]]; + this.model.in2 = [[1],[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,1,1]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } DFLIPFLOP.prototype.details = function DFLIPFLOP() { diff --git a/js/IntegerOp/DFLIPFLOP.pickle b/js/IntegerOp/DFLIPFLOP.pickle index 11601ed1..f92835f1 100644 --- a/js/IntegerOp/DFLIPFLOP.pickle +++ b/js/IntegerOp/DFLIPFLOP.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'scs_m_1.objs[9-1]' p1 diff --git a/js/IntegerOp/DLATCH.js b/js/IntegerOp/DLATCH.js index 2ee55465..43c4d012 100644 --- a/js/IntegerOp/DLATCH.js +++ b/js/IntegerOp/DLATCH.js @@ -21,20 +21,20 @@ function DLATCH() { scs_m.objs[17-1] = scicos_link(xx=[[386.03841],[406.03841]],yy=[[329.46812],[329.46812]],id="drawlink",thick=[0,0],ct=[1,1],from=[8,1,0],to=[16,1,1]); scs_m.objs[18-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[325.09603,270.83282],sz=[20,20],flip=true,theta=0,exprs="1",pin=19,pout=[],pein=[],peout=[],gr_i=list(" ",8),id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[19-1] = scicos_link(xx=[[305.09603],[325.09603]],yy=[[280.83282],[280.83282]],id="drawlink",thick=[0,0],ct=[1,1],from=[10,2,0],to=[18,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,-1]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,-1]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } DLATCH.prototype.details = function DLATCH() { diff --git a/js/IntegerOp/DLATCH.pickle b/js/IntegerOp/DLATCH.pickle index 17f74656..06eaaaef 100644 --- a/js/IntegerOp/DLATCH.pickle +++ b/js/IntegerOp/DLATCH.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/IntegerOp/EXTRACTBITS.js b/js/IntegerOp/EXTRACTBITS.js index 34680bbe..ee87859f 100644 --- a/js/IntegerOp/EXTRACTBITS.js +++ b/js/IntegerOp/EXTRACTBITS.js @@ -2,20 +2,20 @@ function EXTRACTBITS() { EXTRACTBITS.prototype.define = function EXTRACTBITS() { numb = []; - model = scicos_model(); - model.sim = list("extract_bit_32_UH0",4); - model.in1 = 1; - model.in2 = 1; - model.out = 1; - model.out2 = 1; - model.intyp = 3; - model.outtyp = 3; - model.ipar = [0,numb]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("extract_bit_32_UH0",4); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.ipar = [0,numb]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(1)],[sci2exp(0)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXTRACTBITS.prototype.details = function EXTRACTBITS() { @@ -38,7 +38,7 @@ function EXTRACTBITS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Datatype,this.rule,this.bit,this.scal,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","EXTRACTBITS")],[" "],["Bits Extraction"],[" "],[" - Bits to Extract:"],[" 1 Upper Half"],[" 2 Lower Half"],[" 3 Range from MSB"],[" 4 Range to LSB"],[" 5 Range of Bits"],[" - Number of Bits or Index of bit : Index 0 is LSB"],[" If \'Bits to Extract\' is set to \'Range of bits\': [Start, End]"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Bits to extract","Number of Bits or Index of Bit","Treat Bit Field as an Integer (0:No, 1:Yes)"],list("vec",1,"vec",1,"vec",-1,"vec",1),exprs); if (!ok) { @@ -52,7 +52,7 @@ function EXTRACTBITS() { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Treat Bit Field as an Integer",this.scal),msprintf("Must be in the interval %s.","[0, 1]")); ok = false; } else { - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; this.bit = int(this.bit); this.rule = int(this.rule); if ((this.rule==3)||(this.rule==4)) { @@ -87,41 +87,41 @@ function EXTRACTBITS() { case 1: switch (this.scal) { case 0: - model.sim = list("extract_bit_32_UH0",4); + this.model.sim = list("extract_bit_32_UH0",4); case 1: switch (this.Datatype) { case 3: - model.sim = list("extract_bit_32_UH1",4); + this.model.sim = list("extract_bit_32_UH1",4); case 6: - model.sim = list("extract_bit_u32_UH1",4); + this.model.sim = list("extract_bit_u32_UH1",4); } } case 2: - model.sim = list("extract_bit_32_LH",4); + this.model.sim = list("extract_bit_32_LH",4); case 3: switch (this.scal) { case 0: - model.sim = list("extract_bit_32_MSB0",4); + this.model.sim = list("extract_bit_32_MSB0",4); case 1: switch (this.Datatype) { case 3: - model.sim = list("extract_bit_32_MSB1",4); + this.model.sim = list("extract_bit_32_MSB1",4); case 6: - model.sim = list("extract_bit_u32_MSB1",4); + this.model.sim = list("extract_bit_u32_MSB1",4); } } case 4: - model.sim = list("extract_bit_32_LSB",4); + this.model.sim = list("extract_bit_32_LSB",4); case 5: switch (this.scal) { case 0: - model.sim = list("extract_bit_32_RB0",4); + this.model.sim = list("extract_bit_32_RB0",4); case 1: switch (this.Datatype) { case 3: - model.sim = list("extract_bit_32_RB1",4); + this.model.sim = list("extract_bit_32_RB1",4); case 6: - model.sim = list("extract_bit_u32_RB1",4); + this.model.sim = list("extract_bit_u32_RB1",4); } } } @@ -134,41 +134,41 @@ function EXTRACTBITS() { case 1: switch (this.scal) { case 0: - model.sim = list("extract_bit_16_UH0",4); + this.model.sim = list("extract_bit_16_UH0",4); case 1: switch (this.Datatype) { case 4: - model.sim = list("extract_bit_16_UH1",4); + this.model.sim = list("extract_bit_16_UH1",4); case 7: - model.sim = list("extract_bit_u16_UH1",4); + this.model.sim = list("extract_bit_u16_UH1",4); } } case 2: - model.sim = list("extract_bit_16_LH",4); + this.model.sim = list("extract_bit_16_LH",4); case 3: switch (this.scal) { case 0: - model.sim = list("extract_bit_16_MSB0",4); + this.model.sim = list("extract_bit_16_MSB0",4); case 1: switch (this.Datatype) { case 4: - model.sim = list("extract_bit_16_MSB1",4); + this.model.sim = list("extract_bit_16_MSB1",4); case 7: - model.sim = list("extract_bit_u16_MSB1",4); + this.model.sim = list("extract_bit_u16_MSB1",4); } } case 4: - model.sim = list("extract_bit_16_LSB",4); + this.model.sim = list("extract_bit_16_LSB",4); case 5: switch (this.scal) { case 0: - model.sim = list("extract_bit_16_RB0",4); + this.model.sim = list("extract_bit_16_RB0",4); case 1: switch (this.Datatype) { case 4: - model.sim = list("extract_bit_16_RB1",4); + this.model.sim = list("extract_bit_16_RB1",4); case 7: - model.sim = list("extract_bit_u16_RB1",4); + this.model.sim = list("extract_bit_u16_RB1",4); } } } @@ -181,41 +181,41 @@ function EXTRACTBITS() { case 1: switch (this.scal) { case 0: - model.sim = list("extract_bit_8_UH0",4); + this.model.sim = list("extract_bit_8_UH0",4); case 1: switch (this.Datatype) { case 5: - model.sim = list("extract_bit_8_UH1",4); + this.model.sim = list("extract_bit_8_UH1",4); case 8: - model.sim = list("extract_bit_u8_UH1",4); + this.model.sim = list("extract_bit_u8_UH1",4); } } case 2: - model.sim = list("extract_bit_8_LH",4); + this.model.sim = list("extract_bit_8_LH",4); case 3: switch (this.scal) { case 0: - model.sim = list("extract_bit_8_MSB0",4); + this.model.sim = list("extract_bit_8_MSB0",4); case 1: switch (this.Datatype) { case 5: - model.sim = list("extract_bit_8_MSB1",4); + this.model.sim = list("extract_bit_8_MSB1",4); case 8: - model.sim = list("extract_bit_u8_MSB1",4); + this.model.sim = list("extract_bit_u8_MSB1",4); } } case 4: - model.sim = list("extract_bit_8_LSB",4); + this.model.sim = list("extract_bit_8_LSB",4); case 5: switch (this.scal) { case 0: - model.sim = list("extract_bit_8_RB0",4); + this.model.sim = list("extract_bit_8_RB0",4); case 1: switch (this.Datatype) { case 5: - model.sim = list("extract_bit_8_RB1",4); + this.model.sim = list("extract_bit_8_RB1",4); case 8: - model.sim = list("extract_bit_u8_RB1",4); + this.model.sim = list("extract_bit_u8_RB1",4); } } } @@ -228,13 +228,13 @@ function EXTRACTBITS() { it = this.Datatype; ot = this.Datatype; out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { graphics.exprs = exprs; - model.ipar = [[int(this.bit.slice())],[int(numb.slice())]]; + this.model.ipar = [[int(this.bit.slice())],[int(numb.slice())]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/IntegerOp/EXTRACTBITS.pickle b/js/IntegerOp/EXTRACTBITS.pickle index a1d56c93..774cc6d6 100644 --- a/js/IntegerOp/EXTRACTBITS.pickle +++ b/js/IntegerOp/EXTRACTBITS.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'Datatype' +S'scal' p2 -aS'x' +aS'Datatype' p3 -aS'bit' +aS'rule' p4 -aS'scal' +aS'x' p5 -aS'rule' +aS'model' p6 -atp7 -Rp8 +aS'bit' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/INTMUL.js b/js/IntegerOp/INTMUL.js index baf80d47..a5174c26 100644 --- a/js/IntegerOp/INTMUL.js +++ b/js/IntegerOp/INTMUL.js @@ -2,21 +2,21 @@ function INTMUL() { INTMUL.prototype.define = function INTMUL() { sgn = 0; - model = scicos_model(); - model.sim = list("matmul_i32",4); - model.in1 = [[-1],[-2]]; - model.out = -1; - model.in2 = [[-2],[-3]]; - model.out2 = -3; - model.intyp = [3,3]; - model.outtyp = 3; - model.rpar = []; - model.ipar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("matmul_i32",4); + this.model.in1 = [[-1],[-2]]; + this.model.out = new ScilabDouble(-1); + this.model.in2 = [[-2],[-3]]; + this.model.out2 = new ScilabDouble(-3); + this.model.intyp = [3,3]; + this.model.outtyp = new ScilabDouble(3); + this.model.rpar = []; + this.model.ipar = new ScilabDouble(sgn); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTMUL.prototype.details = function INTMUL() { @@ -34,7 +34,7 @@ function INTMUL() { this.np = arguments[0]["np"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.Datatype,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","INTMUL")],[" "],["Integer matrix multiplication"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1),exprs); @@ -48,66 +48,66 @@ function INTMUL() { ok = false; } else if (this.Datatype==3) { if (this.np==0) { - model.sim = list("matmul_i32n",4); + this.model.sim = list("matmul_i32n",4); } else if (this.np==1) { - model.sim = list("matmul_i32s",4); + this.model.sim = list("matmul_i32s",4); } else { - model.sim = list("matmul_i32e",4); + this.model.sim = list("matmul_i32e",4); } } else if (this.Datatype==4) { if (this.np==0) { - model.sim = list("matmul_i16n",4); + this.model.sim = list("matmul_i16n",4); } else if (this.np==1) { - model.sim = list("matmul_i16s",4); + this.model.sim = list("matmul_i16s",4); } else { - model.sim = list("matmul_i16e",4); + this.model.sim = list("matmul_i16e",4); } } else if (this.Datatype==5) { if (this.np==0) { - model.sim = list("matmul_i8n",4); + this.model.sim = list("matmul_i8n",4); } else if (this.np==1) { - model.sim = list("matmul_i8s",4); + this.model.sim = list("matmul_i8s",4); } else { - model.sim = list("matmul_i8e",4); + this.model.sim = list("matmul_i8e",4); } } else if (this.Datatype==6) { if (this.np==0) { - model.sim = list("matmul_ui32n",4); + this.model.sim = list("matmul_ui32n",4); } else if (this.np==1) { - model.sim = list("matmul_ui32s",4); + this.model.sim = list("matmul_ui32s",4); } else { - model.sim = list("matmul_ui32e",4); + this.model.sim = list("matmul_ui32e",4); } } else if (this.Datatype==7) { if (this.np==0) { - model.sim = list("matmul_ui16n",4); + this.model.sim = list("matmul_ui16n",4); } else if (this.np==1) { - model.sim = list("matmul_ui16s",4); + this.model.sim = list("matmul_ui16s",4); } else { - model.sim = list("matmul_ui16e",4); + this.model.sim = list("matmul_ui16e",4); } } else if (this.Datatype==8) { if (this.np==0) { - model.sim = list("matmul_ui8n",4); + this.model.sim = list("matmul_ui8n",4); } else if (this.np==1) { - model.sim = list("matmul_ui8s",4); + this.model.sim = list("matmul_ui8s",4); } else { - model.sim = list("matmul_ui8e",4); + this.model.sim = list("matmul_ui8e",4); } } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",ot),msprintf("Must be in the interval %s.","[3, 8]")); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.ipar = this.np; + this.model.ipar = new ScilabDouble(this.np); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/IntegerOp/INTMUL.pickle b/js/IntegerOp/INTMUL.pickle index 3b7d4302..d88ed7ab 100644 --- a/js/IntegerOp/INTMUL.pickle +++ b/js/IntegerOp/INTMUL.pickle @@ -6,10 +6,12 @@ S'Datatype' p2 aS'x' p3 -aS'np' +aS'model' p4 -atp5 -Rp6 +aS'np' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/JKFLIPFLOP.js b/js/IntegerOp/JKFLIPFLOP.js index 5f5e59ef..b855e347 100644 --- a/js/IntegerOp/JKFLIPFLOP.js +++ b/js/IntegerOp/JKFLIPFLOP.js @@ -32,20 +32,20 @@ function JKFLIPFLOP() { scs_m.objs[20-1] = scicos_link(xx=[[368.82793],[388.82793]],yy=[[243.45067],[243.45067]],id="drawlink",thick=[0,0],ct=[1,1],from=[6,2,0],to=[19,1,1]); scs_m.objs[21-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[466.2036,169.25363],sz=[20,20],flip=true,theta=0,exprs="2",pin=22,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=2,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[22-1] = scicos_link(xx=[[446.2036],[466.2036]],yy=[[179.25363],[179.25363]],id="drawlink",thick=[0,0],ct=[1,1],from=[9,1,0],to=[21,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1],[1]]; - model.in2 = [[1],[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,1,5]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1],[1]]; + this.model.in2 = [[1],[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,1,5]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } JKFLIPFLOP.prototype.details = function JKFLIPFLOP() { @@ -69,8 +69,8 @@ function JKFLIPFLOP() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs[1-1]; - model = xx.model; - init_old = model.odstate[1-1]; + this.model = xx.model; + init_old = this.model.odstate[1-1]; while (true) { [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","JKFLIPFLOP")],[" "],["JK flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); if (!ok) { @@ -83,8 +83,8 @@ function JKFLIPFLOP() { } if (ok) { xx.graphics.exprs[1-1] = this.exprs0; - model.odstate[1-1] = this.init; - xx.model = model; + this.model.odstate[('1', 'double')] = new ScilabDouble(this.init); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } diff --git a/js/IntegerOp/JKFLIPFLOP.pickle b/js/IntegerOp/JKFLIPFLOP.pickle index eb4fda69..63f7c4d7 100644 --- a/js/IntegerOp/JKFLIPFLOP.pickle +++ b/js/IntegerOp/JKFLIPFLOP.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'init' +aS'model' p3 -aS'exprs0' +aS'init' p4 -atp5 -Rp6 +aS'exprs0' +p5 +atp6 +Rp7 .(dp0 S'xx.model' p1 @@ -87,7 +89,7 @@ g7 sS'scs_m_1' p29 g7 -sS'scs_m.objs[22-1]' +sS'scs_m.objs[9-1]' p30 g7 sS'scs_m_1.objs[2-1]' @@ -112,72 +114,72 @@ g11 sS'scs_m.objs[6-1]' p38 g7 -sS'scs_m.objs[9-1]' +sS'scs_m_1.objs[4-1]' p39 g7 -sS'model.odstate[1-1]' -p40 -g7 sS'model.out2' -p41 +p40 g11 sS'model.intyp' -p42 +p41 g26 sS'model.rpar' -p43 +p42 g7 sS'scs_m.objs[3-1]' -p44 +p43 g7 -sS'scs_m_1.objs[4-1]' -p45 +sS"model.odstate[('1', 'double')]" +p44 g7 sS'scs_m.objs[16-1]' -p46 +p45 g7 sS'scs_m.objs[11-1]' -p47 +p46 g7 sS'scs_m.objs[14-1]' -p48 +p47 g7 sS'scs_m.objs[17-1]' -p49 +p48 g7 sS'scs_m_1.objs[5-1]' -p50 +p49 g7 sS'path' -p51 +p50 NsS'scs_m.objs[4-1]' -p52 +p51 g7 sS'scs_m.objs[7-1]' -p53 +p52 g7 sS'typ' -p54 +p53 g26 sS'model.outtyp' -p55 +p54 g26 sS'needcompile' -p56 +p55 g7 sS'arg1.model' -p57 +p56 g2 sS'model.blocktype' -p58 +p57 g4 sS'scs_m.objs[8-1]' -p59 +p58 g7 sS'scs_m.objs[15-1]' -p60 +p59 g7 sS'scs_m.objs[21-1]' +p60 +g7 +sS'scs_m.objs[22-1]' p61 g7 sS'scs_m_1.objs[1-1]' diff --git a/js/IntegerOp/LOGIC.js b/js/IntegerOp/LOGIC.js index 9316c3bf..bd8d7406 100644 --- a/js/IntegerOp/LOGIC.js +++ b/js/IntegerOp/LOGIC.js @@ -2,22 +2,22 @@ function LOGIC() { LOGIC.prototype.define = function LOGIC() { this.mat = [[0],[0],[0],[1]]; - model = scicos_model(); - model.sim = list("logic",4); - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.out = 1; - model.out2 = 1; - model.evtin = 1; - model.intyp = [5,5]; - model.outtyp = 5; - model.opar = list(int8(this.mat)); - model.blocktype = "c"; - model.firing = false; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("logic",4); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.intyp = [5,5]; + this.model.outtyp = new ScilabDouble(5); + this.model.opar = list(int8(this.mat)); + this.model.blocktype = new ScilabString("c"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.mat)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOGIC.prototype.details = function LOGIC() { @@ -36,7 +36,7 @@ function LOGIC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.mat,this.herit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","LOGIC")],[" "],["Combinatorial logic"],[" "],[" Rows of the matrix are the output values"],[" Number of rows must be a power of two."],[" Number of columns gives the number of outputs."],[" "]],["Truth Table (matrix of outputs)","Accepts Inherited Events (0:No, 1:Yes)"],list("mat",[-1,-2],"vec",1),exprs); if (!ok) { @@ -60,14 +60,14 @@ function LOGIC() { out = [ones(nout,1),ones(nout,1)]; it = 5*ones(1,nin); ot = 5*ones(1,nout); - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.herit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.herit,1),[]); } if (ok) { graphics.exprs = exprs; this.mat = int8(this.mat); - model.opar = list(this.mat); + this.model.opar = list(this.mat); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/IntegerOp/LOGIC.pickle b/js/IntegerOp/LOGIC.pickle index 90e666b6..693abb46 100644 --- a/js/IntegerOp/LOGIC.pickle +++ b/js/IntegerOp/LOGIC.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'herit' +aS'model' p3 -aS'mat' +aS'herit' p4 -atp5 -Rp6 +aS'mat' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/SHIFT.js b/js/IntegerOp/SHIFT.js index fa5fae76..a3ac6a6e 100644 --- a/js/IntegerOp/SHIFT.js +++ b/js/IntegerOp/SHIFT.js @@ -3,21 +3,21 @@ function SHIFT() { SHIFT.prototype.define = function SHIFT() { sgn = [[0],[0]]; OPER = 0; - model = scicos_model(); - model.sim = list("shift_32_LA",4); - model.in1 = -1; - model.out = -1; - model.in2 = -2; - model.out2 = -2; - model.intyp = 3; - model.outtyp = 3; - model.rpar = []; - model.ipar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("shift_32_LA",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(3); + this.model.outtyp = new ScilabDouble(3); + this.model.rpar = []; + this.model.ipar = sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(3)],[sci2exp(0)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SHIFT.prototype.details = function SHIFT() { @@ -37,7 +37,7 @@ function SHIFT() { this.np = arguments[0]["np"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.Datatype,this.nb,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","SHIFT")],[" "],["Shift/Rotates bits"]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Number of Bits to Shift Left (Negative number to shift right)","Shift Type (0:Arithmetic, 1:Circular)"],list("vec",1,"vec",1,"vec",1),exprs); @@ -54,63 +54,63 @@ function SHIFT() { if (this.nb>0) { switch (this.np) { case 0: - model.sim = list("shift_32_LA",4); + this.model.sim = list("shift_32_LA",4); case 1: - model.sim = list("shift_32_LC",4); + this.model.sim = list("shift_32_LC",4); } } else if (this.nb<0) { switch (this.np) { case 0: switch (this.Datatype) { case 3: - model.sim = list("shift_32_RA",4); + this.model.sim = list("shift_32_RA",4); case 6: - model.sim = list("shift_u32_RA",4); + this.model.sim = list("shift_u32_RA",4); } case 1: - model.sim = list("shift_32_RC",4); + this.model.sim = list("shift_32_RC",4); } } } else if ((this.Datatype==4||this.Datatype==7)) { if (this.nb>0) { switch (this.np) { case 0: - model.sim = list("shift_16_LA",4); + this.model.sim = list("shift_16_LA",4); case 1: - model.sim = list("shift_16_LC",4); + this.model.sim = list("shift_16_LC",4); } } else if (this.nb<0) { switch (this.np) { case 0: switch (this.Datatype) { case 4: - model.sim = list("shift_16_RA",4); + this.model.sim = list("shift_16_RA",4); case 7: - model.sim = list("shift_u16_RA",4); + this.model.sim = list("shift_u16_RA",4); } case 1: - model.sim = list("shift_16_RC",4); + this.model.sim = list("shift_16_RC",4); } } } else if ((this.Datatype==5||this.Datatype==8)) { if (this.nb>0) { switch (this.np) { case 0: - model.sim = list("shift_8_LA",4); + this.model.sim = list("shift_8_LA",4); case 1: - model.sim = list("shift_8_LC",4); + this.model.sim = list("shift_8_LC",4); } } else if (this.nb<0) { switch (this.np) { case 0: switch (this.Datatype) { case 5: - model.sim = list("shift_8_RA",4); + this.model.sim = list("shift_8_RA",4); case 8: - model.sim = list("shift_u8_RA",4); + this.model.sim = list("shift_u8_RA",4); } case 1: - model.sim = list("shift_8_RC",4); + this.model.sim = list("shift_8_RC",4); } } } else { @@ -118,13 +118,13 @@ function SHIFT() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([-1,-2],it),list([-1,-2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],it),list([-1,-2],ot),[],[]); } if (ok) { - model.ipar = this.nb; + this.model.ipar = new ScilabDouble(this.nb); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/IntegerOp/SHIFT.pickle b/js/IntegerOp/SHIFT.pickle index fca9045b..5c46c422 100644 --- a/js/IntegerOp/SHIFT.pickle +++ b/js/IntegerOp/SHIFT.pickle @@ -6,12 +6,14 @@ S'Datatype' p2 aS'x' p3 -aS'nb' +aS'model' p4 aS'np' p5 -atp6 -Rp7 +aS'nb' +p6 +atp7 +Rp8 .(dp0 S'OPER' p1 diff --git a/js/IntegerOp/SRFLIPFLOP.js b/js/IntegerOp/SRFLIPFLOP.js index 9a05ad70..354f75f6 100644 --- a/js/IntegerOp/SRFLIPFLOP.js +++ b/js/IntegerOp/SRFLIPFLOP.js @@ -16,20 +16,20 @@ function SRFLIPFLOP() { scs_m.objs[12-1] = scicos_link(xx=[[269.93257],[289.93257]],yy=[[211.45067],[211.45067]],id="drawlink",thick=[0,0],ct=[1,1],from=[11,1,0],to=[1,3,1]); scs_m.objs[13-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[383.03733,238.584],sz=[20,20],flip=true,theta=0,exprs="1",pin=14,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[14-1] = scicos_link(xx=[[363.03733],[383.03733]],yy=[[248.584],[248.584]],id="drawlink",thick=[0,0],ct=[1,1],from=[5,2,0],to=[13,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.out = [[1],[1]]; - model.out2 = [[1],[1]]; - model.intyp = [5,5]; - model.outtyp = [5,5]; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [true,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.out = [[1],[1]]; + this.model.out2 = [[1],[1]]; + this.model.intyp = [5,5]; + this.model.outtyp = [5,5]; + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,3],model,[],gr_i); + this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } SRFLIPFLOP.prototype.details = function SRFLIPFLOP() { @@ -53,8 +53,8 @@ function SRFLIPFLOP() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs[1-1]; - model = xx.model; - init_old = model.odstate[1-1]; + this.model = xx.model; + init_old = this.model.odstate[1-1]; while (true) { [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","SRFLIPFLOP")],[" "],["SR flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); if (!ok) { @@ -67,8 +67,8 @@ function SRFLIPFLOP() { } if (ok) { xx.graphics.exprs[1-1] = this.exprs0; - model.odstate[1-1] = this.init; - xx.model = model; + this.model.odstate[('1', 'double')] = new ScilabDouble(this.init); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } diff --git a/js/IntegerOp/SRFLIPFLOP.pickle b/js/IntegerOp/SRFLIPFLOP.pickle index 32690c22..5cc1e7d8 100644 --- a/js/IntegerOp/SRFLIPFLOP.pickle +++ b/js/IntegerOp/SRFLIPFLOP.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'init' +aS'model' p3 -aS'exprs0' +aS'init' p4 -atp5 -Rp6 +aS'exprs0' +p5 +atp6 +Rp7 .(dp0 S'xx.model' p1 @@ -86,39 +88,39 @@ g13 sS'scs_m.objs[9-1]' p29 g13 -sS'model.odstate[1-1]' -p30 -g13 sS'model.out2' -p31 +p30 g8 sS'model.intyp' -p32 +p31 g20 sS'model.rpar' -p33 +p32 g13 sS'scs_m.objs[3-1]' +p33 +g13 +sS"model.odstate[('1', 'double')]" p34 g13 -sS'model.outtyp' -p35 -g20 sS'scs_m.objs[11-1]' -p36 +p35 g13 sS'scs_m.objs[14-1]' -p37 +p36 g13 sS'path' -p38 +p37 NsS'scs_m.objs[4-1]' -p39 +p38 g13 sS'scs_m.objs[7-1]' -p40 +p39 g13 sS'typ' +p40 +g20 +sS'model.outtyp' p41 g20 sS'needcompile' diff --git a/js/Linear/BIGSOM_f.js b/js/Linear/BIGSOM_f.js index e3a3d172..c4c0daca 100644 --- a/js/Linear/BIGSOM_f.js +++ b/js/Linear/BIGSOM_f.js @@ -2,16 +2,16 @@ function BIGSOM_f() { BIGSOM_f.prototype.define = function BIGSOM_f() { this.sgn = [[1],[1]]; - model = scicos_model(); - model.sim = list("sum",2); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.rpar = this.sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("sum",2); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.rpar = this.sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(this.sgn); gr_i = []; - this.x = standard_define([2,3],model,exprs,gr_i); + this.x = standard_define([2,3],this.model,exprs,gr_i); return new BigSom(this.x); } BIGSOM_f.prototype.details = function BIGSOM_f() { @@ -26,7 +26,7 @@ function BIGSOM_f() { this.sgn = inverse(arguments[0]["sgn"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.sgn,exprs] = scicos_getvalue("Set sum block parameters","Inputs ports signs/gain",list("vec",-1),exprs); @@ -34,12 +34,12 @@ function BIGSOM_f() { break; } in1 = -ones(size(this.sgn,"*"),1); - [model,graphics,ok] = check_io(model,graphics,in1,-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,-1,[],[]); if (ok) { - model.rpar = this.sgn.slice(); + this.model.rpar = this.sgn.slice(); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/BIGSOM_f.pickle b/js/Linear/BIGSOM_f.pickle index 5912e580..602dba8d 100644 --- a/js/Linear/BIGSOM_f.pickle +++ b/js/Linear/BIGSOM_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'sgn' +aS'model' p3 -atp4 -Rp5 +aS'sgn' +p4 +atp5 +Rp6 .(dp0 S'sgn' p1 diff --git a/js/Linear/CLINDUMMY_f.js b/js/Linear/CLINDUMMY_f.js index 685fd5d0..e61f81b0 100644 --- a/js/Linear/CLINDUMMY_f.js +++ b/js/Linear/CLINDUMMY_f.js @@ -2,14 +2,14 @@ function CLINDUMMY_f() { CLINDUMMY_f.prototype.define = function CLINDUMMY_f() { x0 = 0; - model = scicos_model(); - model.sim = list("cdummy",4); - model.state = x0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("cdummy",4); + this.model.state = new ScilabDouble(x0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } CLINDUMMY_f.prototype.details = function CLINDUMMY_f() { diff --git a/js/Linear/CLINDUMMY_f.pickle b/js/Linear/CLINDUMMY_f.pickle index 2a8bdb31..3b6bf950 100644 --- a/js/Linear/CLINDUMMY_f.pickle +++ b/js/Linear/CLINDUMMY_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Linear/CLR.js b/js/Linear/CLR.js index 4be593c4..504c40e1 100644 --- a/js/Linear/CLR.js +++ b/js/Linear/CLR.js @@ -7,16 +7,16 @@ function CLR() { C = 1; D = 0; exprs = [["1"],["1+s"]]; - model = scicos_model(); - model.sim = list("csslti4",4); - model.in1 = 1; - model.out = 1; - model.state = x0; - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = new ScilabDouble(x0); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLR.prototype.details = function CLR() { @@ -35,9 +35,9 @@ function CLR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.state; - rpar = model.rpar; + this.model = arg1.model; + x0 = this.model.state; + rpar = this.model.rpar; ns = prod(size(x0)); nin = 1; nout = 1; @@ -63,18 +63,18 @@ function CLR() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } if (ns1<=ns) { x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } - model.state = x0; - model.rpar = rpar; + this.model.state = x0; + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/CLR.pickle b/js/Linear/CLR.pickle index f42a7c70..b2c434a0 100644 --- a/js/Linear/CLR.pickle +++ b/js/Linear/CLR.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'num' +aS'model' p3 -aS'den' +aS'num' p4 -atp5 -Rp6 +aS'den' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/Linear/CLR_f.js b/js/Linear/CLR_f.js index 2aaee3d1..bb1ff3ff 100644 --- a/js/Linear/CLR_f.js +++ b/js/Linear/CLR_f.js @@ -7,16 +7,16 @@ function CLR_f() { C = 1; D = 0; exprs = [["1"],["1+s"]]; - model = scicos_model(); - model.sim = list("csslti",1); - model.in1 = 1; - model.out = 1; - model.state = x0; - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti",1); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = new ScilabDouble(x0); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([2.5,2.5],model,exprs,gr_i); + this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLR_f.prototype.details = function CLR_f() { @@ -35,9 +35,9 @@ function CLR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.state; - rpar = model.rpar; + this.model = arg1.model; + x0 = this.model.state; + rpar = this.model.rpar; ns = prod(size(x0)); nin = 1; nout = 1; @@ -63,18 +63,18 @@ function CLR_f() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } if (ns1<=ns) { x0 = x0.slice(1-1,ns1); } else { x0[ns1-1][1-1] = 0; } - model.state = x0; - model.rpar = rpar; + this.model.state = x0; + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/CLR_f.pickle b/js/Linear/CLR_f.pickle index f42a7c70..b2c434a0 100644 --- a/js/Linear/CLR_f.pickle +++ b/js/Linear/CLR_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'num' +aS'model' p3 -aS'den' +aS'num' p4 -atp5 -Rp6 +aS'den' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/Linear/CLSS.js b/js/Linear/CLSS.js index b227e048..2f336b4a 100644 --- a/js/Linear/CLSS.js +++ b/js/Linear/CLSS.js @@ -8,17 +8,17 @@ function CLSS() { this.D = 0; in1 = 1; out = 1; - model = scicos_model(); - model.sim = list("csslti4",4); - model.in1 = in1; - model.out = out; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLSS.prototype.details = function CLSS() { @@ -46,7 +46,7 @@ function CLSS() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -74,7 +74,7 @@ function CLSS() { if (ms!=ns||!okD) { message(_("Matrix A is not square or D has wrong dimension")); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -84,16 +84,16 @@ function CLSS() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/CLSS.pickle b/js/Linear/CLSS.pickle index 6f9561b1..6d8ee0b4 100644 --- a/js/Linear/CLSS.pickle +++ b/js/Linear/CLSS.pickle @@ -12,10 +12,12 @@ aS'D' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Linear/CLSS_f.js b/js/Linear/CLSS_f.js index ffad604c..2576257d 100644 --- a/js/Linear/CLSS_f.js +++ b/js/Linear/CLSS_f.js @@ -8,17 +8,17 @@ function CLSS_f() { this.D = 0; in1 = 1; out = 1; - model = scicos_model(); - model.sim = list("csslti",1); - model.in1 = in1; - model.out = out; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("csslti",1); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CLSS_f.prototype.details = function CLSS_f() { @@ -46,7 +46,7 @@ function CLSS_f() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -64,7 +64,7 @@ function CLSS_f() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -74,16 +74,16 @@ function CLSS_f() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/CLSS_f.pickle b/js/Linear/CLSS_f.pickle index 1e42cd42..d36e6ca6 100644 --- a/js/Linear/CLSS_f.pickle +++ b/js/Linear/CLSS_f.pickle @@ -12,10 +12,12 @@ aS'D' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Linear/DELAYV_f.js b/js/Linear/DELAYV_f.js index 79cd24be..e2c55b04 100644 --- a/js/Linear/DELAYV_f.js +++ b/js/Linear/DELAYV_f.js @@ -5,20 +5,20 @@ function DELAYV_f() { z0 = zeros(11,1); this.zz0 = z0.slice(1-1,$-1); this.T = 1; - model = scicos_model(); - model.sim = list("delayv",1); - model.in1 = [[this.nin],[1]]; - model.out = this.nin; - model.evtin = 1; - model.evtout = [[1],[1]]; - model.dstate = z0; - model.rpar = this.T/(size(this.zz0,"*")); - model.blocktype = "d"; - model.firing = [0,-1]; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("delayv",1); + this.model.in1 = [[this.nin],[1]]; + this.model.out = new ScilabDouble(this.nin); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = [[1],[1]]; + this.model.dstate = new ScilabDouble(z0); + this.model.rpar = new ScilabDouble(this.T/(size(this.zz0,"*"))); + this.model.blocktype = new ScilabString("d"); + this.model.firing = [0,-1]; + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[strcat(string(z0.slice(1-1,$-1)),";")],[string(this.T)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DELAYV_f.prototype.details = function DELAYV_f() { @@ -39,9 +39,9 @@ function DELAYV_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - this.nin = model.in1[1-1]; - z0 = model.dstate; + this.model = arg1.model; + this.nin = this.model.in1[1-1]; + z0 = this.model.dstate; this.zz0 = z0.slice(1-1,$-1); told = z0[$-1]; while (true) { @@ -58,14 +58,14 @@ function DELAYV_f() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]); + [model,graphics,ok] = check_io(this.model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]); } if (ok) { graphics.exprs = exprs; - model.dstate = [[this.zz0.slice()],[told]]; - model.rpar = this.T/(size(this.zz0,"*")); + this.model.dstate = [[this.zz0.slice()],[told]]; + this.model.rpar = new ScilabDouble(this.T/(size(this.zz0,"*"))); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DELAYV_f.pickle b/js/Linear/DELAYV_f.pickle index 8fe3ebfa..5f5ca1c3 100644 --- a/js/Linear/DELAYV_f.pickle +++ b/js/Linear/DELAYV_f.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'nin' +aS'model' p3 -aS'T' +aS'nin' p4 -aS'zz0' +aS'T' p5 -atp6 -Rp7 +aS'zz0' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/Linear/DERIV.js b/js/Linear/DERIV.js index c52a8979..811fb47a 100644 --- a/js/Linear/DERIV.js +++ b/js/Linear/DERIV.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Linear/DERIV.sci" */ function DERIV() { DERIV.prototype.define = function DERIV() { - model = scicos_model(); - model.sim = list("deriv",4); - model.in1 = -1; - model.out = -1; - model.blocktype = "x"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("deriv",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("x"); + this.model.dep_ut = [true,false]; exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DERIV.prototype.details = function DERIV() { diff --git a/js/Linear/DERIV.pickle b/js/Linear/DERIV.pickle index f4612a1c..7c042e5e 100644 --- a/js/Linear/DERIV.pickle +++ b/js/Linear/DERIV.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Linear/DIFF_c.js b/js/Linear/DIFF_c.js index 11b4281f..9549a346 100644 --- a/js/Linear/DIFF_c.js +++ b/js/Linear/DIFF_c.js @@ -2,16 +2,16 @@ function DIFF_c() { DIFF_c.prototype.define = function DIFF_c() { this.x0 = [[0],[0]]; - model = scicos_model(); - model.sim = list("diffblk_c",10004); - model.in1 = 1; - model.out = 1; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("diffblk_c",10004); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = this.x0; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DIFF_c.prototype.details = function DIFF_c() { @@ -30,7 +30,7 @@ function DIFF_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { ask_again = false; [ok,this.x0,this.xd0,exprs] = scicos_getvalue("Set continuous linear system parameters",["Initial state","Initial Derivative"],list("vec",-1,"vec",-1),exprs); @@ -51,11 +51,11 @@ function DIFF_c() { } if (!ask_again) { graphics.exprs = exprs; - model.state = [[this.x0],[this.xd0]]; - model.out = [N]; - model.in1 = N; + this.model.state = [[this.x0],[this.xd0]]; + this.model.out = [N]; + this.model.in1 = new ScilabDouble(N); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DIFF_c.pickle b/js/Linear/DIFF_c.pickle index 3dd7eaac..cce7a052 100644 --- a/js/Linear/DIFF_c.pickle +++ b/js/Linear/DIFF_c.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'x0' +aS'model' p3 -aS'xd0' +aS'x0' p4 -atp5 -Rp6 +aS'xd0' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/Linear/DLR.js b/js/Linear/DLR.js index 2ad0c0d5..4107e913 100644 --- a/js/Linear/DLR.js +++ b/js/Linear/DLR.js @@ -7,17 +7,17 @@ function DLR() { C = 1; D = 0; exprs = [["1"],["1+z"]]; - model = scicos_model(); - model.sim = list("dsslti4",4); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = x0.slice(); - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dsslti4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = x0.slice(); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLR.prototype.details = function DLR() { @@ -36,8 +36,8 @@ function DLR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.dstate; + this.model = arg1.model; + x0 = this.model.dstate; ns = prod(size(x0)); PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.z = %z; @@ -61,18 +61,18 @@ function DLR() { x0[ns1-1][1-1] = 0; } rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.dstate = x0; - model.rpar = rpar; + this.model.dstate = x0; + this.model.rpar = rpar; if (norm(D,1)!=0) { mmm = [true,false]; } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DLR.pickle b/js/Linear/DLR.pickle index d26c7744..6b2c200c 100644 --- a/js/Linear/DLR.pickle +++ b/js/Linear/DLR.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'num' +aS'model' p3 -aS'den' +aS'num' p4 -atp5 -Rp6 +aS'den' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Linear/DLR_f.js b/js/Linear/DLR_f.js index 6258df46..0a48dc93 100644 --- a/js/Linear/DLR_f.js +++ b/js/Linear/DLR_f.js @@ -7,17 +7,17 @@ function DLR_f() { C = 1; D = 0; exprs = [["1"],["1+z"]]; - model = scicos_model(); - model.sim = "dsslti"; - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = x0.slice(); - model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("dsslti"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = x0.slice(); + this.model.rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2.5,2.5],model,exprs,gr_i); + this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLR_f.prototype.details = function DLR_f() { @@ -36,8 +36,8 @@ function DLR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - x0 = model.dstate; + this.model = arg1.model; + x0 = this.model.dstate; ns = prod(size(x0)); PREVAR_scicos_context = PREVAR_scicos_context; PREVAR_scicos_context.z = %z; @@ -61,18 +61,18 @@ function DLR_f() { x0[ns1-1][1-1] = 0; } rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - model.dstate = x0; - model.rpar = rpar; + this.model.dstate = x0; + this.model.rpar = rpar; if (norm(D,1)!=0) { mmm = [true,false]; } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DLR_f.pickle b/js/Linear/DLR_f.pickle index 06b4e8cd..5646a5ed 100644 --- a/js/Linear/DLR_f.pickle +++ b/js/Linear/DLR_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'num' +aS'model' p3 -aS'den' +aS'num' p4 -atp5 -Rp6 +aS'den' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Linear/DLSS.js b/js/Linear/DLSS.js index 4c19a6b7..d9b17858 100644 --- a/js/Linear/DLSS.js +++ b/js/Linear/DLSS.js @@ -6,18 +6,18 @@ function DLSS() { this.B = 1; this.C = 1; this.D = 0; - model = scicos_model(); - model.sim = list("dsslti4",4); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.x0.slice(); - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dsslti4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = this.x0.slice(); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLSS.prototype.details = function DLSS() { @@ -45,7 +45,7 @@ function DLSS() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set discrete linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -73,7 +73,7 @@ function DLSS() { if (ms!=ns||!okD) { message(_("Matrix A is not square or D has wrong dimension")); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -83,16 +83,16 @@ function DLSS() { } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,false]; + this.model.dep_ut = [false,false]; } - model.dstate = this.x0.slice(); - model.rpar = rpar; + this.model.dstate = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DLSS.pickle b/js/Linear/DLSS.pickle index f9fda6d5..b38aefd2 100644 --- a/js/Linear/DLSS.pickle +++ b/js/Linear/DLSS.pickle @@ -12,10 +12,12 @@ aS'D' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'model.dstate' p1 diff --git a/js/Linear/DLSS_f.js b/js/Linear/DLSS_f.js index 121ba77b..7d40c411 100644 --- a/js/Linear/DLSS_f.js +++ b/js/Linear/DLSS_f.js @@ -6,18 +6,18 @@ function DLSS_f() { this.B = 1; this.C = 1; this.D = 0; - model = scicos_model(); - model.sim = list("dsslti",1); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.x0.slice(); - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dsslti",1); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = this.x0.slice(); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLSS_f.prototype.details = function DLSS_f() { @@ -45,7 +45,7 @@ function DLSS_f() { if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.A,this.B,this.C,this.D,this.x0,exprs] = scicos_getvalue("Set discrete linear system parameters",["A matrix","B matrix","C matrix","D matrix","Initial state"],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); if (!ok) { @@ -63,7 +63,7 @@ function DLSS_f() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -73,16 +73,16 @@ function DLSS_f() { } else { mmm = [false,false]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,false]; + this.model.dep_ut = [false,false]; } - model.dstate = this.x0.slice(); - model.rpar = rpar; + this.model.dstate = this.x0.slice(); + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DLSS_f.pickle b/js/Linear/DLSS_f.pickle index 54c40f94..86899fa7 100644 --- a/js/Linear/DLSS_f.pickle +++ b/js/Linear/DLSS_f.pickle @@ -12,10 +12,12 @@ aS'D' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'model.dstate' p1 diff --git a/js/Linear/DOLLAR.js b/js/Linear/DOLLAR.js index afde8792..6fd66945 100644 --- a/js/Linear/DOLLAR.js +++ b/js/Linear/DOLLAR.js @@ -5,16 +5,16 @@ function DOLLAR() { this.inh = 0; in1 = 1; exprs = string([[z],[this.inh]]); - model = scicos_model(); - model.sim = list("dollar4",4); - model.in1 = in1; - model.out = in1; - model.evtin = 1-this.inh; - model.dstate = z; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dollar4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1-this.inh); + this.model.dstate = new ScilabDouble(z); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DOLLAR.prototype.details = function DOLLAR() { @@ -33,7 +33,7 @@ function DOLLAR() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<2) { exprs[2-1] = "0"; } @@ -47,17 +47,17 @@ function DOLLAR() { out = []; } in1 = out; - model.sim = list("dollar4_m",4); - model.odstate = list(this.a); - model.dstate = []; + this.model.sim = list("dollar4_m",4); + this.model.odstate = list(this.a); + this.model.dstate = []; if (this.type[(this.a)==1-1]) { if (isreal(this.a)) { it = 1; ot = 1; if ((size(this.a,1)==1||size(this.a,2)==1)) { - model.sim = list("dollar4",4); - model.dstate = this.a.slice(); - model.odstate = list(); + this.model.sim = list("dollar4",4); + this.model.dstate = this.a.slice(); + this.model.odstate = list(); } } else { it = 2; @@ -86,12 +86,12 @@ function DOLLAR() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DOLLAR.pickle b/js/Linear/DOLLAR.pickle index 005fa40c..f2ab4abd 100644 --- a/js/Linear/DOLLAR.pickle +++ b/js/Linear/DOLLAR.pickle @@ -6,12 +6,14 @@ S'a' p2 aS'x' p3 -aS'inh' +aS'model' p4 -aS'type' +aS'inh' p5 -atp6 -Rp7 +aS'type' +p6 +atp7 +Rp8 .(dp0 S'model.odstate' p1 diff --git a/js/Linear/DOLLAR_f.js b/js/Linear/DOLLAR_f.js index de459a3c..806e701e 100644 --- a/js/Linear/DOLLAR_f.js +++ b/js/Linear/DOLLAR_f.js @@ -5,16 +5,16 @@ function DOLLAR_f() { this.inh = 0; in1 = 1; exprs = string([[z],[this.inh]]); - model = scicos_model(); - model.sim = "dollar"; - model.in1 = in1; - model.out = in1; - model.evtin = 1-this.inh; - model.dstate = z; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("dollar"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1-this.inh); + this.model.dstate = new ScilabDouble(z); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DOLLAR_f.prototype.details = function DOLLAR_f() { @@ -33,7 +33,7 @@ function DOLLAR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<2) { exprs[2-1] = "0"; } @@ -48,15 +48,15 @@ function DOLLAR_f() { } in1 = out; if (ok) { - [model,graphics,ok] = check_io(model,graphics,-1,-1,ones(1-this.inh,1),[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,-1,ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; - model.dstate = this.a; - model.in1 = in1; - model.out = out; + this.model.dstate = new ScilabDouble(this.a); + this.model.in1 = in1; + this.model.out = out; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DOLLAR_f.pickle b/js/Linear/DOLLAR_f.pickle index 4cc1fd5a..c5ad31a2 100644 --- a/js/Linear/DOLLAR_f.pickle +++ b/js/Linear/DOLLAR_f.pickle @@ -6,10 +6,12 @@ S'a' p2 aS'x' p3 -aS'inh' +aS'model' p4 -atp5 -Rp6 +aS'inh' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Linear/DOLLAR_m.js b/js/Linear/DOLLAR_m.js index 22941f9a..d85e0cd8 100644 --- a/js/Linear/DOLLAR_m.js +++ b/js/Linear/DOLLAR_m.js @@ -5,16 +5,16 @@ function DOLLAR_m() { this.inh = 0; in1 = 1; exprs = string([[z],[this.inh]]); - model = scicos_model(); - model.sim = list("dollar4",4); - model.in1 = in1; - model.out = in1; - model.evtin = 1-this.inh; - model.dstate = z; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("dollar4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1-this.inh); + this.model.dstate = new ScilabDouble(z); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DOLLAR_m.prototype.details = function DOLLAR_m() { @@ -33,7 +33,7 @@ function DOLLAR_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<2) { exprs[2-1] = "0"; } @@ -47,17 +47,17 @@ function DOLLAR_m() { out = []; } in1 = out; - model.sim = list("dollar4_m",4); - model.odstate = list(this.a); - model.dstate = []; + this.model.sim = list("dollar4_m",4); + this.model.odstate = list(this.a); + this.model.dstate = []; if ((this.type[this.a-1]==1)) { if (isreal(this.a)) { it = 1; ot = 1; if ((size(this.a,1)==1||size(this.a,2)==1)) { - model.sim = list("dollar4",4); - model.dstate = this.a.slice(); - model.odstate = list(); + this.model.sim = list("dollar4",4); + this.model.dstate = this.a.slice(); + this.model.odstate = list(); } } else { it = 2; @@ -86,12 +86,12 @@ function DOLLAR_m() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/DOLLAR_m.pickle b/js/Linear/DOLLAR_m.pickle index 005fa40c..f2ab4abd 100644 --- a/js/Linear/DOLLAR_m.pickle +++ b/js/Linear/DOLLAR_m.pickle @@ -6,12 +6,14 @@ S'a' p2 aS'x' p3 -aS'inh' +aS'model' p4 -aS'type' +aS'inh' p5 -atp6 -Rp7 +aS'type' +p6 +atp7 +Rp8 .(dp0 S'model.odstate' p1 diff --git a/js/Linear/GAINBLK.js b/js/Linear/GAINBLK.js index 41106cac..99ff7bc0 100644 --- a/js/Linear/GAINBLK.js +++ b/js/Linear/GAINBLK.js @@ -6,18 +6,18 @@ function GAINBLK() { out = -1; in2 = -2; out2 = -2; - model = scicos_model(); - model.sim = list("gainblk",4); - model.in1 = in1; - model.out = out; - model.in2 = in2; - model.out2 = out2; - model.rpar = this.gain; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("gainblk",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.in2 = new ScilabDouble(in2); + this.model.out2 = new ScilabDouble(out2); + this.model.rpar = new ScilabDouble(this.gain); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [strcat(sci2exp(this.gain))]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GAINBLK.prototype.details = function GAINBLK() { @@ -36,7 +36,7 @@ function GAINBLK() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==1) { exprs = [[exprs],[sci2exp(0)]]; } @@ -52,9 +52,9 @@ function GAINBLK() { if (isreal(this.gain)) { it = 1; ot = 1; - model.sim = list("gainblk",4); - model.rpar = this.gain.slice(); - model.opar = list(); + this.model.sim = list("gainblk",4); + this.model.rpar = this.gain.slice(); + this.model.opar = list(); } else { message("type is not supported"); ok = false; @@ -63,22 +63,22 @@ function GAINBLK() { if ((this.over==0)) { if ((typeof(this.gain)=="int32")) { ot = 3; - model.sim = list("gainblk_i32n",4); + this.model.sim = list("gainblk_i32n",4); } else if ((typeof(this.gain)=="int16")) { ot = 4; - model.sim = list("gainblk_i16n",4); + this.model.sim = list("gainblk_i16n",4); } else if ((typeof(this.gain)=="int8")) { ot = 5; - model.sim = list("gainblk_i8n",4); + this.model.sim = list("gainblk_i8n",4); } else if ((typeof(this.gain)=="uint32")) { ot = 6; - model.sim = list("gainblk_ui32n",4); + this.model.sim = list("gainblk_ui32n",4); } else if ((typeof(this.gain)=="uint16")) { ot = 7; - model.sim = list("gainblk_ui16n",4); + this.model.sim = list("gainblk_ui16n",4); } else if ((typeof(this.gain)=="uint8")) { ot = 8; - model.sim = list("gainblk_ui8n",4); + this.model.sim = list("gainblk_ui8n",4); } else { message("type is not supported."); ok = false; @@ -86,22 +86,22 @@ function GAINBLK() { } else if ((this.over==1)) { if ((typeof(this.gain)=="int32")) { ot = 3; - model.sim = list("gainblk_i32s",4); + this.model.sim = list("gainblk_i32s",4); } else if ((typeof(this.gain)=="int16")) { ot = 4; - model.sim = list("gainblk_i16s",4); + this.model.sim = list("gainblk_i16s",4); } else if ((typeof(this.gain)=="int8")) { ot = 5; - model.sim = list("gainblk_i8s",4); + this.model.sim = list("gainblk_i8s",4); } else if ((typeof(this.gain)=="uint32")) { ot = 6; - model.sim = list("gainblk_ui32s",4); + this.model.sim = list("gainblk_ui32s",4); } else if ((typeof(this.gain)=="uint16")) { ot = 7; - model.sim = list("gainblk_ui16s",4); + this.model.sim = list("gainblk_ui16s",4); } else if ((typeof(this.gain)=="uint8")) { ot = 8; - model.sim = list("gainblk_ui8s",4); + this.model.sim = list("gainblk_ui8s",4); } else { message("type is not supported."); ok = false; @@ -109,22 +109,22 @@ function GAINBLK() { } else if ((this.over==2)) { if ((typeof(this.gain)=="int32")) { ot = 3; - model.sim = list("gainblk_i32e",4); + this.model.sim = list("gainblk_i32e",4); } else if ((typeof(this.gain)=="int16")) { ot = 4; - model.sim = list("gainblk_i16e",4); + this.model.sim = list("gainblk_i16e",4); } else if ((typeof(this.gain)=="int8")) { ot = 5; - model.sim = list("gainblk_i8e",4); + this.model.sim = list("gainblk_i8e",4); } else if ((typeof(this.gain)=="uint32")) { ot = 6; - model.sim = list("gainblk_ui32e",4); + this.model.sim = list("gainblk_ui32e",4); } else if ((typeof(this.gain)=="uint16")) { ot = 7; - model.sim = list("gainblk_ui16e",4); + this.model.sim = list("gainblk_ui16e",4); } else if ((typeof(this.gain)=="uint8")) { ot = 8; - model.sim = list("gainblk_ui8e",4); + this.model.sim = list("gainblk_ui8e",4); } else { message("type is not an integer."); ok = false; @@ -133,21 +133,21 @@ function GAINBLK() { message("Do on Overflow must be 0,1,2"); ok = false; } - model.rpar = []; - model.opar = list(this.gain.slice()); + this.model.rpar = []; + this.model.opar = list(this.gain.slice()); } if (ok) { [out,in1] = size(this.gain); if (out*in1!=1) { - [model,graphics,ok] = set_io(model,graphics,list([in1,-1],ot),list([out,-1],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,-1],ot),list([out,-1],ot),[],[]); } else { - [model,graphics,ok] = set_io(model,graphics,list([-1,-2],ot),list([-1,-2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],ot),list([-1,-2],ot),[],[]); } } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/GAINBLK.pickle b/js/Linear/GAINBLK.pickle index 78c06b7c..a56de86b 100644 --- a/js/Linear/GAINBLK.pickle +++ b/js/Linear/GAINBLK.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'over' +aS'model' p3 -aS'gain' +aS'over' p4 -atp5 -Rp6 +aS'gain' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/Linear/GAINBLK_f.js b/js/Linear/GAINBLK_f.js index 18b30def..78c39c12 100644 --- a/js/Linear/GAINBLK_f.js +++ b/js/Linear/GAINBLK_f.js @@ -4,16 +4,16 @@ function GAINBLK_f() { this.gain = 1; in1 = 1; out = 1; - model = scicos_model(); - model.sim = "gain"; - model.in1 = in1; - model.out = out; - model.rpar = this.gain; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gain"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.rpar = new ScilabDouble(this.gain); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [strcat(sci2exp(this.gain))]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GAINBLK_f.prototype.details = function GAINBLK_f() { @@ -30,7 +30,7 @@ function GAINBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]); if (!ok) { @@ -40,12 +40,12 @@ function GAINBLK_f() { message("Gain must have at least one element"); } else { [out,in1] = size(this.gain); - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; - model.rpar = this.gain.slice(); + this.model.rpar = this.gain.slice(); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/GAINBLK_f.pickle b/js/Linear/GAINBLK_f.pickle index 24c29a29..960ab456 100644 --- a/js/Linear/GAINBLK_f.pickle +++ b/js/Linear/GAINBLK_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'gain' +aS'model' p3 -atp4 -Rp5 +aS'gain' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Linear/GAIN_f.js b/js/Linear/GAIN_f.js index f0fd2265..a7ea5848 100644 --- a/js/Linear/GAIN_f.js +++ b/js/Linear/GAIN_f.js @@ -4,16 +4,16 @@ function GAIN_f() { this.gain = 1; in1 = 1; out = 1; - model = scicos_model(); - model.sim = "gain"; - model.in1 = 1; - model.out = 1; - model.rpar = this.gain; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gain"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.gain); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.gain))],[strcat(sci2exp(in1))],[strcat(sci2exp(out))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GAIN_f.prototype.details = function GAIN_f() { @@ -30,7 +30,7 @@ function GAIN_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]); if (!ok) { @@ -40,12 +40,12 @@ function GAIN_f() { message("Gain must have at least one element"); } else { [out,in1] = size(this.gain); - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; - model.rpar = this.gain.slice(); + this.model.rpar = this.gain.slice(); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/GAIN_f.pickle b/js/Linear/GAIN_f.pickle index 059c6d78..107d062b 100644 --- a/js/Linear/GAIN_f.pickle +++ b/js/Linear/GAIN_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'gain' +aS'model' p3 -atp4 -Rp5 +aS'gain' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Linear/INTEGRAL.js b/js/Linear/INTEGRAL.js index 7d5c5aec..db35386c 100644 --- a/js/Linear/INTEGRAL.js +++ b/js/Linear/INTEGRAL.js @@ -4,17 +4,17 @@ function INTEGRAL() { this.maxp = 1; minp = -1; rpar = []; - model = scicos_model(); - model.state = 0; - model.sim = list("integral_func",4); - model.in1 = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.state = new ScilabDouble(0); + this.model.sim = list("integral_func",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = string([[0],[0],[0],[this.maxp],[minp]]); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.id = "1/s"; return new BasicBlock(this.x); } @@ -40,7 +40,7 @@ function INTEGRAL() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,this.reinit,this.satur,this.maxp,this.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("vec",-1,"vec",1,"vec",1,"vec",-1,"vec",-1),exprs); if (!ok) { @@ -71,23 +71,23 @@ function INTEGRAL() { ok = false; } else { rpar = [[this.maxp],[this.lowp]]; - model.nzcross = size(this.x0,1); - model.nmode = size(this.x0,1); + this.model.nzcross = new ScilabDouble(size(this.x0,1)); + this.model.nmode = new ScilabDouble(size(this.x0,1)); } } else { rpar = []; - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } if (ok) { - model.rpar = rpar; - model.state = this.x0; - [model,graphics,ok] = check_io(model,graphics,size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,1),ones(this.reinit,1),[]); + this.model.rpar = rpar; + this.model.state = this.x0; + [model,graphics,ok] = check_io(this.model,graphics,size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,1),ones(this.reinit,1),[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/INTEGRAL.pickle b/js/Linear/INTEGRAL.pickle index 33296dc1..f09f5212 100644 --- a/js/Linear/INTEGRAL.pickle +++ b/js/Linear/INTEGRAL.pickle @@ -12,10 +12,12 @@ aS'lowp' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Linear/INTEGRAL_f.js b/js/Linear/INTEGRAL_f.js index 4a018db4..55b4d40d 100644 --- a/js/Linear/INTEGRAL_f.js +++ b/js/Linear/INTEGRAL_f.js @@ -2,16 +2,16 @@ function INTEGRAL_f() { INTEGRAL_f.prototype.define = function INTEGRAL_f() { this.x0 = 0; - model = scicos_model(); - model.sim = "integr"; - model.in1 = 1; - model.out = 1; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("integr"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = new ScilabDouble(this.x0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = strcat(sci2exp(this.x0)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTEGRAL_f.prototype.details = function INTEGRAL_f() { @@ -27,16 +27,16 @@ function INTEGRAL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,exprs] = scicos_getvalue("Set continuous linear system parameters","Initial state",list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - model.state = this.x0; + this.model.state = new ScilabDouble(this.x0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } this.x.model.firing = []; diff --git a/js/Linear/INTEGRAL_f.pickle b/js/Linear/INTEGRAL_f.pickle index 6923a6ea..6112b9f9 100644 --- a/js/Linear/INTEGRAL_f.pickle +++ b/js/Linear/INTEGRAL_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'x0' +aS'model' p3 -atp4 -Rp5 +aS'x0' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Linear/INTEGRAL_m.js b/js/Linear/INTEGRAL_m.js index 149d4300..39215001 100644 --- a/js/Linear/INTEGRAL_m.js +++ b/js/Linear/INTEGRAL_m.js @@ -4,19 +4,19 @@ function INTEGRAL_m() { this.maxp = 1; minp = -1; rpar = []; - model = scicos_model(); - model.state = 0; - model.sim = list("integral_func",4); - model.in1 = 1; - model.out = 1; - model.in2 = 1; - model.out2 = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.state = new ScilabDouble(0); + this.model.sim = list("integral_func",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = string([[0],[0],[0],[this.maxp],[minp]]); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTEGRAL_m.prototype.details = function INTEGRAL_m() { @@ -41,7 +41,7 @@ function INTEGRAL_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,this.reinit,this.satur,this.maxp,this.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) { @@ -75,8 +75,8 @@ function INTEGRAL_m() { ok = false; } else { rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())]]; - model.nzcross = size(this.x0,"*"); - model.nmode = size(this.x0,"*"); + this.model.nzcross = new ScilabDouble(size(this.x0,"*")); + this.model.nmode = new ScilabDouble(size(this.x0,"*")); } } else if ((Datatype==2)) { if (size(this.maxp,"*")==1) { @@ -96,25 +96,25 @@ function INTEGRAL_m() { ok = false; } else { rpar = [[real(this.maxp.slice())],[real(this.lowp.slice())],[imag(this.maxp.slice())],[imag(this.lowp.slice())]]; - model.nzcross = 2*size(this.x0,"*"); - model.nmode = 2*size(this.x0,"*"); + this.model.nzcross = new ScilabDouble(2*size(this.x0,"*")); + this.model.nmode = new ScilabDouble(2*size(this.x0,"*")); } } } else { rpar = []; - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } if (ok) { - model.rpar = rpar; + this.model.rpar = rpar; if ((Datatype==1)) { - model.state = real(this.x0.slice()); - model.sim = list("integral_func",4); + this.model.state = new ScilabDouble(real(this.x0.slice())); + this.model.sim = list("integral_func",4); it = [[1],[ones(this.reinit,1)]]; ot = 1; } else if ((Datatype==2)) { - model.state = [[real(this.x0.slice())],[imag(this.x0.slice())]]; - model.sim = list("integralz_func",4); + this.model.state = [[real(this.x0.slice())],[imag(this.x0.slice())]]; + this.model.sim = list("integralz_func",4); it = [[2],[2*ones(this.reinit,1)]]; ot = 2; } else { @@ -124,13 +124,13 @@ function INTEGRAL_m() { if (ok) { in1 = [size(this.x0,1)*[[1],[ones(this.reinit,1)]],size(this.x0,2)*[[1],[ones(this.reinit,1)]]]; out = size(this.x0); - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(this.reinit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(this.reinit,1),[]); } } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/INTEGRAL_m.pickle b/js/Linear/INTEGRAL_m.pickle index 7016703a..7d0ee3ba 100644 --- a/js/Linear/INTEGRAL_m.pickle +++ b/js/Linear/INTEGRAL_m.pickle @@ -12,10 +12,12 @@ aS'lowp' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Linear/PID.js b/js/Linear/PID.js index deab1153..af223f0d 100644 --- a/js/Linear/PID.js +++ b/js/Linear/PID.js @@ -23,20 +23,20 @@ function PID() { scs_m.objs[19-1] = scicos_link(xx=[[436.5421],[456.5421]],yy=[[202.85067],[202.85067]],id="drawlink",thick=[0,0],ct=[1,1],from=[2,1,0],to=[18,1,1]); scs_m.objs[20-1] = scicos_block(gui="IN_f",graphics=scicos_graphics(orig=[193.97067,193.11733],sz=[20,20],flip=true,theta=0,exprs="1",pin=[],pout=21,pein=[],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim="input",in1=[],in2=[],intyp=1,out=-1,out2=[],outtyp=-1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[21-1] = scicos_link(xx=[[213.97067],[233.97067]],yy=[[203.11733],[203.11733]],id="drawlink",thick=[0,0],ct=[1,1],from=[20,1,0],to=[15,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = -1; - model.in2 = -2; - model.out = -1; - model.out2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.blocktype = "h"; - model.firing = false; - model.dep_ut = [false,false]; - model.rpar = scs_m; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.blocktype = new ScilabString("h"); + this.model.firing = new ScilabBoolean(false); + this.model.dep_ut = [false,false]; + this.model.rpar = new ScilabDouble(scs_m); gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } PID.prototype.details = function PID() { diff --git a/js/Linear/PID.pickle b/js/Linear/PID.pickle index f111f219..c7c6a8ec 100644 --- a/js/Linear/PID.pickle +++ b/js/Linear/PID.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'i' +S'd' p2 -aS'x' +aS'i' p3 aS'exprs0' p4 -aS'd' -p5 aS'p' +p5 +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'xx3' p1 diff --git a/js/Linear/REGISTER.js b/js/Linear/REGISTER.js index 6a27b2d1..4569e7d9 100644 --- a/js/Linear/REGISTER.js +++ b/js/Linear/REGISTER.js @@ -2,17 +2,17 @@ function REGISTER() { REGISTER.prototype.define = function REGISTER() { this.z0 = zeros(10,1); - model = scicos_model(); - model.sim = list("delay4",4); - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.z0; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("delay4",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(string(this.z0),";"); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } REGISTER.prototype.details = function REGISTER() { @@ -31,7 +31,7 @@ function REGISTER() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,1)==1) { exprs = [[exprs],[sci2exp(1)]]; } @@ -45,44 +45,44 @@ function REGISTER() { ok = false; } if (this.it==1) { - model.sim = list("delay4",4); + this.model.sim = list("delay4",4); this.z0 = double(this.z0); - model.dstate = this.z0; - model.odstate = list(); + this.model.dstate = new ScilabDouble(this.z0); + this.model.odstate = list(); } else { if (this.it==3) { - model.sim = list("delay4_i32",4); + this.model.sim = list("delay4_i32",4); this.z0 = int32(this.z0); } else if (this.it==4) { - model.sim = list("delay4_i16",4); + this.model.sim = list("delay4_i16",4); this.z0 = int16(this.z0); } else if (this.it==5) { - model.sim = list("delay4_i8",4); + this.model.sim = list("delay4_i8",4); this.z0 = int8(this.z0); } else if (this.it==6) { - model.sim = list("delay4_ui32",4); + this.model.sim = list("delay4_ui32",4); this.z0 = uint32(this.z0); } else if (this.it==7) { - model.sim = list("delay4_ui16",4); + this.model.sim = list("delay4_ui16",4); this.z0 = uint16(this.z0); } else if (this.it==8) { - model.sim = list("delay4_ui8",4); + this.model.sim = list("delay4_ui8",4); this.z0 = uint8(this.z0); } else { message("Datatype is not supported"); ok = false; } - model.odstate = list(this.z0); - model.dstate = []; + this.model.odstate = list(this.z0); + this.model.dstate = []; } if (ok) { in1 = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(in1,this.it),1,[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/REGISTER.pickle b/js/Linear/REGISTER.pickle index bc3735c1..dae865a3 100644 --- a/js/Linear/REGISTER.pickle +++ b/js/Linear/REGISTER.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -aS'it' +aS'z0' p4 -atp5 -Rp6 +aS'it' +p5 +atp6 +Rp7 .(dp0 S'model.odstate' p1 diff --git a/js/Linear/REGISTER_f.js b/js/Linear/REGISTER_f.js index f35b06be..c4b0e7cc 100644 --- a/js/Linear/REGISTER_f.js +++ b/js/Linear/REGISTER_f.js @@ -2,17 +2,17 @@ function REGISTER_f() { REGISTER_f.prototype.define = function REGISTER_f() { this.z0 = zeros(10,1); - model = scicos_model(); - model.sim = "delay"; - model.in1 = 1; - model.out = 1; - model.evtin = 1; - model.dstate = this.z0; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("delay"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.z0); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(string(this.z0),";"); gr_i = []; - this.x = standard_define([2.5,2.5],model,exprs,gr_i); + this.x = standard_define([2.5,2.5],this.model,exprs,gr_i); return new BasicBlock(this.x); } REGISTER_f.prototype.details = function REGISTER_f() { @@ -28,7 +28,7 @@ function REGISTER_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.z0,exprs] = scicos_getvalue("Set delay parameters","Register initial condition",list("vec",-1),exprs); if (!ok) { @@ -40,9 +40,9 @@ function REGISTER_f() { } if (ok) { graphics.exprs = exprs; - model.dstate = this.z0; + this.model.dstate = new ScilabDouble(this.z0); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/REGISTER_f.pickle b/js/Linear/REGISTER_f.pickle index 3881a1bd..961e104f 100644 --- a/js/Linear/REGISTER_f.pickle +++ b/js/Linear/REGISTER_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'z0' +aS'model' p3 -atp4 -Rp5 +aS'z0' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Linear/SAMPHOLD.js b/js/Linear/SAMPHOLD.js index e51073c2..e47fcee2 100644 --- a/js/Linear/SAMPHOLD.js +++ b/js/Linear/SAMPHOLD.js @@ -2,15 +2,15 @@ function SAMPHOLD() { SAMPHOLD.prototype.define = function SAMPHOLD() { in1 = -1; - model = scicos_model(); - model.sim = list("samphold4",4); - model.in1 = -1; - model.out = -1; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("samphold4",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model," ",gr_i); + this.x = standard_define([2,2],this.model," ",gr_i); return new BasicBlock(this.x); } SAMPHOLD.prototype.details = function SAMPHOLD() { diff --git a/js/Linear/SAMPHOLD.pickle b/js/Linear/SAMPHOLD.pickle index caeeb745..68b41422 100644 --- a/js/Linear/SAMPHOLD.pickle +++ b/js/Linear/SAMPHOLD.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Linear/SAMPHOLD_m.js b/js/Linear/SAMPHOLD_m.js index c117295d..29972426 100644 --- a/js/Linear/SAMPHOLD_m.js +++ b/js/Linear/SAMPHOLD_m.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Linear/SAMPHOLD_m.sci" */ function SAMPHOLD_m() { SAMPHOLD_m.prototype.define = function SAMPHOLD_m() { - model = scicos_model(); - model.sim = list("samphold4_m",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.out = -1; - model.out2 = -2; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("samphold4_m",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } SAMPHOLD_m.prototype.details = function SAMPHOLD_m() { @@ -32,7 +32,7 @@ function SAMPHOLD_m() { this.x.model.firing = []; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.it,exprs] = scicos_getvalue("Set parameters Block",["Datatype(1=real double 2=Complex 3=int32 ...)"],list("vec",1),label); if (!ok) { @@ -43,12 +43,12 @@ function SAMPHOLD_m() { ok = false; } if (ok) { - in1 = [model.in1,model.in2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(in1,this.it),1,[]); + in1 = [this.model.in1,this.model.in2]; + [model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(in1,this.it),1,[]); if (ok) { graphics.exprs = exprs; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/Linear/SAMPHOLD_m.pickle b/js/Linear/SAMPHOLD_m.pickle index fd472bf8..7c779c2a 100644 --- a/js/Linear/SAMPHOLD_m.pickle +++ b/js/Linear/SAMPHOLD_m.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'it' +aS'model' p3 -atp4 -Rp5 +aS'it' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Linear/SAMPLEHOLD_f.js b/js/Linear/SAMPLEHOLD_f.js index 7e9fe126..31ac840d 100644 --- a/js/Linear/SAMPLEHOLD_f.js +++ b/js/Linear/SAMPLEHOLD_f.js @@ -2,15 +2,15 @@ function SAMPLEHOLD_f() { SAMPLEHOLD_f.prototype.define = function SAMPLEHOLD_f() { in1 = -1; - model = scicos_model(); - model.sim = "samphold"; - model.in1 = -1; - model.out = -1; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("samphold"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model," ",gr_i); + this.x = standard_define([2,2],this.model," ",gr_i); return new BasicBlock(this.x); } SAMPLEHOLD_f.prototype.details = function SAMPLEHOLD_f() { diff --git a/js/Linear/SAMPLEHOLD_f.pickle b/js/Linear/SAMPLEHOLD_f.pickle index c64acb4c..cee05e84 100644 --- a/js/Linear/SAMPLEHOLD_f.pickle +++ b/js/Linear/SAMPLEHOLD_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Linear/SOM_f.js b/js/Linear/SOM_f.js index 274f300c..421ab2df 100644 --- a/js/Linear/SOM_f.js +++ b/js/Linear/SOM_f.js @@ -2,16 +2,16 @@ function SOM_f() { SOM_f.prototype.define = function SOM_f() { sgn = [[1],[1],[1]]; - model = scicos_model(); - model.sim = list("sum",2); - model.in1 = [[-1],[-1],[-1]]; - model.out = -1; - model.rpar = sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("sum",2); + this.model.in1 = [[-1],[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.rpar = sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(sgn)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SOM_f.prototype.details = function SOM_f() { @@ -25,13 +25,13 @@ function SOM_f() { SOM_f.prototype.set = function SOM_f() { this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } if (size(exprs,"*")!=3) { - exprs = string(model.rpar); + exprs = string(this.model.rpar); } if (graphics.flip) { labs = ["down","left","up"]; diff --git a/js/Linear/SOM_f.pickle b/js/Linear/SOM_f.pickle index df58dba6..9710ead6 100644 --- a/js/Linear/SOM_f.pickle +++ b/js/Linear/SOM_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Linear/SUMMATION.js b/js/Linear/SUMMATION.js index 0aabff5e..ec0683cf 100644 --- a/js/Linear/SUMMATION.js +++ b/js/Linear/SUMMATION.js @@ -2,18 +2,18 @@ function SUMMATION() { SUMMATION.prototype.define = function SUMMATION() { this.sgn = [[1],[-1]]; - model = scicos_model(); - model.sim = list("summation",4); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.in2 = [[-2],[-2]]; - model.out2 = -2; - model.ipar = this.sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("summation",4); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.in2 = [[-2],[-2]]; + this.model.out2 = new ScilabDouble(-2); + this.model.ipar = this.sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(this.sgn); gr_i = []; - this.x = standard_define([2,3],model,exprs,gr_i); + this.x = standard_define([2,3],this.model,exprs,gr_i); return new Summation(this.x); } SUMMATION.prototype.details = function SUMMATION() { @@ -33,7 +33,7 @@ function SUMMATION() { this.satur = arguments[0]["satur"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,1)==1) { exprs = [[sci2exp(1)],[exprs],[sci2exp(0)]]; @@ -81,66 +81,66 @@ function SUMMATION() { it = this.Datatype*ones(1,size(in1,1)); ot = this.Datatype; if (this.Datatype==1) { - model.sim = list("summation",4); + this.model.sim = list("summation",4); } else if (this.Datatype==2) { - model.sim = list("summation_z",4); + this.model.sim = list("summation_z",4); } else if (((this.Datatype<1)||(this.Datatype>8))) { message("Datatype is not supported"); ok = false; } else { if (this.satur==0) { if (this.Datatype==3) { - model.sim = list("summation_i32n",4); + this.model.sim = list("summation_i32n",4); } else if (this.Datatype==4) { - model.sim = list("summation_i16n",4); + this.model.sim = list("summation_i16n",4); } else if (this.Datatype==5) { - model.sim = list("summation_i8n",4); + this.model.sim = list("summation_i8n",4); } else if (this.Datatype==6) { - model.sim = list("summation_ui32n",4); + this.model.sim = list("summation_ui32n",4); } else if (this.Datatype==7) { - model.sim = list("summation_ui16n",4); + this.model.sim = list("summation_ui16n",4); } else if (this.Datatype==8) { - model.sim = list("summation_ui8n",4); + this.model.sim = list("summation_ui8n",4); } } else if (this.satur==1) { if (this.Datatype==3) { - model.sim = list("summation_i32s",4); + this.model.sim = list("summation_i32s",4); } else if (this.Datatype==4) { - model.sim = list("summation_i16s",4); + this.model.sim = list("summation_i16s",4); } else if (this.Datatype==5) { - model.sim = list("summation_i8s",4); + this.model.sim = list("summation_i8s",4); } else if (this.Datatype==6) { - model.sim = list("summation_ui32s",4); + this.model.sim = list("summation_ui32s",4); } else if (this.Datatype==7) { - model.sim = list("summation_ui16s",4); + this.model.sim = list("summation_ui16s",4); } else if (this.Datatype==8) { - model.sim = list("summation_ui8s",4); + this.model.sim = list("summation_ui8s",4); } } else if (this.satur==2) { if (this.Datatype==3) { - model.sim = list("summation_i32e",4); + this.model.sim = list("summation_i32e",4); } else if (this.Datatype==4) { - model.sim = list("summation_i16e",4); + this.model.sim = list("summation_i16e",4); } else if (this.Datatype==5) { - model.sim = list("summation_i8e",4); + this.model.sim = list("summation_i8e",4); } else if (this.Datatype==6) { - model.sim = list("summation_ui32e",4); + this.model.sim = list("summation_ui32e",4); } else if (this.Datatype==7) { - model.sim = list("summation_ui16e",4); + this.model.sim = list("summation_ui16e",4); } else if (this.Datatype==8) { - model.sim = list("summation_ui8e",4); + this.model.sim = list("summation_ui8e",4); } } } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],it),list([nout,nout2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],it),list([nout,nout2],ot),[],[]); } if (ok) { - model.rpar = this.satur; - model.ipar = this.sgn; + this.model.rpar = new ScilabDouble(this.satur); + this.model.ipar = new ScilabDouble(this.sgn); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/SUMMATION.pickle b/js/Linear/SUMMATION.pickle index 06cb5242..db96cae6 100644 --- a/js/Linear/SUMMATION.pickle +++ b/js/Linear/SUMMATION.pickle @@ -6,12 +6,14 @@ S'Datatype' p2 aS'x' p3 -aS'satur' +aS'model' p4 -aS'sgn' +aS'satur' p5 -atp6 -Rp7 +aS'sgn' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Linear/SUM_f.js b/js/Linear/SUM_f.js index c4d18b7e..76f1d489 100644 --- a/js/Linear/SUM_f.js +++ b/js/Linear/SUM_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Linear/SUM_f.sci" */ function SUM_f() { SUM_f.prototype.define = function SUM_f() { - model = scicos_model(); - model.sim = list("plusblk",2); - model.in1 = [[-1],[-1],[-1]]; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("plusblk",2); + this.model.in1 = [[-1],[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; exprs = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new BasicBlock(this.x); } SUM_f.prototype.details = function SUM_f() { diff --git a/js/Linear/SUM_f.pickle b/js/Linear/SUM_f.pickle index 5152d73e..a12aa427 100644 --- a/js/Linear/SUM_f.pickle +++ b/js/Linear/SUM_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Linear/TCLSS.js b/js/Linear/TCLSS.js index 03dd5504..dc538324 100644 --- a/js/Linear/TCLSS.js +++ b/js/Linear/TCLSS.js @@ -9,18 +9,18 @@ function TCLSS() { in1 = 1; nx = size(this.x0,"*"); out = 1; - model = scicos_model(); - model.sim = list("tcslti4",4); - model.in1 = [[in1],[nx]]; - model.out = out; - model.evtin = 1; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("tcslti4",4); + this.model.in1 = [[in1],[nx]]; + this.model.out = new ScilabDouble(out); + this.model.evtin = new ScilabDouble(1); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TCLSS.prototype.details = function TCLSS() { @@ -45,7 +45,7 @@ function TCLSS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } @@ -66,7 +66,7 @@ function TCLSS() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,[[in1],[ms]],out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,[[in1],[ms]],out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -76,21 +76,21 @@ function TCLSS() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; if (this.D!=[]) { - model.sim = list("tcslti4",4); + this.model.sim = list("tcslti4",4); } else { - model.sim = list("tcsltj4",4); + this.model.sim = list("tcsltj4",4); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/TCLSS.pickle b/js/Linear/TCLSS.pickle index e39b2024..ba012589 100644 --- a/js/Linear/TCLSS.pickle +++ b/js/Linear/TCLSS.pickle @@ -12,10 +12,12 @@ aS'D' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Linear/TCLSS_f.js b/js/Linear/TCLSS_f.js index 3d425930..00370934 100644 --- a/js/Linear/TCLSS_f.js +++ b/js/Linear/TCLSS_f.js @@ -9,18 +9,18 @@ function TCLSS_f() { in1 = 1; nx = size(this.x0,"*"); out = 1; - model = scicos_model(); - model.sim = list("tcslti",1); - model.in1 = [[in1],[nx]]; - model.out = out; - model.evtin = 1; - model.state = this.x0; - model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("tcslti",1); + this.model.in1 = [[in1],[nx]]; + this.model.out = new ScilabDouble(out); + this.model.evtin = new ScilabDouble(1); + this.model.state = new ScilabDouble(this.x0); + this.model.rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.A))],[strcat(sci2exp(this.B))],[strcat(sci2exp(this.C))],[strcat(sci2exp(this.D))],[strcat(sci2exp(this.x0))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TCLSS_f.prototype.details = function TCLSS_f() { @@ -45,7 +45,7 @@ function TCLSS_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==7) { exprs = exprs[[1:4,7]-1]; } @@ -66,7 +66,7 @@ function TCLSS_f() { if (ms!=ns) { message("A matrix must be square"); } else { - [model,graphics,ok] = check_io(model,graphics,[[in1],[ms]],out,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,[[in1],[ms]],out,1,[]); if (ok) { graphics.exprs = exprs; rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]]; @@ -76,21 +76,21 @@ function TCLSS_f() { } else { mmm = [false,true]; } - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; + if (or(this.model.dep_ut!=mmm)) { + this.model.dep_ut = mmm; } } else { - model.dep_ut = [false,true]; + this.model.dep_ut = [false,true]; } - model.state = this.x0.slice(); - model.rpar = rpar; + this.model.state = this.x0.slice(); + this.model.rpar = rpar; if (this.D!=[]) { - model.sim = list("tcslti",1); + this.model.sim = list("tcslti",1); } else { - model.sim = list("tcsltj",1); + this.model.sim = list("tcsltj",1); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/TCLSS_f.pickle b/js/Linear/TCLSS_f.pickle index e39b2024..ba012589 100644 --- a/js/Linear/TCLSS_f.pickle +++ b/js/Linear/TCLSS_f.pickle @@ -12,10 +12,12 @@ aS'D' p5 aS'x' p6 -aS'x0' +aS'model' p7 -atp8 -Rp9 +aS'x0' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Linear/TIME_DELAY.js b/js/Linear/TIME_DELAY.js index fc9aa70e..ce36dfc9 100644 --- a/js/Linear/TIME_DELAY.js +++ b/js/Linear/TIME_DELAY.js @@ -5,17 +5,17 @@ function TIME_DELAY() { this.T = 1; this.init = 0; this.N = 1024; - model = scicos_model(); - model.sim = list("time_delay",4); - model.in1 = [nin]; - model.out = nin; - model.rpar = [this.T,this.init]; - model.ipar = this.N; - model.blocktype = "x"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("time_delay",4); + this.model.in1 = [nin]; + this.model.out = new ScilabDouble(nin); + this.model.rpar = [this.T,this.init]; + this.model.ipar = new ScilabDouble(this.N); + this.model.blocktype = new ScilabString("x"); + this.model.dep_ut = [false,true]; exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; gr_i = []; - this.x = standard_define([3.5,2],model,exprs,gr_i); + this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TIME_DELAY.prototype.details = function TIME_DELAY() { @@ -36,8 +36,8 @@ function TIME_DELAY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - nin = model.in1[1-1]; + this.model = arg1.model; + nin = this.model.in1[1-1]; while (true) { [ok,this.T,this.init,this.N,exprs] = scicos_getvalue("Set delay parameters",["Delay","initial input","Buffer size"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -52,15 +52,15 @@ function TIME_DELAY() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[-1],-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[-1],-1,[],[]); } if (ok) { graphics.exprs = exprs; - model.rpar = [[this.T],[this.init]]; - model.ipar = this.N; - model.dep_ut = [false,true]; + this.model.rpar = [[this.T],[this.init]]; + this.model.ipar = new ScilabDouble(this.N); + this.model.dep_ut = [false,true]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/TIME_DELAY.pickle b/js/Linear/TIME_DELAY.pickle index f1fcfb41..91ce14f8 100644 --- a/js/Linear/TIME_DELAY.pickle +++ b/js/Linear/TIME_DELAY.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'init' +aS'model' p3 -aS'T' +aS'init' p4 -aS'N' +aS'T' p5 -atp6 -Rp7 +aS'N' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Linear/VARIABLE_DELAY.js b/js/Linear/VARIABLE_DELAY.js index 0d045edb..9b4fc33f 100644 --- a/js/Linear/VARIABLE_DELAY.js +++ b/js/Linear/VARIABLE_DELAY.js @@ -5,17 +5,17 @@ function VARIABLE_DELAY() { this.T = 1; this.init = 0; this.N = 1024; - model = scicos_model(); - model.sim = list("variable_delay",4); - model.in1 = [[nin],[1]]; - model.out = nin; - model.rpar = [this.T,this.init]; - model.ipar = this.N; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("variable_delay",4); + this.model.in1 = [[nin],[1]]; + this.model.out = new ScilabDouble(nin); + this.model.rpar = [this.T,this.init]; + this.model.ipar = new ScilabDouble(this.N); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } VARIABLE_DELAY.prototype.details = function VARIABLE_DELAY() { @@ -36,8 +36,8 @@ function VARIABLE_DELAY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - nin = model.in1[1-1]; + this.model = arg1.model; + nin = this.model.in1[1-1]; while (true) { [ok,this.T,this.init,this.N,exprs] = scicos_getvalue("Set delay parameters",["Max delay","initial input","Buffer size"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -52,14 +52,14 @@ function VARIABLE_DELAY() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[[-1],[1]],-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[[-1],[1]],-1,[],[]); } if (ok) { graphics.exprs = exprs; - model.rpar = [[this.T],[this.init]]; - model.ipar = this.N; + this.model.rpar = [[this.T],[this.init]]; + this.model.ipar = new ScilabDouble(this.N); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Linear/VARIABLE_DELAY.pickle b/js/Linear/VARIABLE_DELAY.pickle index c57d7ee0..4cf3cbd7 100644 --- a/js/Linear/VARIABLE_DELAY.pickle +++ b/js/Linear/VARIABLE_DELAY.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'init' +aS'model' p3 -aS'T' +aS'init' p4 -aS'N' +aS'T' p5 -atp6 -Rp7 +aS'N' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/MatrixOp/CUMSUM.js b/js/MatrixOp/CUMSUM.js index 5e4fcdc4..fab59e4e 100644 --- a/js/MatrixOp/CUMSUM.js +++ b/js/MatrixOp/CUMSUM.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/CUMSUM.sci" */ function CUMSUM() { CUMSUM.prototype.define = function CUMSUM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "cumsum_m"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } CUMSUM.prototype.details = function CUMSUM() { @@ -40,7 +40,7 @@ function CUMSUM() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -85,15 +85,15 @@ function CUMSUM() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/MatrixOp/CUMSUM.pickle b/js/MatrixOp/CUMSUM.pickle index 6646e7f5..1702aadf 100644 --- a/js/MatrixOp/CUMSUM.pickle +++ b/js/MatrixOp/CUMSUM.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -aS'lab' +aS'typ' p4 -aS'decomptyp' +aS'lab' p5 -atp6 -Rp7 +aS'decomptyp' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/EXTRACT.js b/js/MatrixOp/EXTRACT.js index 1678b4c7..0ddee0c2 100644 --- a/js/MatrixOp/EXTRACT.js +++ b/js/MatrixOp/EXTRACT.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/EXTRACT.sci" */ function EXTRACT() { EXTRACT.prototype.define = function EXTRACT() { - model = scicos_model(); + this.model = scicos_model(); function_name = "extract"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = [1,1,1,1]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp([1])],[sci2exp([1])]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } EXTRACT.prototype.details = function EXTRACT() { @@ -43,7 +43,7 @@ function EXTRACT() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -84,17 +84,17 @@ function EXTRACT() { ok = false; } } - model.ipar = [[this.a],[this.b],[ma],[mb]]; - in1 = [model.in1,model.in2]; + this.model.ipar = [[this.a],[this.b],[ma],[mb]]; + in1 = [this.model.in1,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/EXTRACT.pickle b/js/MatrixOp/EXTRACT.pickle index 632d3a55..07d79ca8 100644 --- a/js/MatrixOp/EXTRACT.pickle +++ b/js/MatrixOp/EXTRACT.pickle @@ -6,12 +6,14 @@ S'a' p2 aS'x' p3 -aS'b' +aS'model' p4 -aS'typ' +aS'b' p5 -atp6 -Rp7 +aS'typ' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/EXTTRI.js b/js/MatrixOp/EXTTRI.js index 575b6398..e2591656 100644 --- a/js/MatrixOp/EXTTRI.js +++ b/js/MatrixOp/EXTTRI.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/EXTTRI.sci" */ function EXTTRI() { EXTTRI.prototype.define = function EXTTRI() { - model = scicos_model(); + this.model = scicos_model(); function_name = "extrilz"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } EXTTRI.prototype.details = function EXTTRI() { @@ -40,7 +40,7 @@ function EXTTRI() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -82,15 +82,15 @@ function EXTTRI() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/MatrixOp/EXTTRI.pickle b/js/MatrixOp/EXTTRI.pickle index 6646e7f5..1702aadf 100644 --- a/js/MatrixOp/EXTTRI.pickle +++ b/js/MatrixOp/EXTTRI.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -aS'lab' +aS'typ' p4 -aS'decomptyp' +aS'lab' p5 -atp6 -Rp7 +aS'decomptyp' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATBKSL.js b/js/MatrixOp/MATBKSL.js index c5af6daa..48a7dd6b 100644 --- a/js/MatrixOp/MATBKSL.js +++ b/js/MatrixOp/MATBKSL.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATBKSL.sci" */ function MATBKSL() { MATBKSL.prototype.define = function MATBKSL() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_bksl"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-1]]; - model.in2 = [[-2],[-3]]; - model.intyp = [1,1]; - model.out = -2; - model.out2 = -3; - model.outtyp = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[-2],[-3]]; + this.model.intyp = [1,1]; + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-3); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATBKSL.prototype.details = function MATBKSL() { @@ -39,7 +39,7 @@ function MATBKSL() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -60,16 +60,16 @@ function MATBKSL() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATBKSL.pickle b/js/MatrixOp/MATBKSL.pickle index e72e5ed5..de46d12f 100644 --- a/js/MatrixOp/MATBKSL.pickle +++ b/js/MatrixOp/MATBKSL.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATCATH.js b/js/MatrixOp/MATCATH.js index 193c14eb..31889bf1 100644 --- a/js/MatrixOp/MATCATH.js +++ b/js/MatrixOp/MATCATH.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATCATH.sci" */ function MATCATH() { MATCATH.prototype.define = function MATCATH() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_cath"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-1]]; - model.in2 = [[-2],[-3]]; - model.intyp = [1,1]; - model.out = -1; - model.out2 = 0; - model.outtyp = -1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[-2],[-3]]; + this.model.intyp = [1,1]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(0); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(2)]; gr_i = []; - this.x = standard_define([2,3],model,label,gr_i); + this.x = standard_define([2,3],this.model,label,gr_i); return new BasicBlock(this.x); } MATCATH.prototype.details = function MATCATH() { @@ -38,7 +38,7 @@ function MATCATH() { this.nin = arguments[0]["nin"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")>1) { @@ -54,13 +54,13 @@ function MATCATH() { out = [-1,0]; it = -1*(ones(this.nin,1)); ot = -1; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { funtyp = 4; - model.sim = list("mat_cath",funtyp); + this.model.sim = list("mat_cath",funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATCATH.pickle b/js/MatrixOp/MATCATH.pickle index f646b261..b8059c1d 100644 --- a/js/MatrixOp/MATCATH.pickle +++ b/js/MatrixOp/MATCATH.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'nin' +aS'model' p3 -aS'lab' +aS'nin' p4 -atp5 -Rp6 +aS'lab' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATCATV.js b/js/MatrixOp/MATCATV.js index 68f2ca62..41205c93 100644 --- a/js/MatrixOp/MATCATV.js +++ b/js/MatrixOp/MATCATV.js @@ -2,28 +2,28 @@ function MATCATV() { MATCATV.prototype.define = function MATCATV() { l1 = [[2],[2]]; - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_catv"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in2 = [[-1],[-1]]; - model.in1 = [[-2],[-3]]; - model.intyp = [-1,-1]; - model.out = 0; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in2 = [[-1],[-1]]; + this.model.in1 = [[-2],[-3]]; + this.model.intyp = [-1,-1]; + this.model.out = new ScilabDouble(0); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(2)]; gr_i = []; - this.x = standard_define([2,3],model,label,gr_i); + this.x = standard_define([2,3],this.model,label,gr_i); return new BasicBlock(this.x); } MATCATV.prototype.details = function MATCATV() { @@ -39,7 +39,7 @@ function MATCATV() { this.nin = arguments[0]["nin"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")>1) { @@ -55,13 +55,13 @@ function MATCATV() { it = -ones(this.nin,1); ot = -1; out = [0,-1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { funtyp = 4; - model.sim = list("mat_catv",funtyp); + this.model.sim = list("mat_catv",funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATCATV.pickle b/js/MatrixOp/MATCATV.pickle index dfc3dbb8..2db43f63 100644 --- a/js/MatrixOp/MATCATV.pickle +++ b/js/MatrixOp/MATCATV.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'nin' +aS'model' p3 -aS'lab' +aS'nin' p4 -atp5 -Rp6 +aS'lab' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATDET.js b/js/MatrixOp/MATDET.js index 3f9d3c79..d06fcb58 100644 --- a/js/MatrixOp/MATDET.js +++ b/js/MatrixOp/MATDET.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATDET.sci" */ function MATDET() { MATDET.prototype.define = function MATDET() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_det"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATDET.prototype.details = function MATDET() { @@ -39,7 +39,7 @@ function MATDET() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -60,16 +60,16 @@ function MATDET() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATDET.pickle b/js/MatrixOp/MATDET.pickle index bd912c03..15536b33 100644 --- a/js/MatrixOp/MATDET.pickle +++ b/js/MatrixOp/MATDET.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATDIAG.js b/js/MatrixOp/MATDIAG.js index 701c7a7c..41cac0d7 100644 --- a/js/MatrixOp/MATDIAG.js +++ b/js/MatrixOp/MATDIAG.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATDIAG.sci" */ function MATDIAG() { MATDIAG.prototype.define = function MATDIAG() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_diag"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = 1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATDIAG.prototype.details = function MATDIAG() { @@ -39,7 +39,7 @@ function MATDIAG() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -60,16 +60,16 @@ function MATDIAG() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATDIAG.pickle b/js/MatrixOp/MATDIAG.pickle index bd912c03..15536b33 100644 --- a/js/MatrixOp/MATDIAG.pickle +++ b/js/MatrixOp/MATDIAG.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATDIV.js b/js/MatrixOp/MATDIV.js index 49d03f43..91442543 100644 --- a/js/MatrixOp/MATDIV.js +++ b/js/MatrixOp/MATDIV.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATDIV.sci" */ function MATDIV() { MATDIV.prototype.define = function MATDIV() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_div"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-2]]; - model.in2 = [[-3],[-3]]; - model.intyp = [1,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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-2]]; + this.model.in2 = [[-3],[-3]]; + this.model.intyp = [1,1]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATDIV.prototype.details = function MATDIV() { @@ -39,7 +39,7 @@ function MATDIV() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -60,16 +60,16 @@ function MATDIV() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATDIV.pickle b/js/MatrixOp/MATDIV.pickle index e72e5ed5..de46d12f 100644 --- a/js/MatrixOp/MATDIV.pickle +++ b/js/MatrixOp/MATDIV.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATEIG.js b/js/MatrixOp/MATEIG.js index c44828fb..2b8e6b7f 100644 --- a/js/MatrixOp/MATEIG.js +++ b/js/MatrixOp/MATEIG.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATEIG.sci" */ function MATEIG() { MATEIG.prototype.define = function MATEIG() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_vps"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(2); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATEIG.prototype.details = function MATEIG() { @@ -40,7 +40,7 @@ function MATEIG() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -87,11 +87,11 @@ function MATEIG() { in1 = [-1,-1]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/MatrixOp/MATEIG.pickle b/js/MatrixOp/MATEIG.pickle index 1f8a0e90..3f91bc29 100644 --- a/js/MatrixOp/MATEIG.pickle +++ b/js/MatrixOp/MATEIG.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -aS'lab' +aS'typ' p4 -aS'decomptyp' +aS'lab' p5 -atp6 -Rp7 +aS'decomptyp' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATEXPM.js b/js/MatrixOp/MATEXPM.js index 175fd28a..e9aa1f53 100644 --- a/js/MatrixOp/MATEXPM.js +++ b/js/MatrixOp/MATEXPM.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATEXPM.sci" */ function MATEXPM() { MATEXPM.prototype.define = function MATEXPM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_expm"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATEXPM.prototype.details = function MATEXPM() { @@ -39,7 +39,7 @@ function MATEXPM() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -60,16 +60,16 @@ function MATEXPM() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATEXPM.pickle b/js/MatrixOp/MATEXPM.pickle index bd912c03..15536b33 100644 --- a/js/MatrixOp/MATEXPM.pickle +++ b/js/MatrixOp/MATEXPM.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATINV.js b/js/MatrixOp/MATINV.js index 16316559..40d54de2 100644 --- a/js/MatrixOp/MATINV.js +++ b/js/MatrixOp/MATINV.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATINV.sci" */ function MATINV() { MATINV.prototype.define = function MATINV() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_inv"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATINV.prototype.details = function MATINV() { @@ -39,7 +39,7 @@ function MATINV() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -60,16 +60,16 @@ function MATINV() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATINV.pickle b/js/MatrixOp/MATINV.pickle index bd912c03..15536b33 100644 --- a/js/MatrixOp/MATINV.pickle +++ b/js/MatrixOp/MATINV.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATLU.js b/js/MatrixOp/MATLU.js index 09cce1c8..41a6989a 100644 --- a/js/MatrixOp/MATLU.js +++ b/js/MatrixOp/MATLU.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATLU.sci" */ function MATLU() { MATLU.prototype.define = function MATLU() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_lu"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -1; - model.intyp = 1; - model.out = [[-1],[-1]]; - model.out2 = [[-1],[-1]]; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-1); + this.model.intyp = new ScilabDouble(1); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-1],[-1]]; + this.model.outtyp = [1,1]; + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = sci2exp(1); gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATLU.prototype.details = function MATLU() { @@ -38,7 +38,7 @@ function MATLU() { this.typ = inverse(arguments[0]["typ"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -62,14 +62,14 @@ function MATLU() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([model.in1,model.in2],it),list([model.out,model.out2],ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list([this.model.in1,this.model.in2],it),list([this.model.out,this.model.out2],ot),[],[]); } if (ok) { funtyp = 4; - model.sim = list(function_name,funtyp); + this.model.sim = list(function_name,funtyp); graphics.exprs = this.lab; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/MatrixOp/MATLU.pickle b/js/MatrixOp/MATLU.pickle index fb806027..b3f171b9 100644 --- a/js/MatrixOp/MATLU.pickle +++ b/js/MatrixOp/MATLU.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -aS'lab' +aS'typ' p4 -atp5 -Rp6 +aS'lab' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATMAGPHI.js b/js/MatrixOp/MATMAGPHI.js index db99a27b..85bdcd7c 100644 --- a/js/MatrixOp/MATMAGPHI.js +++ b/js/MatrixOp/MATMAGPHI.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATMAGPHI.sci" */ function MATMAGPHI() { MATMAGPHI.prototype.define = function MATMAGPHI() { - model = scicos_model(); + this.model = scicos_model(); function_name = "matz_abs"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(2); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-2],[-2]]; + this.model.outtyp = [1,1]; + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATMAGPHI.prototype.details = function MATMAGPHI() { @@ -38,7 +38,7 @@ function MATMAGPHI() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -68,11 +68,11 @@ function MATMAGPHI() { } funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/MatrixOp/MATMAGPHI.pickle b/js/MatrixOp/MATMAGPHI.pickle index 88eb46d5..afcc7aea 100644 --- a/js/MatrixOp/MATMAGPHI.pickle +++ b/js/MatrixOp/MATMAGPHI.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'lab' +aS'model' p3 -aS'decomptyp' +aS'lab' p4 -atp5 -Rp6 +aS'decomptyp' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATMUL.js b/js/MatrixOp/MATMUL.js index 2c2cc096..955f4d7a 100644 --- a/js/MatrixOp/MATMUL.js +++ b/js/MatrixOp/MATMUL.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/MatrixOp/MATMUL.sci" */ function MATMUL() { MATMUL.prototype.define = function MATMUL() { - model = scicos_model(); - model.sim = list("matmul_m",4); - model.in1 = [[-1],[-2]]; - model.in2 = [[-2],[-3]]; - model.out = -1; - model.out2 = -3; - model.dep_ut = [true,false]; - model.ipar = 1; - label = [sci2exp(model.ipar)]; + this.model = scicos_model(); + this.model.sim = list("matmul_m",4); + this.model.in1 = [[-1],[-2]]; + this.model.in2 = [[-2],[-3]]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-3); + this.model.dep_ut = [true,false]; + this.model.ipar = new ScilabDouble(1); + label = [sci2exp(this.model.ipar)]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATMUL.prototype.details = function MATMUL() { @@ -32,9 +32,9 @@ function MATMUL() { this.x = arg1; graphics = this.x.graphics; label = graphics.exprs; - model = this.x.model; - if (model.ipar==[]) { - model.ipar = 1; + this.model = this.x.model; + if (this.model.ipar==[]) { + this.model.ipar = new ScilabDouble(1); } if (size(label,"*")==1) { label[2-1] = sci2exp(1); @@ -63,72 +63,72 @@ function MATMUL() { TABMAX = [[0],[0],[(2^31)-1],[(2^15)-1],[(2^7)-1],[(2^32)-1],[(2^16)-1],[(2^8)-1]]; if (this.rule==2) { if (this.np==0) { - model.sim = list("matmul2_m",4); + this.model.sim = list("matmul2_m",4); } else if (this.np==1) { - model.sim = list("matmul2_s",4); + this.model.sim = list("matmul2_s",4); } else { - model.sim = list("matmul2_e",4); + this.model.sim = list("matmul2_e",4); } } else if (this.rule==3) { if (this.np==0) { - model.sim = list("matbyscal",4); + this.model.sim = list("matbyscal",4); } else if (this.np==1) { - model.sim = list("matbyscal_s",4); + this.model.sim = list("matbyscal_s",4); } else { - model.sim = list("matbyscal_e",4); + this.model.sim = list("matbyscal_e",4); } } else { if ((this.dtype==1)) { - model.sim = list("matmul_m",4); + this.model.sim = list("matmul_m",4); } else if ((this.dtype==2)) { - model.sim = list("matzmul_m",4); + this.model.sim = list("matzmul_m",4); } else if (this.dtype==3) { if (this.np==0) { - model.sim = list("matmul_i32n",4); + this.model.sim = list("matmul_i32n",4); } else if (this.np==1) { - model.sim = list("matmul_i32s",4); + this.model.sim = list("matmul_i32s",4); } else { - model.sim = list("matmul_i32e",4); + this.model.sim = list("matmul_i32e",4); } } else if (this.dtype==4) { if (this.np==0) { - model.sim = list("matmul_i16n",4); + this.model.sim = list("matmul_i16n",4); } else if (this.np==1) { - model.sim = list("matmul_i16s",4); + this.model.sim = list("matmul_i16s",4); } else { - model.sim = list("matmul_i16e",4); + this.model.sim = list("matmul_i16e",4); } } else if (this.dtype==5) { if (this.np==0) { - model.sim = list("matmul_i8n",4); + this.model.sim = list("matmul_i8n",4); } else if (this.np==1) { - model.sim = list("matmul_i8s",4); + this.model.sim = list("matmul_i8s",4); } else { - model.sim = list("matmul_i8e",4); + this.model.sim = list("matmul_i8e",4); } } else if (this.dtype==6) { if (this.np==0) { - model.sim = list("matmul_ui32n",4); + this.model.sim = list("matmul_ui32n",4); } else if (this.np==1) { - model.sim = list("matmul_ui32s",4); + this.model.sim = list("matmul_ui32s",4); } else { - model.sim = list("matmul_ui32e",4); + this.model.sim = list("matmul_ui32e",4); } } else if (this.dtype==7) { if (this.np==0) { - model.sim = list("matmul_ui16n",4); + this.model.sim = list("matmul_ui16n",4); } else if (this.np==1) { - model.sim = list("matmul_ui16s",4); + this.model.sim = list("matmul_ui16s",4); } else { - model.sim = list("matmul_ui16e",4); + this.model.sim = list("matmul_ui16e",4); } } else if (this.dtype==8) { if (this.np==0) { - model.sim = list("matmul_ui8n",4); + this.model.sim = list("matmul_ui8n",4); } else if (this.np==1) { - model.sim = list("matmul_ui8s",4); + this.model.sim = list("matmul_ui8s",4); } else { - model.sim = list("matmul_ui8e",4); + this.model.sim = list("matmul_ui8e",4); } } } @@ -146,14 +146,14 @@ function MATMUL() { in1 = [[-1,-2],[1,1]]; out = [-1,-2]; } - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { label = exprs; - model.ipar = this.rule; - model.rpar = [[kmin],[kmax]]; + this.model.ipar = new ScilabDouble(this.rule); + this.model.rpar = [[kmin],[kmax]]; graphics.exprs = label; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; arg1 = this.x; break; } diff --git a/js/MatrixOp/MATMUL.pickle b/js/MatrixOp/MATMUL.pickle index ca58fcfb..0b53f77c 100644 --- a/js/MatrixOp/MATMUL.pickle +++ b/js/MatrixOp/MATMUL.pickle @@ -6,12 +6,14 @@ S'np' p2 aS'x' p3 -aS'rule' +aS'model' p4 -aS'dtype' +aS'rule' p5 -atp6 -Rp7 +aS'dtype' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/MatrixOp/MATPINV.js b/js/MatrixOp/MATPINV.js index e10268f5..f77d1db0 100644 --- a/js/MatrixOp/MATPINV.js +++ b/js/MatrixOp/MATPINV.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATPINV.sci" */ function MATPINV() { MATPINV.prototype.define = function MATPINV() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_pinv"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -2; - 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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATPINV.prototype.details = function MATPINV() { @@ -39,7 +39,7 @@ function MATPINV() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -60,16 +60,16 @@ function MATPINV() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATPINV.pickle b/js/MatrixOp/MATPINV.pickle index bd912c03..15536b33 100644 --- a/js/MatrixOp/MATPINV.pickle +++ b/js/MatrixOp/MATPINV.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATRESH.js b/js/MatrixOp/MATRESH.js index de34ba14..ff814632 100644 --- a/js/MatrixOp/MATRESH.js +++ b/js/MatrixOp/MATRESH.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATRESH.sci" */ function MATRESH() { MATRESH.prototype.define = function MATRESH() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_reshape"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp([1,1])],[sci2exp([1,1])]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATRESH.prototype.details = function MATRESH() { @@ -42,7 +42,7 @@ function MATRESH() { this.out = arguments[0]["out"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -91,14 +91,14 @@ function MATRESH() { } if (ok) { label = this.lab; - [model,graphics,ok] = set_io(model,graphics,list(this.l1,it),list(this.out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(this.l1,it),list(this.out,ot),[],[]); } if (ok) { funtyp = 4; - model.sim = list(function_name,funtyp); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATRESH.pickle b/js/MatrixOp/MATRESH.pickle index 02b5b27a..c6cc8e26 100644 --- a/js/MatrixOp/MATRESH.pickle +++ b/js/MatrixOp/MATRESH.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'lab' p2 -aS'out' +aS'l1' p3 -aS'typ' +aS'x' p4 -aS'lab' +aS'model' p5 -aS'l1' +aS'typ' p6 -atp7 -Rp8 +aS'out' +p7 +atp8 +Rp9 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATSING.js b/js/MatrixOp/MATSING.js index 7cd36526..00867c61 100644 --- a/js/MatrixOp/MATSING.js +++ b/js/MatrixOp/MATSING.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATSING.sci" */ function MATSING() { MATSING.prototype.define = function MATSING() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_sing"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATSING.prototype.details = function MATSING() { @@ -40,7 +40,7 @@ function MATSING() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -90,11 +90,11 @@ function MATSING() { } funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/MatrixOp/MATSING.pickle b/js/MatrixOp/MATSING.pickle index 1f8a0e90..3f91bc29 100644 --- a/js/MatrixOp/MATSING.pickle +++ b/js/MatrixOp/MATSING.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -aS'lab' +aS'typ' p4 -aS'decomptyp' +aS'lab' p5 -atp6 -Rp7 +aS'decomptyp' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATSUM.js b/js/MatrixOp/MATSUM.js index 92d22248..fda1ba97 100644 --- a/js/MatrixOp/MATSUM.js +++ b/js/MatrixOp/MATSUM.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATSUM.sci" */ function MATSUM() { MATSUM.prototype.define = function MATSUM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "mat_sum"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(0)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATSUM.prototype.details = function MATSUM() { @@ -40,7 +40,7 @@ function MATSUM() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -88,14 +88,14 @@ function MATSUM() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; + in1 = [this.model.in1,this.model.in2]; funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/MatrixOp/MATSUM.pickle b/js/MatrixOp/MATSUM.pickle index 6646e7f5..1702aadf 100644 --- a/js/MatrixOp/MATSUM.pickle +++ b/js/MatrixOp/MATSUM.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -aS'lab' +aS'typ' p4 -aS'decomptyp' +aS'lab' p5 -atp6 -Rp7 +aS'decomptyp' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATTRAN.js b/js/MatrixOp/MATTRAN.js index 7f798932..26aaeca5 100644 --- a/js/MatrixOp/MATTRAN.js +++ b/js/MatrixOp/MATTRAN.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/MatrixOp/MATTRAN.sci" */ function MATTRAN() { MATTRAN.prototype.define = function MATTRAN() { - model = scicos_model(); - model.sim = list("mattran_m",4); - model.in1 = -1; - model.in2 = -2; - model.out = -2; - model.out2 = -1; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mattran_m",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(-1); + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATTRAN.prototype.details = function MATTRAN() { @@ -29,7 +29,7 @@ function MATTRAN() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==1) { label[2-1] = sci2exp(1); } @@ -54,16 +54,16 @@ function MATTRAN() { message("Datatype is not supported"); ok = false; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/MATTRAN.pickle b/js/MatrixOp/MATTRAN.pickle index 59d34284..8fcd032a 100644 --- a/js/MatrixOp/MATTRAN.pickle +++ b/js/MatrixOp/MATTRAN.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -aS'rule' +aS'typ' p4 -atp5 -Rp6 +aS'rule' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/MatrixOp/MATZCONJ.js b/js/MatrixOp/MATZCONJ.js index f2a49d4d..fb995ca6 100644 --- a/js/MatrixOp/MATZCONJ.js +++ b/js/MatrixOp/MATZCONJ.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATZCONJ.sci" */ function MATZCONJ() { MATZCONJ.prototype.define = function MATZCONJ() { - model = scicos_model(); + this.model = scicos_model(); function_name = "matz_conj"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -1; - model.in2 = -2; - model.intyp = 2; - model.out = -1; - model.out2 = -2; - model.outtyp = 2; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(2); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(2); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = []; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATZCONJ.prototype.details = function MATZCONJ() { diff --git a/js/MatrixOp/MATZCONJ.pickle b/js/MatrixOp/MATZCONJ.pickle index 7f173bfa..1ad63449 100644 --- a/js/MatrixOp/MATZCONJ.pickle +++ b/js/MatrixOp/MATZCONJ.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/MATZREIM.js b/js/MatrixOp/MATZREIM.js index 5fa97e04..4b42c962 100644 --- a/js/MatrixOp/MATZREIM.js +++ b/js/MatrixOp/MATZREIM.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/MATZREIM.sci" */ function MATZREIM() { MATZREIM.prototype.define = function MATZREIM() { - model = scicos_model(); + this.model = scicos_model(); function_name = "matz_reim"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(2); + this.model.out = [[-1],[-1]]; + this.model.out2 = [[-2],[-2]]; + this.model.outtyp = [1,1]; + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = sci2exp(1); gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATZREIM.prototype.details = function MATZREIM() { @@ -38,7 +38,7 @@ function MATZREIM() { this.decomptyp = arguments[0]["decomptyp"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -68,11 +68,11 @@ function MATZREIM() { } funtyp = 4; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; + this.model.sim = list(function_name,funtyp); + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/MatrixOp/MATZREIM.pickle b/js/MatrixOp/MATZREIM.pickle index 7d5c8ddc..44cf122c 100644 --- a/js/MatrixOp/MATZREIM.pickle +++ b/js/MatrixOp/MATZREIM.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'lab' +aS'model' p3 -aS'decomptyp' +aS'lab' p4 -atp5 -Rp6 +aS'decomptyp' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/RICC.js b/js/MatrixOp/RICC.js index 6f73ee6c..9a96442c 100644 --- a/js/MatrixOp/RICC.js +++ b/js/MatrixOp/RICC.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/RICC.sci" */ function RICC() { RICC.prototype.define = function RICC() { - model = scicos_model(); + this.model = scicos_model(); function_name = "ricc_m"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = [[-1],[-1],[-1]]; - model.in2 = [[-1],[-1],[-1]]; - model.intyp = [1,1,1]; - model.out = -1; - model.out2 = -1; - model.outtyp = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = [[1],[1]]; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = [[-1],[-1],[-1]]; + this.model.in2 = [[-1],[-1],[-1]]; + this.model.intyp = [1,1,1]; + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = [[1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } RICC.prototype.details = function RICC() { @@ -41,7 +41,7 @@ function RICC() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -50,17 +50,17 @@ function RICC() { if (!ok) { break; } - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.model.out2]; it = [1,1,1]; ot = 1; label = exprs; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { - model.ipar = [[this.tpe],[this.mod]]; + this.model.ipar = [[this.tpe],[this.mod]]; graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/RICC.pickle b/js/MatrixOp/RICC.pickle index 3ab8d419..9f9ca752 100644 --- a/js/MatrixOp/RICC.pickle +++ b/js/MatrixOp/RICC.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'tpe' +aS'model' p3 -aS'mod' +aS'tpe' p4 -atp5 -Rp6 +aS'mod' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/ROOTCOEF.js b/js/MatrixOp/ROOTCOEF.js index 08d5e3f9..94e09951 100644 --- a/js/MatrixOp/ROOTCOEF.js +++ b/js/MatrixOp/ROOTCOEF.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/ROOTCOEF.sci" */ function ROOTCOEF() { ROOTCOEF.prototype.define = function ROOTCOEF() { - model = scicos_model(); + this.model = scicos_model(); function_name = "root_coef"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-2); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } ROOTCOEF.prototype.details = function ROOTCOEF() { @@ -41,7 +41,7 @@ function ROOTCOEF() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==14) { label[9-1] = []; } @@ -62,16 +62,16 @@ function ROOTCOEF() { message("Datatype is not supported"); ok = false; } - in1 = [this.inp,model.in2]; - out = [this.inp+1,model.out2]; + in1 = [this.inp,this.model.in2]; + out = [this.inp+1,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/ROOTCOEF.pickle b/js/MatrixOp/ROOTCOEF.pickle index 49151f65..acb596f2 100644 --- a/js/MatrixOp/ROOTCOEF.pickle +++ b/js/MatrixOp/ROOTCOEF.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'inp' +aS'model' p3 aS'typ' p4 -atp5 -Rp6 +aS'inp' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/MatrixOp/SQRT.js b/js/MatrixOp/SQRT.js index 32b04337..cddf98f2 100644 --- a/js/MatrixOp/SQRT.js +++ b/js/MatrixOp/SQRT.js @@ -1,18 +1,18 @@ /* autogenerated from "macros/MatrixOp/SQRT.sci" */ function SQRT() { SQRT.prototype.define = function SQRT() { - model = scicos_model(); - model.sim = list("mat_sqrt",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.out = -1; - model.out2 = -2; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("mat_sqrt",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } SQRT.prototype.details = function SQRT() { @@ -29,7 +29,7 @@ function SQRT() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.typ,exprs] = scicos_getvalue("Set SQRT Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); if (!ok) { @@ -45,16 +45,16 @@ function SQRT() { } it = this.typ; ot = this.typ; - in1 = [model.in1,model.in2]; - out = [model.out,model.out2]; + in1 = [this.model.in1,this.model.in2]; + out = [this.model.out,this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/SQRT.pickle b/js/MatrixOp/SQRT.pickle index 887aa198..9030e62d 100644 --- a/js/MatrixOp/SQRT.pickle +++ b/js/MatrixOp/SQRT.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'typ' +aS'model' p3 -atp4 -Rp5 +aS'typ' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/MatrixOp/SUBMAT.js b/js/MatrixOp/SUBMAT.js index 18382fdf..5db415ed 100644 --- a/js/MatrixOp/SUBMAT.js +++ b/js/MatrixOp/SUBMAT.js @@ -1,28 +1,28 @@ /* autogenerated from "macros/MatrixOp/SUBMAT.sci" */ function SUBMAT() { SUBMAT.prototype.define = function SUBMAT() { - model = scicos_model(); + this.model = scicos_model(); function_name = "submat"; funtyp = 4; - model.sim = list(function_name,funtyp); - model.in1 = -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,false]; + this.model.sim = list(function_name,funtyp); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = [[1],[1],[1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - this.x = standard_define([2.5,2],model,label,gr_i); + this.x = standard_define([2.5,2],this.model,label,gr_i); return new BasicBlock(this.x); } SUBMAT.prototype.details = function SUBMAT() { @@ -49,7 +49,7 @@ function SUBMAT() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(label,"*")==5) { label[6-1] = sci2exp([1,1]); } @@ -90,17 +90,17 @@ function SUBMAT() { message("index of ending column is out of range"); ok = false; } - model.ipar = [[this.a],[this.b],[this.c],[this.d]]; + this.model.ipar = [[this.a],[this.b],[this.c],[this.d]]; in1 = [this.inp[1-1],this.inp[2-1]]; out = [(this.b-this.a)+1,(this.d-this.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); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + this.model.sim = list(function_name,funtyp); graphics.exprs = label; arg1.graphics = graphics; - arg1.model = model; + arg1.model = this.model; this.x = arg1; break; } diff --git a/js/MatrixOp/SUBMAT.pickle b/js/MatrixOp/SUBMAT.pickle index 8af6ffcd..7a5a7843 100644 --- a/js/MatrixOp/SUBMAT.pickle +++ b/js/MatrixOp/SUBMAT.pickle @@ -14,10 +14,12 @@ aS'inp' p6 aS'x' p7 -aS'typ' +aS'model' p8 -atp9 -Rp10 +aS'typ' +p9 +atp10 +Rp11 .(dp0 S'model.dstate' p1 diff --git a/js/Misc/AUTOMAT.js b/js/Misc/AUTOMAT.js index d4305671..2ba7bda8 100644 --- a/js/Misc/AUTOMAT.js +++ b/js/Misc/AUTOMAT.js @@ -11,20 +11,20 @@ function AUTOMAT() { exprs = [[string(NMode)],[string(this.Minitial)],[string(NX)],[sci2exp(this.X0)],[sci2exp(this.XP)],[sci2exp(C1)],[sci2exp(C2)]]; ipar = [[NMode],[this.Minitial],[NX],[this.XP],[C1],[C2]]; rpar = [this.X0]; - model = scicos_model(); - model.sim = list("automat",10004); - model.in1 = [[2*NX+1],[2*NX+1]]; - model.out = [[2],[2*NX]]; - model.state = ones(2*NX,1); - model.nzcross = 1; - model.blocktype = "c"; - model.evtout = 1; - model.firing = -1; - model.dep_ut = [false,true]; - model.ipar = ipar; - model.rpar = rpar; + this.model = scicos_model(); + this.model.sim = list("automat",10004); + this.model.in1 = [[2*NX+1],[2*NX+1]]; + this.model.out = [[2],[2*NX]]; + this.model.state = new ScilabDouble(ones(2*NX,1)); + this.model.nzcross = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,true]; + this.model.ipar = ipar; + this.model.rpar = rpar; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } AUTOMAT.prototype.details = function AUTOMAT() { @@ -39,8 +39,8 @@ function AUTOMAT() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; + this.model = arg1.model; + ipar = this.model.ipar; NMode = ipar[1-1]; NX = ipar[3-1]; while (true) { @@ -120,18 +120,18 @@ function AUTOMAT() { } } if (!ModifEncore) { - [model,graphics,this.ok] = check_io(model,graphics,INP,OUT,[],[1]); + [model,graphics,this.ok] = check_io(this.model,graphics,INP,OUT,[],[1]); if (!this.ok) { break; } - model.nzcross = nzcross; - model.state = ones(2*NX,1); + this.model.nzcross = new ScilabDouble(nzcross); + this.model.state = new ScilabDouble(ones(2*NX,1)); graphics.gr_i[1-1][1-1] = "txt=[\'Automaton\';\'nM="+string(NMode)+",nX="+string(NX)+"\'];"; graphics.exprs = exprs; this.x.graphics = graphics; - model.ipar = ipar; - model.rpar = rpar; - this.x.model = model; + this.model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.x.model = this.model; break; } } diff --git a/js/Misc/AUTOMAT.pickle b/js/Misc/AUTOMAT.pickle index 4870b5a1..01ba4b1e 100644 --- a/js/Misc/AUTOMAT.pickle +++ b/js/Misc/AUTOMAT.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'ok' p2 aS'X0' p3 -aS'ok' +aS'x' p4 aS'XP' p5 -aS'Minitial' +aS'model' p6 -atp7 -Rp8 +aS'Minitial' +p7 +atp8 +Rp9 .(dp0 S'[model,graphics,this.ok]' p1 diff --git a/js/Misc/BACKLASH.js b/js/Misc/BACKLASH.js index 29813621..30a8b1ec 100644 --- a/js/Misc/BACKLASH.js +++ b/js/Misc/BACKLASH.js @@ -2,16 +2,16 @@ function BACKLASH() { BACKLASH.prototype.define = function BACKLASH() { exprs = [["0"],["1"],["1"]]; - model = scicos_model(); - model.sim = list("backlash",4); - model.in1 = 1; - model.out = 1; - model.rpar = [[0],[1]]; - model.nzcross = 2; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("backlash",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[0],[1]]; + this.model.nzcross = new ScilabDouble(2); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BACKLASH.prototype.details = function BACKLASH() { @@ -32,8 +32,8 @@ function BACKLASH() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - rpar = model.rpar; + this.model = arg1.model; + rpar = this.model.rpar; while (true) { [ok,this.ini,this.gap,this.zcr,exprs] = scicos_getvalue("Set backlash parameters",["initial output","gap","use zero-crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -44,13 +44,13 @@ function BACKLASH() { rpar[1-1] = this.ini; rpar[2-1] = this.gap; if (this.zcr!=0) { - model.nzcross = 2; + this.model.nzcross = new ScilabDouble(2); } else { - model.nzcross = 0; + this.model.nzcross = new ScilabDouble(0); } - model.rpar = rpar; + this.model.rpar = rpar; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/BACKLASH.pickle b/js/Misc/BACKLASH.pickle index c782a351..b102f178 100644 --- a/js/Misc/BACKLASH.pickle +++ b/js/Misc/BACKLASH.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'ini' +aS'model' p3 -aS'zcr' +aS'ini' p4 -aS'gap' +aS'zcr' p5 -atp6 -Rp7 +aS'gap' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Misc/BOUNCE.js b/js/Misc/BOUNCE.js index b55e03cc..899d7c5d 100644 --- a/js/Misc/BOUNCE.js +++ b/js/Misc/BOUNCE.js @@ -23,19 +23,19 @@ function BOUNCE() { this.rpar2 = this.rpar1; state = [this.x,this.xd,this.y,this.yd]; state = transpose(state); - model = scicos_model(); - model.sim = list("bounce_ball",4); - model.in1 = []; - model.out = [[n],[n]]; - model.state = state.slice(); - model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; - model.ipar = ipar; - model.nzcross = n*(n-1)/2+4*n; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("bounce_ball",4); + this.model.in1 = []; + this.model.out = [[n],[n]]; + this.model.state = state.slice(); + this.model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; + this.model.ipar = ipar; + this.model.nzcross = new ScilabDouble(n*(n-1)/2+4*n); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.rpar1))],[strcat(sci2exp(this.rpar2))],[strcat(sci2exp(this.walls))],[strcat(sci2exp(this.x))],[strcat(sci2exp(this.xd))],[strcat(sci2exp(this.y))],[strcat(sci2exp(this.yd))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BOUNCE.prototype.details = function BOUNCE() { @@ -68,7 +68,7 @@ function BOUNCE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")<9) { exprs[8-1] = "9.81"; exprs[9-1] = "0"; @@ -102,7 +102,7 @@ function BOUNCE() { if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,[],[n,n],[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[],[n,n],[],[]); if (ok) { k = 1; ipar = []; @@ -114,15 +114,15 @@ function BOUNCE() { k = k+1; } } - model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; - model.ipar = ipar; + this.model.rpar = [[this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]]; + this.model.ipar = ipar; state = [this.xt,this.xd,this.y,this.yd]; state = transpose(state); - model.state = state.slice(); - model.nzcross = n*(n-1)/2+4*n; + this.model.state = state.slice(); + this.model.nzcross = new ScilabDouble(n*(n-1)/2+4*n); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/BOUNCE.pickle b/js/Misc/BOUNCE.pickle index 38fc60ad..1b412589 100644 --- a/js/Misc/BOUNCE.pickle +++ b/js/Misc/BOUNCE.pickle @@ -20,10 +20,12 @@ aS'y' p9 aS'x' p10 -aS'xt' +aS'model' p11 -atp12 -Rp13 +aS'xt' +p12 +atp13 +Rp14 .(dp0 S'arg1' p1 diff --git a/js/Misc/BOUNCEXY.js b/js/Misc/BOUNCEXY.js index a720b4ed..1f4509c1 100644 --- a/js/Misc/BOUNCEXY.js +++ b/js/Misc/BOUNCEXY.js @@ -9,12 +9,12 @@ function BOUNCEXY() { this.xmax = 5; this.ymin = 0; this.ymax = 15; - model = scicos_model(); - model.sim = list("bouncexy",4); - model.in1 = [[-1],[-1]]; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; + this.model = scicos_model(); + this.model.sim = list("bouncexy",4); + this.model.in1 = [[-1],[-1]]; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); z = []; for (i=1;i<=size(this.clrs,"*");i+=1) { z[6*(i-1)+1-1] = 0; @@ -24,15 +24,15 @@ function BOUNCEXY() { z[6*(i-1)+5-1] = 0.000; z[6*(i-1)+6-1] = 64.0*360.000; } - model.dstate = z; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = [[this.win],[this.imode],[this.clrs.slice()]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model.dstate = z; + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = [[this.win],[this.imode],[this.clrs.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = [[strcat(sci2exp(this.clrs))],[strcat(sci2exp(this.siz))],[strcat(sci2exp(this.win))],[strcat(sci2exp(1))],[strcat(sci2exp(this.xmin))],[strcat(sci2exp(this.xmax))],[strcat(sci2exp(this.ymin))],[strcat(sci2exp(this.ymax))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BOUNCEXY.prototype.details = function BOUNCEXY() { @@ -63,8 +63,8 @@ function BOUNCEXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; while (true) { [ok,this.clrs,this.siz,this.win,this.imode,this.xmin,this.xmax,this.ymin,this.ymax,exprs] = scicos_getvalue("Set Scope parameters",["colors","radii","window number (-1 for automatic)","animation mode (0,1)","Xmin","Xmax","Ymin","Ymax"],list("vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -101,12 +101,12 @@ function BOUNCEXY() { z[6*(i-1)+5-1] = 0.000; z[6*(i-1)+6-1] = 64.0*360.000; } - model.dstate = z; - model.rpar = rpar; - model.ipar = ipar; + this.model.dstate = z; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/BOUNCEXY.pickle b/js/Misc/BOUNCEXY.pickle index 1c25cd48..2e83fd54 100644 --- a/js/Misc/BOUNCEXY.pickle +++ b/js/Misc/BOUNCEXY.pickle @@ -18,10 +18,12 @@ aS'xmin' p8 aS'x' p9 -aS'ymin' +aS'model' p10 -atp11 -Rp12 +aS'ymin' +p11 +atp12 +Rp13 .(dp0 S'clrs' p1 diff --git a/js/Misc/BPLATFORM.js b/js/Misc/BPLATFORM.js index 8314c565..8c7f2bb0 100644 --- a/js/Misc/BPLATFORM.js +++ b/js/Misc/BPLATFORM.js @@ -8,17 +8,17 @@ function BPLATFORM() { this.xmax = 5; this.ymin = 0; this.ymax = 15; - model = scicos_model(); - model.sim = list("bplatform2",5); - model.in1 = [[1],[1]]; - model.evtin = 1; - model.dstate = 0; - model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; - exprs = string(model.rpar); + this.model = scicos_model(); + this.model.sim = list("bplatform2",5); + this.model.in1 = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; + exprs = string(this.model.rpar); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } BPLATFORM.prototype.details = function BPLATFORM() { @@ -47,8 +47,8 @@ function BPLATFORM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; while (true) { [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.ymax,exprs] = scicos_getvalue("Set Scope parameters",["pendulum length","cart size (square side)","slope","Xmin","Xmax","Ymin","Ymax"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -71,10 +71,10 @@ function BPLATFORM() { message(mess); } else { rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/BPLATFORM.pickle b/js/Misc/BPLATFORM.pickle index 5dc54d6a..9da37d3f 100644 --- a/js/Misc/BPLATFORM.pickle +++ b/js/Misc/BPLATFORM.pickle @@ -16,10 +16,12 @@ aS'xmin' p7 aS'x' p8 -aS'ymin' +aS'model' p9 -atp10 -Rp11 +aS'ymin' +p10 +atp11 +Rp12 .(dp0 S'model.dstate' p1 diff --git a/js/Misc/CBLOCK.js b/js/Misc/CBLOCK.js index 1c43099e..30976cb0 100644 --- a/js/Misc/CBLOCK.js +++ b/js/Misc/CBLOCK.js @@ -13,23 +13,23 @@ function CBLOCK() { this.ipar = []; funam = "toto"; this.ng = 0; - model = scicos_model(); - model.sim = list(" ",2004); - model.in1 = in1; - model.out = out; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; - model.nzcross = this.ng; + this.model = scicos_model(); + this.model.sim = list(" ",2004); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = this.ipar; + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; + this.model.nzcross = new ScilabDouble(this.ng); label = list(transpose([funam,"n",sci2exp(in1),sci2exp(out),sci2exp(clkin),sci2exp(clkout),sci2exp(x0),sci2exp(0),sci2exp(z0),sci2exp(this.rpar),sci2exp(this.ipar),sci2exp(auto),"y","n"]),[]); gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } CBLOCK.prototype.details = function CBLOCK() { @@ -71,7 +71,7 @@ function CBLOCK() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -121,7 +121,7 @@ function CBLOCK() { if (funam==" ") { break; } - if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=this.ng||sign(size(model.evtout,"*"))!=sign(nevout)) { + if (this.model.sim[1-1]!=funam||sign(size(this.model.state,"*"))!=sign(nx)||sign(size(this.model.dstate,"*"))!=sign(nz)||this.model.nzcross!=this.ng||sign(size(this.model.evtout,"*"))!=sign(nevout)) { tt = []; } tt = label[2-1]; @@ -132,22 +132,22 @@ function CBLOCK() { break; } } else { - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); if (ok) { - model.sim = list(funam,funtyp); - model.in1 = this.i; - model.out = this.o; - model.evtin = this.ci; - model.evtout = this.co; - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.firing = this.auto0; - model.dep_ut = dep_ut; - model.nzcross = this.ng; + this.model.sim = list(funam,funtyp); + this.model.in1 = new ScilabDouble(this.i); + this.model.out = new ScilabDouble(this.o); + this.model.evtin = new ScilabDouble(this.ci); + this.model.evtout = new ScilabDouble(this.co); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.dep_ut = dep_ut; + this.model.nzcross = new ScilabDouble(this.ng); label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; diff --git a/js/Misc/CBLOCK.pickle b/js/Misc/CBLOCK.pickle index 1d575875..06d2644c 100644 --- a/js/Misc/CBLOCK.pickle +++ b/js/Misc/CBLOCK.pickle @@ -30,12 +30,14 @@ aS'ipar' p14 aS'x' p15 -aS'z' +aS'model' p16 -aS'function_name' +aS'z' p17 -atp18 -Rp19 +aS'function_name' +p18 +atp19 +Rp20 .(dp0 S'ci' p1 diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js index d7fd487e..84051ad4 100644 --- a/js/Misc/CBLOCK4.js +++ b/js/Misc/CBLOCK4.js @@ -2,18 +2,18 @@ function CBLOCK4() { CBLOCK4.prototype.define = function CBLOCK4() { funam = "toto"; - model = scicos_model(); - model.sim = list(" ",2004); - model.in1 = 1; - model.in2 = 1; - model.intyp = 1; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.dep_ut = [true,false]; - label = list([[funam],["n"],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2])],[sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]],[]); + this.model = scicos_model(); + this.model.sim = list(" ",2004); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.dep_ut = [true,false]; + label = list([[funam],["n"],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2])],[sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]],[]); gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } CBLOCK4.prototype.details = function CBLOCK4() { @@ -65,7 +65,7 @@ function CBLOCK4() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -113,11 +113,11 @@ function CBLOCK4() { if (funam==" ") { break; } - if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=this.nzcr||sign(size(model.evtout,"*"))!=sign(nevout)) { + if (this.model.sim[1-1]!=funam||sign(size(this.model.state,"*"))!=sign(nx)||sign(size(this.model.dstate,"*"))!=sign(nz)||this.model.nzcross!=this.nzcr||sign(size(this.model.evtout,"*"))!=sign(nevout)) { tt = []; } tt = label[2-1]; - [model,graphics,ok] = set_io(model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); + [model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); } if (ok) { while (true) { @@ -127,19 +127,19 @@ function CBLOCK4() { break; } } else { - model.sim = list(funam,funtyp); - model.state = this.xx; - model.dstate = this.z; - model.odstate = this.oz; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.opar = this.opar; - model.firing = this.auto0; - model.nzcross = this.nzcr; - model.nmode = this.nmode; - model.dep_ut = dep_ut; + this.model.sim = list(funam,funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.odstate = new ScilabDouble(this.oz); + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.opar = new ScilabDouble(this.opar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.nzcross = new ScilabDouble(this.nzcr); + this.model.nmode = new ScilabDouble(this.nmode); + this.model.dep_ut = dep_ut; label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; diff --git a/js/Misc/CBLOCK4.pickle b/js/Misc/CBLOCK4.pickle index 46f7a08d..f06d22b2 100644 --- a/js/Misc/CBLOCK4.pickle +++ b/js/Misc/CBLOCK4.pickle @@ -10,7 +10,7 @@ aS'ci' p4 aS'rpar' p5 -aS'xx' +aS'auto0' p6 aS'out' p7 @@ -28,7 +28,7 @@ aS'z' p13 aS'CC4' p14 -aS'auto0' +aS'xx' p15 aS'nzcr' p16 @@ -44,10 +44,12 @@ aS'ipar' p21 aS'x' p22 -aS'ot' +aS'model' p23 -atp24 -Rp25 +aS'ot' +p24 +atp25 +Rp26 .(dp0 S'model.odstate' p1 diff --git a/js/Misc/CONSTRAINT2_c.js b/js/Misc/CONSTRAINT2_c.js index 4bd4e01b..8d86b801 100644 --- a/js/Misc/CONSTRAINT2_c.js +++ b/js/Misc/CONSTRAINT2_c.js @@ -4,17 +4,17 @@ function CONSTRAINT2_c() { this.x0 = [0]; this.xd0 = [0]; this.id = [0]; - model = scicos_model(); - model.sim = list("constraint_c",10004); - model.in1 = 1; - model.out = [[1],[1]]; - model.state = [[this.x0],[this.xd0]]; - model.ipar = this.id; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("constraint_c",10004); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.state = [[this.x0],[this.xd0]]; + this.model.ipar = this.id; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = list(strcat(sci2exp(this.x0)),strcat(sci2exp(this.xd0)),strcat(sci2exp(this.id))); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONSTRAINT2_c.prototype.details = function CONSTRAINT2_c() { @@ -35,7 +35,7 @@ function CONSTRAINT2_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { ask_again = false; [ok,this.x0,this.xd0,this.id,exprs] = scicos_getvalue("Set Constraint block parameters",["Initial guess values of states x","Initial guess values of derivative x\'","Id(i)=1: if x\'(i) is present in the feedback, else Id(i)=0"],list("vec",-1,"vec",-1,"vec",-1),exprs); @@ -70,12 +70,12 @@ function CONSTRAINT2_c() { } if (!ask_again) { graphics.exprs = exprs; - model.state = [[this.x0],[this.xd0]]; - model.out = [[N],[N]]; - model.in1 = N; - model.ipar = this.id; + this.model.state = [[this.x0],[this.xd0]]; + this.model.out = [[N],[N]]; + this.model.in1 = new ScilabDouble(N); + this.model.ipar = this.id; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/CONSTRAINT2_c.pickle b/js/Misc/CONSTRAINT2_c.pickle index 2453bf3d..83d54cab 100644 --- a/js/Misc/CONSTRAINT2_c.pickle +++ b/js/Misc/CONSTRAINT2_c.pickle @@ -2,16 +2,18 @@ c__builtin__ set p0 ((lp1 -S'x' +S'id' p2 -aS'x0' +aS'x' p3 -aS'id' +aS'model' p4 -aS'xd0' +aS'x0' p5 -atp6 -Rp7 +aS'xd0' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Misc/CONSTRAINT_c.js b/js/Misc/CONSTRAINT_c.js index da135a7c..084c7ef7 100644 --- a/js/Misc/CONSTRAINT_c.js +++ b/js/Misc/CONSTRAINT_c.js @@ -2,17 +2,17 @@ function CONSTRAINT_c() { CONSTRAINT_c.prototype.define = function CONSTRAINT_c() { this.x0 = [[0],[0]]; - model = scicos_model(); - model.sim = list("constraint_c",10004); - model.in1 = 1; - model.out = 1; - model.ipar = 0; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("constraint_c",10004); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(0); + this.model.state = this.x0; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = "0"; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONSTRAINT_c.prototype.details = function CONSTRAINT_c() { @@ -28,7 +28,7 @@ function CONSTRAINT_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,exprs] = scicos_getvalue("Set solver block parameters","Initial guess values",list("vec",-1),exprs); if (!ok) { @@ -39,15 +39,15 @@ function CONSTRAINT_c() { if (N<=0) { message("number of states (constraints) must be > 0 "); } else { - [model,graphics,ok] = check_io(model,graphics,N,N,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,N,N,[],[]); if (ok) { graphics.exprs = exprs; - model.state = [[this.x0],[zeros(N,1)]]; - model.out = N; - model.in1 = N; - model.ipar = -1*ones(N,1); + this.model.state = [[this.x0],[zeros(N,1)]]; + this.model.out = new ScilabDouble(N); + this.model.in1 = new ScilabDouble(N); + this.model.ipar = new ScilabDouble(-1*ones(N,1)); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/CONSTRAINT_c.pickle b/js/Misc/CONSTRAINT_c.pickle index 928d3033..21c28204 100644 --- a/js/Misc/CONSTRAINT_c.pickle +++ b/js/Misc/CONSTRAINT_c.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'x0' +aS'model' p3 -atp4 -Rp5 +aS'x0' +p4 +atp5 +Rp6 .(dp0 S'[model,graphics,ok]' p1 diff --git a/js/Misc/DEADBAND.js b/js/Misc/DEADBAND.js index a88d6e57..dc380f40 100644 --- a/js/Misc/DEADBAND.js +++ b/js/Misc/DEADBAND.js @@ -4,18 +4,18 @@ function DEADBAND() { this.minp = -.5; this.maxp = .5; rpar = [[this.maxp],[this.minp]]; - model = scicos_model(); - model.sim = list("deadband",4); - model.in1 = 1; - model.nzcross = 2; - model.nmode = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [true,false]; - exprs = [[string(this.maxp)],[string(this.minp)],[string(model.nmode)]]; + this.model = scicos_model(); + this.model.sim = list("deadband",4); + this.model.in1 = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + exprs = [[string(this.maxp)],[string(this.minp)],[string(this.model.nmode)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEADBAND.prototype.details = function DEADBAND() { @@ -36,7 +36,7 @@ function DEADBAND() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,this.zeroc,exprs] = scicos_getvalue("Set Deadband parameters",["End of dead band","Start of dead band","zero crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -46,17 +46,17 @@ function DEADBAND() { message("Upper limit must be > Lower limit"); } else { rpar = [[this.maxp],[this.minp]]; - model.rpar = rpar; + this.model.rpar = rpar; if (this.zeroc!=0) { - model.nzcross = 2; - model.nmode = 1; + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); } else { - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/DEADBAND.pickle b/js/Misc/DEADBAND.pickle index 4597f082..496fcd93 100644 --- a/js/Misc/DEADBAND.pickle +++ b/js/Misc/DEADBAND.pickle @@ -6,12 +6,14 @@ S'minp' p2 aS'x' p3 -aS'maxp' +aS'model' p4 aS'zeroc' p5 -atp6 -Rp7 +aS'maxp' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Misc/DEBUG.js b/js/Misc/DEBUG.js index eb8969d4..fd1547c1 100644 --- a/js/Misc/DEBUG.js +++ b/js/Misc/DEBUG.js @@ -1,12 +1,12 @@ /* autogenerated from "macros/Misc/DEBUG.sci" */ function DEBUG() { DEBUG.prototype.define = function DEBUG() { - model = scicos_model(); - model.sim = list("%debug_scicos",99); - model.blocktype = "d"; + this.model = scicos_model(); + this.model.sim = list("%debug_scicos",99); + this.model.blocktype = new ScilabString("d"); exprs = list("","xcos_debug_gui(flag,block);"); gr_i = []; - this.x = standard_define([8,2],model,exprs,gr_i); + this.x = standard_define([8,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DEBUG.prototype.details = function DEBUG() { diff --git a/js/Misc/DEBUG.pickle b/js/Misc/DEBUG.pickle index 287dcc53..fff46cd6 100644 --- a/js/Misc/DEBUG.pickle +++ b/js/Misc/DEBUG.pickle @@ -6,12 +6,14 @@ S'debug_scicos' p2 aS'x' p3 -aS'TMPDIR' +aS'model' p4 -aS'dialog' +aS'TMPDIR' p5 -atp6 -Rp7 +aS'dialog' +p6 +atp7 +Rp8 .(dp0 S'exprs[2-1]' p1 diff --git a/js/Misc/DIFF_f.js b/js/Misc/DIFF_f.js index f9aba023..cc27fc20 100644 --- a/js/Misc/DIFF_f.js +++ b/js/Misc/DIFF_f.js @@ -2,16 +2,16 @@ function DIFF_f() { DIFF_f.prototype.define = function DIFF_f() { this.x0 = [[0],[0]]; - model = scicos_model(); - model.sim = list("diffblk",10001); - model.in1 = 1; - model.out = 1; - model.state = this.x0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("diffblk",10001); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.state = this.x0; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DIFF_f.prototype.details = function DIFF_f() { @@ -30,16 +30,16 @@ function DIFF_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.x0,this.xd0,exprs] = scicos_getvalue("Set continuous linear system parameters",["Initial state","Initial Derivative"],list("vec",1,"vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - model.state = [[this.x0.slice()],[this.xd0.slice()]]; + this.model.state = [[this.x0.slice()],[this.xd0.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } this.x.model.firing = []; diff --git a/js/Misc/DIFF_f.pickle b/js/Misc/DIFF_f.pickle index ed2ddff9..51912c36 100644 --- a/js/Misc/DIFF_f.pickle +++ b/js/Misc/DIFF_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'x0' +aS'model' p3 -aS'xd0' +aS'x0' p4 -atp5 -Rp6 +aS'xd0' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Misc/EDGETRIGGER.js b/js/Misc/EDGETRIGGER.js index 61d495a1..fcbf7b41 100644 --- a/js/Misc/EDGETRIGGER.js +++ b/js/Misc/EDGETRIGGER.js @@ -2,18 +2,18 @@ function EDGETRIGGER() { EDGETRIGGER.prototype.define = function EDGETRIGGER() { this.edge = 1; - model = scicos_model(); - model.sim = list("edgetrig",4); - model.in1 = 1; - model.out = 1; - model.dstate = 0; - model.nzcross = 1; - model.ipar = sign(this.edge); - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("edgetrig",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(sign(this.edge)); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string(this.edge)]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EDGETRIGGER.prototype.details = function EDGETRIGGER() { @@ -30,16 +30,16 @@ function EDGETRIGGER() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.edge,exprs] = scicos_getvalue("Set edge trigger block parameters",["rising (1), falling (-1), both (0)"],list("vec",1),exprs); if (!ok) { break; } - model.ipar = sign(this.edge); + this.model.ipar = new ScilabDouble(sign(this.edge)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Misc/EDGETRIGGER.pickle b/js/Misc/EDGETRIGGER.pickle index a2ffe47d..40ed449b 100644 --- a/js/Misc/EDGETRIGGER.pickle +++ b/js/Misc/EDGETRIGGER.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'edge' +aS'model' p3 -atp4 -Rp5 +aS'edge' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Misc/EDGE_TRIGGER.js b/js/Misc/EDGE_TRIGGER.js index 452ad747..655cd0a4 100644 --- a/js/Misc/EDGE_TRIGGER.js +++ b/js/Misc/EDGE_TRIGGER.js @@ -11,51 +11,51 @@ function EDGE_TRIGGER() { scs_m_1.objs[7-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [60,0]; graphics.sz = [60,40]; graphics.exprs = "0"; - model.ipar = 0; + this.model.ipar = new ScilabDouble(0); graphics.pin = 5; graphics.pout = 6; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [160,0]; graphics.sz = [60,40]; graphics.exprs = [["0"],["0"]]; - model.evtin = []; - model.nzcross = 0; - model.nmode = 0; + this.model.evtin = []; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); graphics.pin = 6; graphics.peout = [[7],[0]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; blk = scs_m_1.objs[3-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,10]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pout = 5; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[3-1] = blk; blk = scs_m_1.objs[4-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [170,-60]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pein = 7; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[4-1] = blk; lnk = scs_m_1.objs[5-1]; lnk.from = [3,1,0]; @@ -72,13 +72,13 @@ function EDGE_TRIGGER() { scs_m_1.objs[7-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.in1 = 1; - model.evtout = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } EDGE_TRIGGER.prototype.details = function EDGE_TRIGGER() { @@ -111,40 +111,40 @@ function EDGE_TRIGGER() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (diffobjs(this.xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; diff --git a/js/Misc/EDGE_TRIGGER.pickle b/js/Misc/EDGE_TRIGGER.pickle index 054aef01..7e4dd5be 100644 --- a/js/Misc/EDGE_TRIGGER.pickle +++ b/js/Misc/EDGE_TRIGGER.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'xxn' +aS'model' p3 -atp4 -Rp5 +aS'xxn' +p4 +atp5 +Rp6 .(dp0 S'lnk.ct' p1 diff --git a/js/Misc/ENDBLK.js b/js/Misc/ENDBLK.js index c28cda3b..10d576b9 100644 --- a/js/Misc/ENDBLK.js +++ b/js/Misc/ENDBLK.js @@ -4,9 +4,9 @@ function ENDBLK() { scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[-159.096,811.104,-121.216,617.984,1323,1008,331,284,630,480,0,7,1.4],Title="ENDBLK",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",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="END_c",graphics=scicos_graphics(orig=[272.104,249.11733],sz=[40,40],flip=true,theta=0,exprs="1.000E+08",pin=[],pout=[],pein=2,peout=2,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim=list("scicosexit",4),in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=1,evtout=1,state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="d",firing=1.000e+08,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[2-1] = scicos_link(xx=[[292.104],[292.104],[261.83733],[261.83733],[292.104],[292.104]],yy=[[243.40305],[234.45067],[234.45067],[305.584],[305.584],[294.83162]],id="drawlink",thick=[0,0],ct=[5,-1],from=[1,1,0],to=[1,1,1]); - model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); + this.model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } ENDBLK.prototype.details = function ENDBLK() { @@ -39,40 +39,40 @@ function ENDBLK() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (!this.isequalbitwise[this.xxn-1][xx-1]) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)||or(this.model.in2!=model_n.in2)||or(this.model.out2!=model_n.out2)||or(this.model.outtyp!=model_n.outtyp)||or(this.model.intyp!=model_n.intyp)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))||(size(model.evtin,"*")!=size(model_n.evtin,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))||(size(this.model.evtin,"*")!=size(model_n.evtin,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; diff --git a/js/Misc/ENDBLK.pickle b/js/Misc/ENDBLK.pickle index 4704173c..c05aa082 100644 --- a/js/Misc/ENDBLK.pickle +++ b/js/Misc/ENDBLK.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'xxn' +aS'model' p3 -aS'isequalbitwise' +aS'xxn' p4 -atp5 -Rp6 +aS'isequalbitwise' +p5 +atp6 +Rp7 .(dp0 S'ppath' p1 diff --git a/js/Misc/EXPRESSION.pickle b/js/Misc/EXPRESSION.pickle index 6042a857..4d43bd5f 100644 --- a/js/Misc/EXPRESSION.pickle +++ b/js/Misc/EXPRESSION.pickle @@ -14,10 +14,12 @@ aS'%nin' p6 aS'x' p7 -aS'%usenz' +aS'model' p8 -atp9 -Rp10 +aS'%usenz' +p9 +atp10 +Rp11 .(dp0 S'arg1' p1 diff --git a/js/Misc/Extract_Activation.js b/js/Misc/Extract_Activation.js index f6e70284..50fee2cd 100644 --- a/js/Misc/Extract_Activation.js +++ b/js/Misc/Extract_Activation.js @@ -12,49 +12,49 @@ function Extract_Activation() { scs_m_1.objs[8-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [80,0]; graphics.sz = [60,40]; graphics.exprs = [["0"],["0"]]; - model.evtin = []; - model.nzcross = 0; - model.nmode = 0; + this.model.evtin = []; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); graphics.pin = 7; graphics.peout = [[5],[6]]; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [80,-80]; graphics.sz = [80,40]; graphics.pein = [[5],[6]]; graphics.peout = 8; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; blk = scs_m_1.objs[3-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,10]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pout = 7; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[3-1] = blk; blk = scs_m_1.objs[4-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [110,-140]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pein = 8; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[4-1] = blk; lnk = scs_m_1.objs[5-1]; lnk.ct = [5,-1]; @@ -77,13 +77,13 @@ function Extract_Activation() { scs_m_1.objs[8-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.in1 = 1; - model.evtout = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } Extract_Activation.prototype.details = function Extract_Activation() { diff --git a/js/Misc/Extract_Activation.pickle b/js/Misc/Extract_Activation.pickle index f976beaf..401a10ed 100644 --- a/js/Misc/Extract_Activation.pickle +++ b/js/Misc/Extract_Activation.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'lnk.ct' p1 diff --git a/js/Misc/HYSTHERESIS.js b/js/Misc/HYSTHERESIS.js index c077a1e2..bb85aa33 100644 --- a/js/Misc/HYSTHERESIS.js +++ b/js/Misc/HYSTHERESIS.js @@ -5,18 +5,18 @@ function HYSTHERESIS() { ipar = [0]; this.nzz = 2; rpar = [[1],[0],[1],[0]]; - model = scicos_model(); - model.sim = list("hystheresis",4); - model.in1 = in1; - model.out = 1; - model.rpar = rpar; - model.nzcross = this.nzz; - model.nmode = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("hystheresis",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.nzcross = new ScilabDouble(this.nzz); + this.model.nmode = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(rpar)],[string(sign(this.nzz))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } HYSTHERESIS.prototype.details = function HYSTHERESIS() { @@ -41,7 +41,7 @@ function HYSTHERESIS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.high_lim,this.low_lim,this.out_high,this.out_low,this.nzz,exprs] = scicos_getvalue("Set parameters",["switch on at","switch off at","output when on","output when off","use zero crossing: yes (1), no (0)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -51,13 +51,13 @@ function HYSTHERESIS() { message("switch on value must be larger than switch off value"); } else { graphics.exprs = exprs; - model.rpar = transpose([this.high_lim,this.low_lim,this.out_high,this.out_low]); + this.model.rpar = transpose([this.high_lim,this.low_lim,this.out_high,this.out_low]); if (this.nzz>0) { this.nzz = 2; } - model.nzcross = this.nzz; + this.model.nzcross = new ScilabDouble(this.nzz); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/HYSTHERESIS.pickle b/js/Misc/HYSTHERESIS.pickle index 46931193..790c93e8 100644 --- a/js/Misc/HYSTHERESIS.pickle +++ b/js/Misc/HYSTHERESIS.pickle @@ -14,8 +14,10 @@ aS'high_lim' p6 aS'x' p7 -atp8 -Rp9 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Misc/IMPSPLIT_f.js b/js/Misc/IMPSPLIT_f.js index 11ad9e4c..029257a9 100644 --- a/js/Misc/IMPSPLIT_f.js +++ b/js/Misc/IMPSPLIT_f.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/Misc/IMPSPLIT_f.sci" */ function IMPSPLIT_f() { IMPSPLIT_f.prototype.define = function IMPSPLIT_f() { - model = scicos_model(); - model.sim = "limpsplit"; + this.model = scicos_model(); + this.model.sim = new ScilabString("limpsplit"); mo = modelica(); mo.model = "limpsplit"; mo.inputs = "n"; mo.outputs = [["n"],["n"]]; - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - this.x = standard_define([1,1]/3,model,[],[]); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.x = standard_define([1,1]/3,this.model,[],[]); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I","I"]; return new BasicBlock(this.x); diff --git a/js/Misc/IMPSPLIT_f.pickle b/js/Misc/IMPSPLIT_f.pickle index efd88680..5a701c06 100644 --- a/js/Misc/IMPSPLIT_f.pickle +++ b/js/Misc/IMPSPLIT_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Misc/LOGICAL_OP.js b/js/Misc/LOGICAL_OP.js index 597217ca..fbd68077 100644 --- a/js/Misc/LOGICAL_OP.js +++ b/js/Misc/LOGICAL_OP.js @@ -4,16 +4,16 @@ function LOGICAL_OP() { in1 = [[-1],[-1]]; ipar = [0]; this.nin = 2; - model = scicos_model(); - model.sim = list("logicalop",4); - model.in1 = in1; - model.out = -1; - model.ipar = ipar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("logicalop",4); + this.model.in1 = in1; + this.model.out = new ScilabDouble(-1); + this.model.ipar = ipar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.nin)],[string(ipar)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOGICAL_OP.prototype.details = function LOGICAL_OP() { @@ -36,7 +36,7 @@ function LOGICAL_OP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,1)==2) { exprs = [[exprs],[sci2exp(1)],[sci2exp(0)]]; } @@ -66,26 +66,26 @@ function LOGICAL_OP() { this.tp = 1; } if (this.Datatype==1) { - model.sim = list("logicalop",4); - model.ipar = [this.rule]; + this.model.sim = list("logicalop",4); + this.model.ipar = [this.rule]; } else { if (this.Datatype==3) { - model.sim = list("logicalop_i32",4); + this.model.sim = list("logicalop_i32",4); } else if (this.Datatype==4) { - model.sim = list("logicalop_i16",4); + this.model.sim = list("logicalop_i16",4); } else if (this.Datatype==5) { - model.sim = list("logicalop_i8",4); + this.model.sim = list("logicalop_i8",4); } else if (this.Datatype==6) { - model.sim = list("logicalop_ui32",4); + this.model.sim = list("logicalop_ui32",4); } else if (this.Datatype==7) { - model.sim = list("logicalop_ui16",4); + this.model.sim = list("logicalop_ui16",4); } else if (this.Datatype==8) { - model.sim = list("logicalop_ui8",4); + this.model.sim = list("logicalop_ui8",4); } else { message("Datatype is not supported"); ok = false; } - model.ipar = [[this.rule],[this.tp]]; + this.model.ipar = [[this.rule],[this.tp]]; } if (ok) { it = this.Datatype*ones(this.nin,1); @@ -93,10 +93,10 @@ function LOGICAL_OP() { in1 = [-ones(this.nin,1),-2*ones(this.nin,1)]; if ((this.rule!=5)&&(this.nin==1)) { out = [1,1]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } else { out = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } } if (ok) { @@ -116,7 +116,7 @@ function LOGICAL_OP() { graphics.exprs = exprs; graphics.style = ["blockWithLabel;displayedLabel="+label]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/LOGICAL_OP.pickle b/js/Misc/LOGICAL_OP.pickle index 8096a120..80f571a8 100644 --- a/js/Misc/LOGICAL_OP.pickle +++ b/js/Misc/LOGICAL_OP.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'Datatype' +S'nin' p2 -aS'x' +aS'Datatype' p3 -aS'nin' -p4 aS'tp' -p5 +p4 aS'rule' +p5 +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index 8a23fe8b..d7396e0f 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -10,24 +10,24 @@ function MBLOCK() { this.pprop = [[0],[0]]; nameF = "generic"; exprs = tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(this.pprop.slice()),nameF,[]); - model = scicos_model(); - model.blocktype = "c"; - model.dep_ut = [false,true]; - model.rpar = []; + this.model = scicos_model(); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[paramv[i-1].slice()]]; + this.model.rpar = [[this.model.rpar],[paramv[i-1].slice()]]; } mo = modelica(); mo.model = nameF; mo.parameters = list(param,paramv); - model.sim = list(mo.model,30004); + this.model.sim = list(mo.model,30004); mo.inputs = this.in1; mo.outputs = this.out; - model.in1 = ones(size(mo.inputs,"r"),1); - model.out = ones(size(mo.outputs,"r"),1); - model.equations = mo; + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"r"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"r"),1)); + this.model.equations = mo; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = this.intype; this.x.graphics.out_implicit = this.outtype; return new BasicBlock(this.x); @@ -57,14 +57,14 @@ function MBLOCK() { this.Tfunam = arguments[0]["Tfunam"] this.lab_1 = inverse(arguments[0]["lab_1"]) this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; if (this.type[exprs-1]==15) { paramv = list(); this.pprop = []; - for (i=1;i<=size(model.rpar,"*");i+=1) { - paramv[$+1-1] = string(model.rpar[i-1]); + for (i=1;i<=size(this.model.rpar,"*");i+=1) { + paramv[$+1-1] = string(this.model.rpar[i-1]); this.pprop[$+1-1] = 0; } exprs = tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(this.pprop.slice()),exprs[1-1][7-1],exprs[2-1]); @@ -180,7 +180,7 @@ function MBLOCK() { if (ok) { intypex = find(this.intype=="I"); outtypex = find(this.outtype=="I"); - [model,graphics,ok] = set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); + [model,graphics,ok] = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); } if (ok) { Tparam_lab = evstr(this.Tparam); @@ -234,7 +234,7 @@ function MBLOCK() { tt = mgetl(this.funam); } else { tt = exprs.funtxt; - mo = model.equations; + mo = this.model.equations; if (mo.model!=nameF) { tt = []; } @@ -254,12 +254,12 @@ function MBLOCK() { } else { mo.parameters = list(transpose(param),paramv); } - model.equations = mo; - model.rpar = []; + this.model.equations = new ScilabDouble(mo); + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[paramv[i-1].slice()]]; + this.model.rpar = [[this.model.rpar],[paramv[i-1].slice()]]; } - model.sim[1-1] = this.funam; + this.model.sim[('1', 'double')] = new ScilabDouble(this.funam); exprs.in1 = this.lab_1[1-1]; exprs.intype = this.lab_1[2-1]; exprs.out = this.lab_1[3-1]; @@ -280,7 +280,7 @@ function MBLOCK() { exprs.pprop = this.lab_1[6-1]; exprs.nameF = this.lab_1[7-1]; exprs.funtxt = tt; - this.x.model = model; + this.x.model = this.model; graphics.gr_i[1-1][1-1] = "txt=[\'Modelica\';\' "+nameF+" \'];"; graphics.in_implicit = this.intype; graphics.out_implicit = this.outtype; diff --git a/js/Misc/MBLOCK.pickle b/js/Misc/MBLOCK.pickle index ca23a3b3..cad8a7b6 100644 --- a/js/Misc/MBLOCK.pickle +++ b/js/Misc/MBLOCK.pickle @@ -24,16 +24,18 @@ aS'funam' p11 aS'x' p12 -aS'out' +aS'model' p13 -aS'type' +aS'out' p14 -aS'Tintype' +aS'type' p15 -aS'Tfunam' +aS'Tintype' p16 -atp17 -Rp18 +aS'Tfunam' +p17 +atp18 +Rp19 .(dp0 S'rhs_txt' p1 @@ -71,10 +73,9 @@ g11 sS'lab_2_tmp' p15 g5 -sS'x.model' +sS"model.sim[('1', 'double')]" p16 -g7 -sS'exprs.outtype' +NsS'exprs.outtype' p17 g11 sS'exprs.intype' @@ -131,81 +132,82 @@ g5 sS'x.graphics.in_implicit' p36 g5 -sS'[ok,tt]' +sS'x.model' p37 +g7 +sS'[ok,tt]' +p38 g11 sS'mo.parameters' -p38 +p39 g5 sS'Tparam_sz' -p39 +p40 g11 sS'pprop' -p40 +p41 g23 sS'model.out' -p41 +p42 g11 sS'exprs.in1' -p42 +p43 g11 sS'model.equations' -p43 +p44 g7 sS'mo.outputs' -p44 +p45 g23 sS'intype' -p45 +p46 g5 sS'x.graphics.out_implicit' -p46 +p47 g23 sS'in1' -p47 +p48 g5 sS'model.rpar' -p48 +p49 g23 sS'model.in1' -p49 +p50 g11 sS'lhs_txt' -p50 +p51 g2 sS'outtype' -p51 +p52 g23 sS'graphics' -p52 +p53 g7 sS'intypex' -p53 +p54 g11 sS'lab_1' -p54 +p55 g5 sS'lab_2' -p55 -NsS'paramv[$+1-1]' p56 +NsS'paramv[$+1-1]' +p57 g2 sS'[model,graphics,ok]' -p57 +p58 g11 sS'ok' -p58 -S'boolean' p59 -sS'model.blocktype' +S'boolean' p60 +sS'model.blocktype' +p61 g2 sS'exprs.param' -p61 -g11 -sS'model.sim[1-1]' p62 -NsS'mo' +g11 +sS'mo' p63 g7 sS'x.graphics' @@ -228,7 +230,7 @@ p69 g2 sS'r' p70 -g59 +g60 sS'lab_txt' p71 g2 diff --git a/js/Misc/MEMORY_f.js b/js/Misc/MEMORY_f.js index c41ba30f..796c5f41 100644 --- a/js/Misc/MEMORY_f.js +++ b/js/Misc/MEMORY_f.js @@ -4,17 +4,17 @@ function MEMORY_f() { z = 0; in1 = 1; exprs = [[string(z)],[string(1)]]; - model = scicos_model(); - model.sim = "memo"; - model.in1 = in1; - model.out = in1; - model.evtin = 1; - model.dstate = 0; - model.rpar = z; - model.blocktype = "m"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("memo"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.rpar = new ScilabDouble(z); + this.model.blocktype = new ScilabString("m"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MEMORY_f.prototype.details = function MEMORY_f() { @@ -33,7 +33,7 @@ function MEMORY_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.a,this.inh,exprs] = scicos_getvalue("Set memory block parameters",["initial condition","Inherit (1: no, 0: yes)"],list("vec",-1,"vec",1),exprs); if (!ok) { @@ -44,7 +44,7 @@ function MEMORY_f() { } else { this.inh = 1; } - [model,graphics,ok] = check_io(model,graphics,-1,-1,this.inh,[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,-1,this.inh,[]); out = size(this.a,"*"); if (out==0) { ok = false; @@ -53,11 +53,11 @@ function MEMORY_f() { in1 = out; if (ok) { graphics.exprs = exprs; - model.rpar = this.a; - model.in1 = in1; - model.out = out; + this.model.rpar = new ScilabDouble(this.a); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/MEMORY_f.pickle b/js/Misc/MEMORY_f.pickle index 01a64319..7bd771a3 100644 --- a/js/Misc/MEMORY_f.pickle +++ b/js/Misc/MEMORY_f.pickle @@ -6,10 +6,12 @@ S'a' p2 aS'x' p3 -aS'inh' +aS'model' p4 -atp5 -Rp6 +aS'inh' +p5 +atp6 +Rp7 .(dp0 S'model.dstate' p1 diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index 9d7de2f0..aaaf1dc5 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -10,24 +10,24 @@ function MPBLOCK() { pprop = []; nameF = "myModel"; exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]); - model = scicos_model(); - model.blocktype = "c"; - model.dep_ut = [true,true]; - model.rpar = []; + this.model = scicos_model(); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,true]; + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[paramv[i-1].slice()]]; + this.model.rpar = [[this.model.rpar],[paramv[i-1].slice()]]; } mo = modelica(); mo.model = nameF; mo.parameters = list(param,paramv); - model.sim = list(mo.model,10004); + this.model.sim = list(mo.model,10004); mo.inputs = this.in1; mo.outputs = this.out; - model.in1 = ones(size(mo.inputs,"r"),1); - model.out = ones(size(mo.outputs,"r"),1); - model.equations = mo; + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"r"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"r"),1)); + this.model.equations = mo; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = this.intype; this.x.graphics.out_implicit = this.outtype; return new BasicBlock(this.x); @@ -42,14 +42,14 @@ function MPBLOCK() { } MPBLOCK.prototype.set = function MPBLOCK() { this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; if (this.type[exprs-1]==15) { paramv = list(); pprop = []; - for (i=1;i<=size(model.rpar,"*");i+=1) { - paramv[$+1-1] = string(model.rpar[i-1]); + for (i=1;i<=size(this.model.rpar,"*");i+=1) { + paramv[$+1-1] = string(this.model.rpar[i-1]); pprop[$+1-1] = 0; } exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),exprs[1-1][7-1],exprs[2-1]); @@ -165,7 +165,7 @@ function MPBLOCK() { if (ok) { intypex = find(this.intype=="I"); outtypex = find(this.outtype=="I"); - [model,graphics,ok] = set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); + [model,graphics,ok] = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); } if (ok) { Tparam_lab = evstr(Tparam); @@ -231,12 +231,12 @@ function MPBLOCK() { mo.parameters = list(transpose(param),paramv); } } - model.equations = mo; - model.rpar = []; + this.model.equations = new ScilabDouble(mo); + this.model.rpar = []; for (i=1;i<=lstsize(paramv);i+=1) { - model.rpar = [[model.rpar],[double(paramv[i-1].slice())]]; + this.model.rpar = [[this.model.rpar],[double(paramv[i-1].slice())]]; } - model.sim[1-1] = this.funam; + this.model.sim[('1', 'double')] = new ScilabDouble(this.funam); exprs.in1 = lab_1[1-1]; exprs.intype = lab_1[2-1]; exprs.out = lab_1[3-1]; @@ -257,7 +257,7 @@ function MPBLOCK() { exprs.pprop = lab_1[6-1]; exprs.nameF = lab_1[7-1]; exprs.funtxt = ""; - this.x.model = model; + this.x.model = this.model; graphics.gr_i[1-1][1-1] = "txt=[\' "+nameF+" \'];"; graphics.in_implicit = this.intype; graphics.out_implicit = this.outtype; diff --git a/js/Misc/MPBLOCK.pickle b/js/Misc/MPBLOCK.pickle index 8111b876..254048a6 100644 --- a/js/Misc/MPBLOCK.pickle +++ b/js/Misc/MPBLOCK.pickle @@ -12,12 +12,14 @@ aS'funam' p5 aS'x' p6 -aS'type' +aS'model' p7 -aS'out' +aS'type' p8 -atp9 -Rp10 +aS'out' +p9 +atp10 +Rp11 .(dp0 S'rhs_txt' p1 @@ -109,87 +111,87 @@ g5 sS'paramv' p34 g5 -sS'gr_i' +sS"model.sim[('1', 'double')]" p35 +NsS'gr_i' +p36 g5 sS'x.graphics.in_implicit' -p36 +p37 g5 sS'x.model' -p37 +p38 g9 sS'mo.parameters' -p38 +p39 g5 sS'Tparam_sz' -p39 +p40 g7 sS'pprop' -p40 +p41 g5 sS'model.out' -p41 +p42 g7 sS'exprs.in1' -p42 +p43 g7 sS'model.equations' -p43 +p44 g9 sS'mo.outputs' -p44 +p45 g23 sS'intype' -p45 +p46 g5 sS'x.graphics.out_implicit' -p46 +p47 g23 sS'in1' -p47 +p48 g5 sS'model.rpar' -p48 +p49 g23 sS'model.in1' -p49 +p50 g7 sS'lhs_txt' -p50 +p51 g2 sS'outtype' -p51 +p52 g23 sS'graphics' -p52 +p53 g9 sS'intypex' -p53 +p54 g7 sS'lab_1' -p54 +p55 g5 sS'lab_2' -p55 -NsS'paramv[$+1-1]' p56 +NsS'paramv[$+1-1]' +p57 g2 sS'[model,graphics,ok]' -p57 +p58 g7 sS'ok' -p58 -S'boolean' p59 -sS'model.blocktype' +S'boolean' p60 +sS'model.blocktype' +p61 g2 sS'exprs.param' -p61 -g7 -sS'model.sim[1-1]' p62 -NsS'mo' +g7 +sS'mo' p63 g9 sS'x.graphics' @@ -212,7 +214,7 @@ p69 g2 sS'r' p70 -g59 +g60 sS'lab_txt' p71 g2 diff --git a/js/Misc/PAL_f.js b/js/Misc/PAL_f.js index acb871f7..4b4f51bb 100644 --- a/js/Misc/PAL_f.js +++ b/js/Misc/PAL_f.js @@ -3,15 +3,15 @@ function PAL_f() { PAL_f.prototype.define = function PAL_f() { scs = scicos_diagram(); scs.props.title = "Palette"; - model = scicos_model(); - model.sim = "palette"; - model.in1 = []; - model.out = []; - model.rpar = scs; - model.blocktype = "h"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("palette"); + this.model.in1 = []; + this.model.out = []; + this.model.rpar = new ScilabDouble(scs); + this.model.blocktype = new ScilabString("h"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); this.x.graphics.id = scs.props.title[1-1]; return new BasicBlock(this.x); } diff --git a/js/Misc/PAL_f.pickle b/js/Misc/PAL_f.pickle index 5419ab57..3c09443d 100644 --- a/js/Misc/PAL_f.pickle +++ b/js/Misc/PAL_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Misc/PENDULUM_ANIM.js b/js/Misc/PENDULUM_ANIM.js index 968e7ba2..375b3739 100644 --- a/js/Misc/PENDULUM_ANIM.js +++ b/js/Misc/PENDULUM_ANIM.js @@ -8,17 +8,17 @@ function PENDULUM_ANIM() { this.xmax = 5; this.ymin = -5; this.ymax = 5; - model = scicos_model(); - model.sim = list("anim_pen",5); - model.in1 = [[1],[1]]; - model.evtin = 1; - model.dstate = 0; - model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; - exprs = string(model.rpar); + this.model = scicos_model(); + this.model.sim = list("anim_pen",5); + this.model.in1 = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; + exprs = string(this.model.rpar); gr_i = []; - this.x = standard_define([3,3],model,exprs,gr_i); + this.x = standard_define([3,3],this.model,exprs,gr_i); return new BasicBlock(this.x); } PENDULUM_ANIM.prototype.details = function PENDULUM_ANIM() { @@ -47,8 +47,8 @@ function PENDULUM_ANIM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; while (true) { [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.ymax,exprs] = scicos_getvalue("Set Scope parameters",["pendulum length","cart size (square side)","slope","Xmin","Xmax","Ymin","Ymax"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -71,10 +71,10 @@ function PENDULUM_ANIM() { message(mess); } else { rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/PENDULUM_ANIM.pickle b/js/Misc/PENDULUM_ANIM.pickle index 5dc54d6a..9da37d3f 100644 --- a/js/Misc/PENDULUM_ANIM.pickle +++ b/js/Misc/PENDULUM_ANIM.pickle @@ -16,10 +16,12 @@ aS'xmin' p7 aS'x' p8 -aS'ymin' +aS'model' p9 -atp10 -Rp11 +aS'ymin' +p10 +atp11 +Rp12 .(dp0 S'model.dstate' p1 diff --git a/js/Misc/RATELIMITER.js b/js/Misc/RATELIMITER.js index 37ed141f..55ea69c5 100644 --- a/js/Misc/RATELIMITER.js +++ b/js/Misc/RATELIMITER.js @@ -4,16 +4,16 @@ function RATELIMITER() { this.minp = -1; this.maxp = 1; rpar = [[this.maxp],[this.minp]]; - model = scicos_model(); - model.sim = list("ratelimiter",4); - model.in1 = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("ratelimiter",4); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.maxp)],[string(this.minp)]]; gr_i = []; - this.x = standard_define([3.5,2],model,exprs,gr_i); + this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RATELIMITER.prototype.details = function RATELIMITER() { @@ -32,7 +32,7 @@ function RATELIMITER() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,exprs] = scicos_getvalue("Set rate limiter parameters",["max slope","min slope"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -42,10 +42,10 @@ function RATELIMITER() { message("We must have max_slope> 0 > min_slope."); } else { rpar = [[this.maxp],[this.minp]]; - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/RATELIMITER.pickle b/js/Misc/RATELIMITER.pickle index b1b68570..d2560e45 100644 --- a/js/Misc/RATELIMITER.pickle +++ b/js/Misc/RATELIMITER.pickle @@ -6,10 +6,12 @@ S'minp' p2 aS'x' p3 -aS'maxp' +aS'model' p4 -atp5 -Rp6 +aS'maxp' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Misc/RELATIONALOP.js b/js/Misc/RELATIONALOP.js index 3243c91f..9cf2543e 100644 --- a/js/Misc/RELATIONALOP.js +++ b/js/Misc/RELATIONALOP.js @@ -3,16 +3,16 @@ function RELATIONALOP() { RELATIONALOP.prototype.define = function RELATIONALOP() { ipar = [2]; label = "<"; - model = scicos_model(); - model.sim = list("relationalop",4); - model.in1 = [[1],[1]]; - model.out = 1; - model.ipar = ipar; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("relationalop",4); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.ipar = ipar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(ipar)],[string(0)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label]; return new BasicBlock(this.x); } @@ -34,7 +34,7 @@ function RELATIONALOP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,1)==2) { exprs = [[exprs],[sci2exp(1)]]; } @@ -52,19 +52,19 @@ function RELATIONALOP() { ok = false; } if ((this.Datatype==1)) { - model.sim = list("relational_op",4); + this.model.sim = list("relational_op",4); } else if ((this.Datatype==3||this.Datatype==9)) { - model.sim = list("relational_op_i32",4); + this.model.sim = list("relational_op_i32",4); } else if ((this.Datatype==4)) { - model.sim = list("relational_op_i16",4); + this.model.sim = list("relational_op_i16",4); } else if ((this.Datatype==5)) { - model.sim = list("relational_op_i8",4); + this.model.sim = list("relational_op_i8",4); } else if ((this.Datatype==6)) { - model.sim = list("relational_op_ui32",4); + this.model.sim = list("relational_op_ui32",4); } else if ((this.Datatype==7)) { - model.sim = list("relational_op_ui16",4); + this.model.sim = list("relational_op_ui16",4); } else if ((this.Datatype==8)) { - model.sim = list("relational_op_ui8",4); + this.model.sim = list("relational_op_ui8",4); } else { message("Datatype is not supported"); ok = false; @@ -74,7 +74,7 @@ function RELATIONALOP() { ot = this.Datatype; in1 = [[-1,-2],[-1,-2]]; out = [-1,-2]; - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); } if (ok) { if (this.rule==0) { @@ -92,11 +92,11 @@ function RELATIONALOP() { } graphics.exprs = exprs; graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label]; - model.ipar = [this.rule]; - model.nzcross = this.zcr; - model.nmode = this.zcr; + this.model.ipar = [this.rule]; + this.model.nzcross = new ScilabDouble(this.zcr); + this.model.nmode = new ScilabDouble(this.zcr); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Misc/RELATIONALOP.pickle b/js/Misc/RELATIONALOP.pickle index e7d1051e..ee99972f 100644 --- a/js/Misc/RELATIONALOP.pickle +++ b/js/Misc/RELATIONALOP.pickle @@ -6,12 +6,14 @@ S'Datatype' p2 aS'x' p3 -aS'zcr' +aS'model' p4 -aS'rule' +aS'zcr' p5 -atp6 -Rp7 +aS'rule' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Misc/SPLIT_f.js b/js/Misc/SPLIT_f.js index cb64d887..5cd7069b 100644 --- a/js/Misc/SPLIT_f.js +++ b/js/Misc/SPLIT_f.js @@ -1,13 +1,13 @@ /* autogenerated from "macros/Misc/SPLIT_f.sci" */ function SPLIT_f() { SPLIT_f.prototype.define = function SPLIT_f() { - model = scicos_model(); - model.sim = "lsplit"; - model.in1 = -1; - model.out = [[-1],[-1],[-1]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; - this.x = standard_define([1,1]/3,model,[],[]); + this.model = scicos_model(); + this.model.sim = new ScilabString("lsplit"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = [[-1],[-1],[-1]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.x = standard_define([1,1]/3,this.model,[],[]); return new BasicBlock(this.x); } SPLIT_f.prototype.details = function SPLIT_f() { diff --git a/js/Misc/SPLIT_f.pickle b/js/Misc/SPLIT_f.pickle index c7dbe9ad..79869450 100644 --- a/js/Misc/SPLIT_f.pickle +++ b/js/Misc/SPLIT_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Misc/SUPER_f.js b/js/Misc/SUPER_f.js index 5aab1088..0643d0d6 100644 --- a/js/Misc/SUPER_f.js +++ b/js/Misc/SUPER_f.js @@ -11,15 +11,15 @@ function SUPER_f() { out.graphics.sz = [20,20]; scs.objs[1-1] = in1; scs.objs[2-1] = out; - model = scicos_model(); - model.sim = "super"; - model.in1 = 1; - model.out = 1; - model.rpar = scs; - model.blocktype = "h"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("super"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(scs); + this.model.blocktype = new ScilabString("h"); + this.model.dep_ut = [false,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new SuperBlock(this.x); } SUPER_f.prototype.details = function SUPER_f() { diff --git a/js/Misc/SUPER_f.pickle b/js/Misc/SUPER_f.pickle index 637c3eec..869f3e19 100644 --- a/js/Misc/SUPER_f.pickle +++ b/js/Misc/SUPER_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/Misc/TEXT_f.js b/js/Misc/TEXT_f.js index 85cd9cf1..8e36e155 100644 --- a/js/Misc/TEXT_f.js +++ b/js/Misc/TEXT_f.js @@ -3,16 +3,16 @@ function TEXT_f() { TEXT_f.prototype.define = function TEXT_f() { this.font = 2; this.siz = 1; - model = scicos_model(); - model.sim = "text"; - model.rpar = "Text"; - model.ipar = [[this.font],[this.siz]]; + this.model = scicos_model(); + this.model.sim = new ScilabString("text"); + this.model.rpar = new ScilabString("Text"); + this.model.ipar = [[this.font],[this.siz]]; exprs = [["Text"],[string(this.font)],[string(this.siz)]]; graphics = scicos_graphics(); graphics.orig = [0,0]; graphics.sz = [2,1]; graphics.exprs = exprs; - this.x = mlist(["Text","graphics","model","void","gui"],graphics,model," ","TEXT_f"); + this.x = mlist(["Text","graphics","model","void","gui"],graphics,this.model," ","TEXT_f"); return new TextBlock(this.x); } TEXT_f.prototype.details = function TEXT_f() { @@ -34,7 +34,7 @@ function TEXT_f() { graphics = arg1.graphics; orig = graphics.orig; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==1) { exprs = [[exprs],["3"],["1"]]; } @@ -67,9 +67,9 @@ function TEXT_f() { graphics.sz = sz; this.x.graphics = graphics; ipar = [[this.font],[this.siz]]; - model.rpar = this.txt; - model.ipar = ipar; - this.x.model = model; + this.model.rpar = new ScilabDouble(this.txt); + this.model.ipar = ipar; + this.x.model = this.model; break; } } diff --git a/js/Misc/TEXT_f.pickle b/js/Misc/TEXT_f.pickle index 00917182..0f0dda2e 100644 --- a/js/Misc/TEXT_f.pickle +++ b/js/Misc/TEXT_f.pickle @@ -6,12 +6,14 @@ S'font' p2 aS'x' p3 -aS'txt' +aS'model' p4 -aS'siz' +aS'txt' p5 -atp6 -Rp7 +aS'siz' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Misc/c_block.js b/js/Misc/c_block.js index 51dc7208..3c1e294c 100644 --- a/js/Misc/c_block.js +++ b/js/Misc/c_block.js @@ -11,22 +11,22 @@ function c_block() { auto = []; this.rpar = []; this.funam = "toto"; - model = scicos_model(); - model.sim = list(" ",2001); - model.in1 = in1; - model.out = out; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list(" ",2001); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(0); + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; label = list([[sci2exp(in1)],[sci2exp(out)],[strcat(sci2exp(this.rpar))],[this.funam]],list([])); gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } c_block.prototype.details = function c_block() { @@ -48,7 +48,7 @@ function c_block() { this.funam = arguments[0]["funam"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -66,19 +66,19 @@ function c_block() { this.o = int(this.o.slice()); no = size(this.o,1); tt = label[2-1]; - if (model.sim[1-1]!=this.funam||size(model.in1,"*")!=size(this.i,"*")||size(model.out,"*")!=size(this.o,"*")) { + if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { tt = []; } [ok,tt] = CFORTR(this.funam,tt,this.i,this.o); if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]); if (ok) { - model.sim[1-1] = this.funam; - model.rpar = this.rpar; + this.model.sim[('1', 'double')] = new ScilabString(this.funam); + this.model.rpar = this.rpar; label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; diff --git a/js/Misc/c_block.pickle b/js/Misc/c_block.pickle index 8c4e56b0..e00e2815 100644 --- a/js/Misc/c_block.pickle +++ b/js/Misc/c_block.pickle @@ -4,18 +4,20 @@ p0 ((lp1 S'i' p2 -aS'lab' +aS'o' p3 aS'rpar' p4 -aS'o' +aS'lab' p5 aS'funam' p6 aS'x' p7 -atp8 -Rp9 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'label[1-1]' p1 @@ -115,18 +117,18 @@ g9 sS'typ' p36 g13 -sS'[model,graphics,ok]' +sS"model.sim[('1', 'double')]" p37 +NsS'[model,graphics,ok]' +p38 g9 sS'model.blocktype' -p38 +p39 g13 sS'i' -p39 -g9 -sS'model.sim[1-1]' p40 -NsS'no' +g9 +sS'no' p41 g9 sS'o' diff --git a/js/Misc/fortran_block.js b/js/Misc/fortran_block.js index 39673360..e1653c52 100644 --- a/js/Misc/fortran_block.js +++ b/js/Misc/fortran_block.js @@ -1,23 +1,23 @@ /* autogenerated from "macros/Misc/fortran_block.sci" */ function fortran_block() { fortran_block.prototype.define = function fortran_block() { - model = scicos_model(); - model.sim = list(" ",1001); - model.in1 = 1; - model.out = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = 0; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list(" ",1001); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = new ScilabDouble(0); + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; this.funam = "forty"; - label = list([[sci2exp(model.in1)],[sci2exp(model.out)],[strcat(sci2exp(model.rpar))],[this.funam]],list([])); + label = list([[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[strcat(sci2exp(this.model.rpar))],[this.funam]],list([])); gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } fortran_block.prototype.details = function fortran_block() { @@ -39,7 +39,7 @@ function fortran_block() { this.funam = arguments[0]["funam"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -57,19 +57,19 @@ function fortran_block() { this.o = int(this.o.slice()); no = size(this.o,1); tt = label[2-1]; - if (model.sim[1-1]!=this.funam||size(model.in1,"*")!=size(this.i,"*")||size(model.out,"*")!=size(this.o,"*")) { + if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { tt = []; } [ok,tt] = FORTR(this.funam,tt,this.i,this.o); if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]); if (ok) { - model.sim[1-1] = this.funam; - model.rpar = this.rpar; + this.model.sim[('1', 'double')] = new ScilabString(this.funam); + this.model.rpar = this.rpar; label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; diff --git a/js/Misc/fortran_block.pickle b/js/Misc/fortran_block.pickle index 7d55f9e0..a1ae09c9 100644 --- a/js/Misc/fortran_block.pickle +++ b/js/Misc/fortran_block.pickle @@ -4,18 +4,20 @@ p0 ((lp1 S'i' p2 -aS'lab' +aS'o' p3 aS'rpar' p4 -aS'o' +aS'lab' p5 aS'funam' p6 aS'x' p7 -atp8 -Rp9 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'label[1-1]' p1 @@ -94,18 +96,18 @@ g13 sS'typ' p29 g3 -sS'[model,graphics,ok]' +sS"model.sim[('1', 'double')]" p30 +NsS'[model,graphics,ok]' +p31 g13 sS'model.blocktype' -p31 +p32 g9 sS'i' -p32 -g13 -sS'model.sim[1-1]' p33 -NsS'no' +g13 +sS'no' p34 g13 sS'o' diff --git a/js/Misc/func_block.js b/js/Misc/func_block.js index e275af9e..9beb288c 100644 --- a/js/Misc/func_block.js +++ b/js/Misc/func_block.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Misc/func_block.sci" */ function func_block() { func_block.prototype.define = function func_block() { - model = scicos_model(); - model.sim = " "; - model.in1 = 1; - model.out = 1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString(" "); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = "v=sin(u);y=u*v"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } func_block.prototype.details = function func_block() { @@ -21,16 +21,16 @@ function func_block() { return options; } func_block.prototype.set = function func_block() { - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; this.x = arg1; - model = this.x.model; + this.model = this.x.model; [ok,mac,exprs] = this.genfunc[exprs-1]; if (ok) { - model.sim = mac; + this.model.sim = new ScilabDouble(mac); graphics.exprs = exprs; - this.x.model = model; + this.x.model = this.model; this.x.graphics = graphics; } return new BasicBlock(this.x); diff --git a/js/Misc/func_block.pickle b/js/Misc/func_block.pickle index 1e2bda67..a9ca4a5b 100644 --- a/js/Misc/func_block.pickle +++ b/js/Misc/func_block.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'genfunc' +aS'model' p3 -atp4 -Rp5 +aS'genfunc' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Misc/generic_block.js b/js/Misc/generic_block.js index 5325cc7e..a7cf464a 100644 --- a/js/Misc/generic_block.js +++ b/js/Misc/generic_block.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Misc/generic_block.sci" */ function generic_block() { generic_block.prototype.define = function generic_block() { - model = scicos_model(); + this.model = scicos_model(); this.function_name = "sinblk"; this.funtyp = 1; - model.sim = list(this.function_name,this.funtyp); - model.in1 = 1; - model.out = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.firing)],["y"],["n"]]; + this.model.sim = list(this.function_name,this.funtyp); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; + label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.firing)],["y"],["n"]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } generic_block.prototype.details = function generic_block() { @@ -58,7 +58,7 @@ function generic_block() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -104,20 +104,20 @@ function generic_block() { } dep_ut = [this.depu,this.dept]; if (ok) { - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); } if (ok) { if (this.funtyp==3) { needcompile = 4; } - model.sim = list(this.function_name,this.funtyp); - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.firing = this.auto0; - model.dep_ut = dep_ut; - arg1.model = model; + this.model.sim = list(this.function_name,this.funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.dep_ut = dep_ut; + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/Misc/generic_block.pickle b/js/Misc/generic_block.pickle index 062e236f..a9ee5efa 100644 --- a/js/Misc/generic_block.pickle +++ b/js/Misc/generic_block.pickle @@ -28,12 +28,14 @@ aS'ipar' p13 aS'x' p14 -aS'z' +aS'model' p15 -aS'function_name' +aS'z' p16 -atp17 -Rp18 +aS'function_name' +p17 +atp18 +Rp19 .(dp0 S'ci' p1 diff --git a/js/Misc/generic_block2.js b/js/Misc/generic_block2.js index bdd9308a..238255e7 100644 --- a/js/Misc/generic_block2.js +++ b/js/Misc/generic_block2.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Misc/generic_block2.sci" */ function generic_block2() { generic_block2.prototype.define = function generic_block2() { - model = scicos_model(); + this.model = scicos_model(); this.function_name = "sinblk"; this.funtyp = 1; - model.sim = list(this.function_name,this.funtyp); - model.in1 = 1; - model.out = 1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.rpar = []; - model.ipar = []; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]]; + this.model.sim = list(this.function_name,this.funtyp); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.rpar = []; + this.model.ipar = []; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; + label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; gr_i = []; - this.x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } generic_block2.prototype.details = function generic_block2() { @@ -62,7 +62,7 @@ function generic_block2() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -108,22 +108,22 @@ function generic_block2() { } dep_ut = [this.depu,this.dept]; if (ok) { - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); } if (ok) { if (this.funtyp==3) { needcompile = 4; } - model.sim = list(this.function_name,this.funtyp); - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.firing = this.auto0; - model.nzcross = this.nzcr; - model.nmode = this.nmode; - model.dep_ut = dep_ut; - arg1.model = model; + this.model.sim = list(this.function_name,this.funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.nzcross = new ScilabDouble(this.nzcr); + this.model.nmode = new ScilabDouble(this.nmode); + this.model.dep_ut = dep_ut; + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/Misc/generic_block2.pickle b/js/Misc/generic_block2.pickle index bbb617c2..385adc45 100644 --- a/js/Misc/generic_block2.pickle +++ b/js/Misc/generic_block2.pickle @@ -30,14 +30,16 @@ aS'ipar' p14 aS'x' p15 -aS'z' +aS'model' p16 -aS'nmode' +aS'z' p17 -aS'function_name' +aS'nmode' p18 -atp19 -Rp20 +aS'function_name' +p19 +atp20 +Rp21 .(dp0 S'ci' p1 diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js index 137032a3..d2f1d8c3 100644 --- a/js/Misc/generic_block3.js +++ b/js/Misc/generic_block3.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Misc/generic_block3.sci" */ function generic_block3() { generic_block3.prototype.define = function generic_block3() { - model = scicos_model(); + this.model = scicos_model(); this.function_name = "sinblk"; this.funtyp = 4; - model.sim = list(this.function_name,this.funtyp); - model.in1 = 1; - model.in2 = 1; - model.intyp = 1; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2]),sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]]; + this.model.sim = list(this.function_name,this.funtyp); + this.model.in1 = new ScilabDouble(1); + this.model.in2 = new ScilabDouble(1); + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.dep_ut = [true,false]; + label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2]),sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; gr_i = []; - this.x = standard_define([4,2],model,label,gr_i); + this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } generic_block3.prototype.details = function generic_block3() { @@ -66,7 +66,7 @@ function generic_block3() { this.dept = parseBoolean(arguments[0]["dept"]) this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { @@ -118,24 +118,24 @@ function generic_block3() { } dep_ut = [this.depu,this.dept]; if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); + [model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); } if (ok) { if (this.funtyp==3) { needcompile = 4; } - model.sim = list(this.function_name,this.funtyp); - model.state = this.xx; - model.dstate = this.z; - model.odstate = this.oz; - model.rpar = this.rpar; - model.ipar = this.ipar; - model.opar = this.opar; - model.firing = this.auto0; - model.nzcross = this.nzcr; - model.nmode = this.nmode; - model.dep_ut = dep_ut; - arg1.model = model; + this.model.sim = list(this.function_name,this.funtyp); + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.odstate = new ScilabDouble(this.oz); + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(this.ipar); + this.model.opar = new ScilabDouble(this.opar); + this.model.firing = new ScilabDouble(this.auto0); + this.model.nzcross = new ScilabDouble(this.nzcr); + this.model.nmode = new ScilabDouble(this.nmode); + this.model.dep_ut = dep_ut; + arg1.model = this.model; graphics.exprs = label; arg1.graphics = graphics; this.x = arg1; diff --git a/js/Misc/generic_block3.pickle b/js/Misc/generic_block3.pickle index cbb0d2a5..0019316c 100644 --- a/js/Misc/generic_block3.pickle +++ b/js/Misc/generic_block3.pickle @@ -44,10 +44,12 @@ aS'ipar' p21 aS'x' p22 -aS'ot' +aS'model' p23 -atp24 -Rp25 +aS'ot' +p24 +atp25 +Rp26 .(dp0 S'model.odstate' p1 diff --git a/js/Misc/scifunc_block.js b/js/Misc/scifunc_block.js index 4e016a08..a68de77f 100644 --- a/js/Misc/scifunc_block.js +++ b/js/Misc/scifunc_block.js @@ -10,23 +10,23 @@ function scifunc_block() { typ = "c"; auto = []; this.rpar = []; - model = scicos_model(); - model.sim = list("scifunc",3); - model.in1 = in1; - model.out = out; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.opar = list(); - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("scifunc",3); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(0); + this.model.opar = list(); + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; exprs = list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } scifunc_block.prototype.details = function scifunc_block() { @@ -59,7 +59,7 @@ function scifunc_block() { this.lab = arguments[0]["lab"] needcompile = 0; this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; if (size(exprs[1-1],"*")==8) { @@ -88,23 +88,23 @@ function scifunc_block() { if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,this.ci,this.co); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); if (ok) { auto = this.auto0; - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - if (model.ipar!=0) { - model.opar = model.ipar; - model.ipar = 0; + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + if (this.model.ipar!=0) { + this.model.opar = new ScilabDouble(this.model.ipar); + this.model.ipar = new ScilabDouble(0); } - if (or(model.opar!=tt)) { + if (or(this.model.opar!=tt)) { needcompile = 4; } - model.opar = tt; - model.firing = auto; - model.dep_ut = dep_ut; - this.x.model = model; + this.model.opar = new ScilabDouble(tt); + this.model.firing = new ScilabDouble(auto); + this.model.dep_ut = new ScilabDouble(dep_ut); + this.x.model = this.model; exprs[2-1] = tt; graphics.exprs = exprs; this.x.graphics = graphics; diff --git a/js/Misc/scifunc_block.pickle b/js/Misc/scifunc_block.pickle index fc2d3cfd..e4976df1 100644 --- a/js/Misc/scifunc_block.pickle +++ b/js/Misc/scifunc_block.pickle @@ -22,10 +22,12 @@ aS'lab' p10 aS'x' p11 -aS'z' +aS'model' p12 -atp13 -Rp14 +aS'z' +p13 +atp14 +Rp15 .(dp0 S'exprs[1-1]' p1 diff --git a/js/Misc/scifunc_block_m.js b/js/Misc/scifunc_block_m.js index f53b1d5d..869b6256 100644 --- a/js/Misc/scifunc_block_m.js +++ b/js/Misc/scifunc_block_m.js @@ -11,27 +11,27 @@ function scifunc_block_m() { auto = []; this.rpar = []; it = 1; - model = scicos_model(); - model.sim = list("scifunc",3); - model.in1 = in1; - model.in2 = in1; - model.intyp = it; - model.out = out; - model.out2 = out; - model.outtyp = it; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.opar = list(); - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("scifunc",3); + this.model.in1 = new ScilabDouble(in1); + this.model.in2 = new ScilabDouble(in1); + this.model.intyp = new ScilabDouble(it); + this.model.out = new ScilabDouble(out); + this.model.out2 = new ScilabDouble(out); + this.model.outtyp = new ScilabDouble(it); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(0); + this.model.opar = list(); + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; exprs = list([[sci2exp([in1,in1])],[sci2exp([out,out])],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)],[sci2exp(0)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } scifunc_block_m.prototype.details = function scifunc_block_m() { @@ -64,7 +64,7 @@ function scifunc_block_m() { this.lab = arguments[0]["lab"] needcompile = 0; this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; while (true) { @@ -90,23 +90,23 @@ function scifunc_block_m() { if (!ok) { break; } - [model,graphics,ok] = set_io(model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co); + [model,graphics,ok] = set_io(this.model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co); if (ok) { auto = this.auto0; - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - if (model.ipar!=0) { - model.opar = model.ipar; - model.ipar = 0; + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + if (this.model.ipar!=0) { + this.model.opar = new ScilabDouble(this.model.ipar); + this.model.ipar = new ScilabDouble(0); } - if (or(model.opar!=tt)) { + if (or(this.model.opar!=tt)) { needcompile = 4; } - model.opar = tt; - model.firing = auto; - model.dep_ut = dep_ut; - this.x.model = model; + this.model.opar = new ScilabDouble(tt); + this.model.firing = new ScilabDouble(auto); + this.model.dep_ut = new ScilabDouble(dep_ut); + this.x.model = this.model; exprs[2-1] = tt; graphics.exprs = exprs; this.x.graphics = graphics; diff --git a/js/Misc/scifunc_block_m.pickle b/js/Misc/scifunc_block_m.pickle index e1528369..f9726e27 100644 --- a/js/Misc/scifunc_block_m.pickle +++ b/js/Misc/scifunc_block_m.pickle @@ -22,10 +22,12 @@ aS'lab' p10 aS'x' p11 -aS'z' +aS'model' p12 -atp13 -Rp14 +aS'z' +p13 +atp14 +Rp15 .(dp0 S'exprs[1-1]' p1 diff --git a/js/NonLinear/ABSBLK_f.js b/js/NonLinear/ABSBLK_f.js index 058d4895..3d5ab9ed 100644 --- a/js/NonLinear/ABSBLK_f.js +++ b/js/NonLinear/ABSBLK_f.js @@ -1,14 +1,14 @@ /* autogenerated from "macros/NonLinear/ABSBLK_f.sci" */ function ABSBLK_f() { ABSBLK_f.prototype.define = function ABSBLK_f() { - model = scicos_model(); - model.sim = list("absblk",1); - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("absblk",1); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } ABSBLK_f.prototype.details = function ABSBLK_f() { diff --git a/js/NonLinear/ABSBLK_f.pickle b/js/NonLinear/ABSBLK_f.pickle index 857864e5..0f2abe38 100644 --- a/js/NonLinear/ABSBLK_f.pickle +++ b/js/NonLinear/ABSBLK_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/ABS_VALUE.js b/js/NonLinear/ABS_VALUE.js index 1d2e63c2..fa386164 100644 --- a/js/NonLinear/ABS_VALUE.js +++ b/js/NonLinear/ABS_VALUE.js @@ -2,17 +2,17 @@ function ABS_VALUE() { ABS_VALUE.prototype.define = function ABS_VALUE() { nu = -1; - model = scicos_model(); - model.sim = list("absolute_value",4); - model.in1 = nu; - model.out = nu; - model.nzcross = nu; - model.nmode = nu; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("absolute_value",4); + this.model.in1 = new ScilabDouble(nu); + this.model.out = new ScilabDouble(nu); + this.model.nzcross = new ScilabDouble(nu); + this.model.nmode = new ScilabDouble(nu); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string([1])]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ABS_VALUE.prototype.details = function ABS_VALUE() { @@ -29,7 +29,7 @@ function ABS_VALUE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); if (!ok) { @@ -38,14 +38,14 @@ function ABS_VALUE() { graphics.exprs = exprs; if (ok) { if (this.zcr!=0) { - model.nmode = -1; - model.nzcross = -1; + this.model.nmode = new ScilabDouble(-1); + this.model.nzcross = new ScilabDouble(-1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/ABS_VALUE.pickle b/js/NonLinear/ABS_VALUE.pickle index 835aded5..083f7a74 100644 --- a/js/NonLinear/ABS_VALUE.pickle +++ b/js/NonLinear/ABS_VALUE.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'zcr' +aS'model' p3 -atp4 -Rp5 +aS'zcr' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/COSBLK_f.js b/js/NonLinear/COSBLK_f.js index 0b510327..0ef60f6e 100644 --- a/js/NonLinear/COSBLK_f.js +++ b/js/NonLinear/COSBLK_f.js @@ -2,14 +2,14 @@ function COSBLK_f() { COSBLK_f.prototype.define = function COSBLK_f() { in1 = 1; - model = scicos_model(); - model.sim = "cosblk"; - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("cosblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } COSBLK_f.prototype.details = function COSBLK_f() { diff --git a/js/NonLinear/COSBLK_f.pickle b/js/NonLinear/COSBLK_f.pickle index 4250eb27..84c2e7e0 100644 --- a/js/NonLinear/COSBLK_f.pickle +++ b/js/NonLinear/COSBLK_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/DLRADAPT_f.js b/js/NonLinear/DLRADAPT_f.js index c04d1814..6a39a40b 100644 --- a/js/NonLinear/DLRADAPT_f.js +++ b/js/NonLinear/DLRADAPT_f.js @@ -7,20 +7,20 @@ function DLRADAPT_f() { this.g = [[1],[1]]; this.last_u = []; this.last_y = [[0],[0]]; - model = scicos_model(); - model.sim = "dlradp"; - model.in1 = [[1],[1]]; - model.out = 1; - model.evtin = 1; - model.dstate = [[this.last_u],[this.last_y]]; - model.rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; - model.ipar = [[0],[2],[2]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("dlradp"); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[this.last_u],[this.last_y]]; + this.model.rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; + this.model.ipar = [[0],[2],[2]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.p)],[sci2exp(this.rn)],[sci2exp(this.rd,0)],[sci2exp(this.g)],[sci2exp(this.last_u)],[sci2exp(this.last_y)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DLRADAPT_f.prototype.details = function DLRADAPT_f() { @@ -47,7 +47,7 @@ function DLRADAPT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.p,this.rn,this.rd,this.g,this.last_u,this.last_y,exprs] = scicos_getvalue("Set block parameters",["Vector of p mesh points","Numerator roots (one line for each mesh)","Denominator roots (one line for each mesh)","Vector of gain at mesh points","past inputs (Num degree values)","past outputs (Den degree values)"],list("vec",-1,"mat",[-1,-1],"mat",["size(%1,\'*\')","-1"],"vec","size(%1,\'*\')","vec","size(%2,2)","vec","size(%3,2)"),exprs); if (!ok) { @@ -62,12 +62,12 @@ function DLRADAPT_f() { } else { rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; ipar = [[m],[n],[npt]]; - model.dstate = [[this.last_u.slice()],[this.last_y.slice()]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.dstate = [[this.last_u.slice()],[this.last_y.slice()]]; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/DLRADAPT_f.pickle b/js/NonLinear/DLRADAPT_f.pickle index 71032709..42c4b32e 100644 --- a/js/NonLinear/DLRADAPT_f.pickle +++ b/js/NonLinear/DLRADAPT_f.pickle @@ -14,10 +14,12 @@ aS'p' p6 aS'x' p7 -aS'rn' +aS'model' p8 -atp9 -Rp10 +aS'rn' +p9 +atp10 +Rp11 .(dp0 S'model.dstate' p1 diff --git a/js/NonLinear/EXPBLK_f.js b/js/NonLinear/EXPBLK_f.js index 5d5c28f6..2aa0a2c4 100644 --- a/js/NonLinear/EXPBLK_f.js +++ b/js/NonLinear/EXPBLK_f.js @@ -3,16 +3,16 @@ function EXPBLK_f() { EXPBLK_f.prototype.define = function EXPBLK_f() { in1 = 1; this.a = math.E; - model = scicos_model(); - model.sim = "expblk"; - model.in1 = -1; - model.out = -1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("expblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = ["%e"]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXPBLK_f.prototype.details = function EXPBLK_f() { @@ -28,7 +28,7 @@ function EXPBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -41,9 +41,9 @@ function EXPBLK_f() { message("a^u : a must be positive"); } else { graphics.exprs = exprs; - model.rpar = this.a; + this.model.rpar = new ScilabDouble(this.a); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/EXPBLK_f.pickle b/js/NonLinear/EXPBLK_f.pickle index adee4513..d1f963e2 100644 --- a/js/NonLinear/EXPBLK_f.pickle +++ b/js/NonLinear/EXPBLK_f.pickle @@ -6,8 +6,10 @@ S'a' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'a' p1 diff --git a/js/NonLinear/EXPBLK_m.js b/js/NonLinear/EXPBLK_m.js index 784a2f1b..cb002f76 100644 --- a/js/NonLinear/EXPBLK_m.js +++ b/js/NonLinear/EXPBLK_m.js @@ -3,20 +3,20 @@ function EXPBLK_m() { EXPBLK_m.prototype.define = function EXPBLK_m() { in1 = 1; this.a = math.E; - model = scicos_model(); - model.sim = list("expblk_m",4); - model.in1 = -1; - model.in2 = -2; - model.out = -1; - model.out2 = -2; - model.intyp = 1; - model.outtyp = 1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("expblk_m",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = ["%e"]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } EXPBLK_m.prototype.details = function EXPBLK_m() { @@ -32,7 +32,7 @@ function EXPBLK_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -45,9 +45,9 @@ function EXPBLK_m() { message("a^u : a must be positive"); } else { graphics.exprs = exprs; - model.rpar = this.a; + this.model.rpar = new ScilabDouble(this.a); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/EXPBLK_m.pickle b/js/NonLinear/EXPBLK_m.pickle index 12c33242..e3a3b116 100644 --- a/js/NonLinear/EXPBLK_m.pickle +++ b/js/NonLinear/EXPBLK_m.pickle @@ -6,8 +6,10 @@ S'a' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/NonLinear/FSV_f.js b/js/NonLinear/FSV_f.js index d29bcb9e..957153ed 100644 --- a/js/NonLinear/FSV_f.js +++ b/js/NonLinear/FSV_f.js @@ -2,15 +2,15 @@ function FSV_f() { FSV_f.prototype.define = function FSV_f() { in1 = 1; - model = scicos_model(); - model.sim = list("fsv",1); - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("fsv",1); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } FSV_f.prototype.details = function FSV_f() { diff --git a/js/NonLinear/FSV_f.pickle b/js/NonLinear/FSV_f.pickle index 595df316..e4655d80 100644 --- a/js/NonLinear/FSV_f.pickle +++ b/js/NonLinear/FSV_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/INTRP2BLK_f.js b/js/NonLinear/INTRP2BLK_f.js index 16d28b77..9c16b0e5 100644 --- a/js/NonLinear/INTRP2BLK_f.js +++ b/js/NonLinear/INTRP2BLK_f.js @@ -4,17 +4,17 @@ function INTRP2BLK_f() { this.a = [[0],[1]]; this.b = [[0],[1]]; this.c = [[0,1],[1,2]]; - model = scicos_model(); - model.sim = list("intrp2",1); - model.in1 = [[1],[1]]; - model.out = 1; - model.rpar = [[this.a],[this.b],[this.c.slice()]]; - model.ipar = [[2],[2]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("intrp2",1); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.a],[this.b],[this.c.slice()]]; + this.model.ipar = [[2],[2]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.a))],[strcat(sci2exp(this.b))],[strcat(sci2exp(this.c,0))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTRP2BLK_f.prototype.details = function INTRP2BLK_f() { @@ -35,7 +35,7 @@ function INTRP2BLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.a,this.b,this.c,exprs] = scicos_getvalue("Set Interpolation block parameters",["X coord.","Y coord.","Z values"],list("vec",-1,"vec",-1,"mat",[-1,-1]),exprs); if (!ok) { @@ -48,10 +48,10 @@ function INTRP2BLK_f() { } else { if (ok) { graphics.exprs = exprs; - model.rpar = [[this.a.slice()],[this.b.slice()],[this.c.slice()]]; - model.ipar = [[size(this.a,"*")],[size(this.b,"*")]]; + this.model.rpar = [[this.a.slice()],[this.b.slice()],[this.c.slice()]]; + this.model.ipar = [[size(this.a,"*")],[size(this.b,"*")]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/INTRP2BLK_f.pickle b/js/NonLinear/INTRP2BLK_f.pickle index aedc2222..ee63e135 100644 --- a/js/NonLinear/INTRP2BLK_f.pickle +++ b/js/NonLinear/INTRP2BLK_f.pickle @@ -6,12 +6,14 @@ S'a' p2 aS'x' p3 -aS'c' +aS'model' p4 aS'b' p5 -atp6 -Rp7 +aS'c' +p6 +atp7 +Rp8 .(dp0 S'a' p1 diff --git a/js/NonLinear/INTRPLBLK_f.js b/js/NonLinear/INTRPLBLK_f.js index 60b67324..935ed84f 100644 --- a/js/NonLinear/INTRPLBLK_f.js +++ b/js/NonLinear/INTRPLBLK_f.js @@ -3,16 +3,16 @@ function INTRPLBLK_f() { INTRPLBLK_f.prototype.define = function INTRPLBLK_f() { this.a = [[0],[1]]; this.b = [[0],[1]]; - model = scicos_model(); - model.sim = "intrpl"; - model.in1 = 1; - model.out = 1; - model.rpar = [[this.a],[this.b]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("intrpl"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.a],[this.b]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.a))],[strcat(sci2exp(this.b))]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INTRPLBLK_f.prototype.details = function INTRPLBLK_f() { @@ -31,7 +31,7 @@ function INTRPLBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.a,this.b,exprs] = scicos_getvalue("Set Interpolation block parameters",["X coord.","Y coord."],list("vec",-1,"vec",-1),exprs); if (!ok) { @@ -44,9 +44,9 @@ function INTRPLBLK_f() { } else { if (ok) { graphics.exprs = exprs; - model.rpar = [[this.a.slice()],[this.b.slice()]]; + this.model.rpar = [[this.a.slice()],[this.b.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/INTRPLBLK_f.pickle b/js/NonLinear/INTRPLBLK_f.pickle index 81a74125..89166c16 100644 --- a/js/NonLinear/INTRPLBLK_f.pickle +++ b/js/NonLinear/INTRPLBLK_f.pickle @@ -6,10 +6,12 @@ S'a' p2 aS'x' p3 -aS'b' +aS'model' p4 -atp5 -Rp6 +aS'b' +p5 +atp6 +Rp7 .(dp0 S'a' p1 diff --git a/js/NonLinear/INVBLK.js b/js/NonLinear/INVBLK.js index 5d8b700c..b212b08b 100644 --- a/js/NonLinear/INVBLK.js +++ b/js/NonLinear/INVBLK.js @@ -2,15 +2,15 @@ function INVBLK() { INVBLK.prototype.define = function INVBLK() { in1 = -1; - model = scicos_model(); - model.sim = list("invblk4",4); - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("invblk4",4); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INVBLK.prototype.details = function INVBLK() { diff --git a/js/NonLinear/INVBLK.pickle b/js/NonLinear/INVBLK.pickle index 595df316..e4655d80 100644 --- a/js/NonLinear/INVBLK.pickle +++ b/js/NonLinear/INVBLK.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/INVBLK_f.js b/js/NonLinear/INVBLK_f.js index 9cde7bbb..513f88b2 100644 --- a/js/NonLinear/INVBLK_f.js +++ b/js/NonLinear/INVBLK_f.js @@ -2,15 +2,15 @@ function INVBLK_f() { INVBLK_f.prototype.define = function INVBLK_f() { in1 = -1; - model = scicos_model(); - model.sim = "invblk"; - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("invblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } INVBLK_f.prototype.details = function INVBLK_f() { diff --git a/js/NonLinear/INVBLK_f.pickle b/js/NonLinear/INVBLK_f.pickle index 102457e9..465556a6 100644 --- a/js/NonLinear/INVBLK_f.pickle +++ b/js/NonLinear/INVBLK_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/LOGBLK_f.js b/js/NonLinear/LOGBLK_f.js index 0af1aac0..c29da31c 100644 --- a/js/NonLinear/LOGBLK_f.js +++ b/js/NonLinear/LOGBLK_f.js @@ -3,16 +3,16 @@ function LOGBLK_f() { LOGBLK_f.prototype.define = function LOGBLK_f() { in1 = 1; this.a = math.E; - model = scicos_model(); - model.sim = "logblk"; - model.in1 = -1; - model.out = -1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("logblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = "%e"; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOGBLK_f.prototype.details = function LOGBLK_f() { @@ -28,7 +28,7 @@ function LOGBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -42,9 +42,9 @@ function LOGBLK_f() { } else { if (ok) { graphics.exprs = exprs; - model.rpar = this.a; + this.model.rpar = new ScilabDouble(this.a); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/LOGBLK_f.pickle b/js/NonLinear/LOGBLK_f.pickle index ab05e8c5..f54919a2 100644 --- a/js/NonLinear/LOGBLK_f.pickle +++ b/js/NonLinear/LOGBLK_f.pickle @@ -6,8 +6,10 @@ S'a' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'a' p1 diff --git a/js/NonLinear/LOOKUP2D.js b/js/NonLinear/LOOKUP2D.js index 06d5819a..bc8e4d59 100644 --- a/js/NonLinear/LOOKUP2D.js +++ b/js/NonLinear/LOOKUP2D.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/NonLinear/LOOKUP2D.sci" */ function LOOKUP2D() { LOOKUP2D.prototype.define = function LOOKUP2D() { - model = scicos_model(); + this.model = scicos_model(); this.xx = [1:4]; this.yy = [1:3]; this.zz = [[4,5,6],[16,19,20],[10,18,23],[6,3,-1]]; @@ -9,16 +9,16 @@ function LOOKUP2D() { Graf = "n"; Nx = length(this.xx); Ny = length(this.yy); - model.sim = list("lookup2d",4); - model.in1 = [[1],[1]]; - model.out = 1; - model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; - model.ipar = [[Nx],[Ny],[this.Method]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = list("lookup2d",4); + this.model.in1 = [[1],[1]]; + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; + this.model.ipar = [[Nx],[Ny],[this.Method]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = list(strcat(sci2exp(this.xx)),strcat(sci2exp(this.yy)),strcat(sci2exp(this.zz)),sci2exp(this.Method),Graf); gr_i = []; - this.x = standard_define([2.5,2],model,exprs,gr_i); + this.x = standard_define([2.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } LOOKUP2D.prototype.details = function LOOKUP2D() { @@ -41,7 +41,7 @@ function LOOKUP2D() { this.Method = parseFloat(arguments[0]["Method"]) this.graf = arguments[0]["graf"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; ok = false; @@ -101,10 +101,10 @@ function LOOKUP2D() { curwin = save_curwin; gh.figure_id = curwin; } - model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; - model.ipar = [[nx],[ny],[mtd]]; + this.model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; + this.model.ipar = [[nx],[ny],[mtd]]; graphics.exprs = exprs; - this.x.model = model; + this.x.model = this.model; this.x.graphics = graphics; break; } diff --git a/js/NonLinear/LOOKUP2D.pickle b/js/NonLinear/LOOKUP2D.pickle index 50350631..a5f3175b 100644 --- a/js/NonLinear/LOOKUP2D.pickle +++ b/js/NonLinear/LOOKUP2D.pickle @@ -12,12 +12,14 @@ aS'zz' p5 aS'x' p6 -aS'Method' +aS'model' p7 -aS'graf' +aS'Method' p8 -atp9 -Rp10 +aS'graf' +p9 +atp10 +Rp11 .(dp0 S'[ny,my]' p1 diff --git a/js/NonLinear/LOOKUP_c.pickle b/js/NonLinear/LOOKUP_c.pickle index 5b625185..f90d540c 100644 --- a/js/NonLinear/LOOKUP_c.pickle +++ b/js/NonLinear/LOOKUP_c.pickle @@ -4,30 +4,32 @@ p0 ((lp1 S'rparin' p2 -aS'extrapo' +aS'curwin' p3 -aS'yy' +aS'extrapo' p4 -aS'xx' +aS'yy' p5 -aS'ixy' +aS'xx' p6 -aS'iparin' +aS'ixy' p7 -aS'argn' +aS'iparin' p8 -aS'xy' +aS'argn' p9 -aS'x' +aS'xy' p10 -aS'curwin' +aS'x' p11 -aS'Method' +aS'model' p12 -aS'graf' +aS'Method' p13 -atp14 -Rp15 +aS'graf' +p14 +atp15 +Rp16 .(dp0 S'mean4' p1 diff --git a/js/NonLinear/LOOKUP_f.js b/js/NonLinear/LOOKUP_f.js index 287cd87d..7ba988cc 100644 --- a/js/NonLinear/LOOKUP_f.js +++ b/js/NonLinear/LOOKUP_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/NonLinear/LOOKUP_f.sci" */ function LOOKUP_f() { LOOKUP_f.prototype.define = function LOOKUP_f() { - model = scicos_model(); - model.sim = "lookup"; - model.in1 = 1; - model.out = 1; - model.rpar = [[-2],[-1],[1],[2],[-1],[1],[-1],[1]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("lookup"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[-2],[-1],[1],[2],[-1],[1],[-1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } LOOKUP_f.prototype.details = function LOOKUP_f() { @@ -24,8 +24,8 @@ function LOOKUP_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - rpar = model.rpar; + this.model = arg1.model; + rpar = this.model.rpar; n = size(rpar,"*")/2; xx = rpar.slice(1-1,n); yy = rpar.slice(n+1-1,2*n); @@ -45,9 +45,9 @@ function LOOKUP_f() { ok = false; } if (ok) { - model.rpar = [[xx.slice()],[yy.slice()]]; + this.model.rpar = [[xx.slice()],[yy.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/LOOKUP_f.pickle b/js/NonLinear/LOOKUP_f.pickle index 602b724e..51951b20 100644 --- a/js/NonLinear/LOOKUP_f.pickle +++ b/js/NonLinear/LOOKUP_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/NonLinear/MAXMIN.js b/js/NonLinear/MAXMIN.js index 5c55ad5c..1b4004c0 100644 --- a/js/NonLinear/MAXMIN.js +++ b/js/NonLinear/MAXMIN.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/NonLinear/MAXMIN.sci" */ function MAXMIN() { MAXMIN.prototype.define = function MAXMIN() { - model = scicos_model(); - model.sim = list("minmax",4); - model.out = 1; - model.in1 = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - model.ipar = 0; + this.model = scicos_model(); + this.model.sim = list("minmax",4); + this.model.out = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.model.ipar = new ScilabDouble(0); exprs = [string(transpose([2,1,1]))]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.style = "MAXMIN;displayedLabel=MAX"; return new BasicBlock(this.x); } @@ -32,7 +32,7 @@ function MAXMIN() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.mm,this.nin,this.zcr,exprs] = scicos_getvalue("Set Max/Min block parameters",["Min (1) or Max (2) ","Number of input vectors (1 or 2)","zero-crossing (1: yes, 0;no)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -50,19 +50,19 @@ function MAXMIN() { } if (ok) { if (this.nin==1) { - [model,graphics,ok] = check_io(model,graphics,-1,1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,-1,1,[],[]); } else { - [model,graphics,ok] = check_io(model,graphics,[-1,-1],-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[-1,-1],-1,[],[]); } } if (ok) { - model.nzcross = this.zcr; + this.model.nzcross = new ScilabDouble(this.zcr); if (this.nin==1) { - model.nmode = abs(this.zcr); + this.model.nmode = new ScilabDouble(abs(this.zcr)); } else { - model.nmode = this.zcr; + this.model.nmode = new ScilabDouble(this.zcr); } - model.ipar = this.mm; + this.model.ipar = new ScilabDouble(this.mm); if (this.mm==1) { label = "MIN"; } else { @@ -71,7 +71,7 @@ function MAXMIN() { graphics.style = "MAXMIN;displayedLabel="+label; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/MAXMIN.pickle b/js/NonLinear/MAXMIN.pickle index 7f130392..a653fc5d 100644 --- a/js/NonLinear/MAXMIN.pickle +++ b/js/NonLinear/MAXMIN.pickle @@ -6,12 +6,14 @@ S'mm' p2 aS'x' p3 -aS'nin' +aS'model' p4 -aS'zcr' +aS'nin' p5 -atp6 -Rp7 +aS'zcr' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/NonLinear/MAX_f.js b/js/NonLinear/MAX_f.js index 0f186bb6..d5819afc 100644 --- a/js/NonLinear/MAX_f.js +++ b/js/NonLinear/MAX_f.js @@ -2,16 +2,16 @@ function MAX_f() { MAX_f.prototype.define = function MAX_f() { in1 = -1; - model = scicos_model(); - model.sim = "maxblk"; - model.in1 = in1; - model.out = 1; - model.dstate = [[0],[0]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("maxblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(1); + this.model.dstate = [[0],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MAX_f.prototype.details = function MAX_f() { diff --git a/js/NonLinear/MAX_f.pickle b/js/NonLinear/MAX_f.pickle index 362a6e75..c5fee5b1 100644 --- a/js/NonLinear/MAX_f.pickle +++ b/js/NonLinear/MAX_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/MIN_f.js b/js/NonLinear/MIN_f.js index 82796940..62ee772a 100644 --- a/js/NonLinear/MIN_f.js +++ b/js/NonLinear/MIN_f.js @@ -2,16 +2,16 @@ function MIN_f() { MIN_f.prototype.define = function MIN_f() { in1 = -1; - model = scicos_model(); - model.sim = "minblk"; - model.in1 = in1; - model.out = 1; - model.dstate = [[0],[0]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("minblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(1); + this.model.dstate = [[0],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(in1); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } MIN_f.prototype.details = function MIN_f() { diff --git a/js/NonLinear/MIN_f.pickle b/js/NonLinear/MIN_f.pickle index a8357dc1..56aba182 100644 --- a/js/NonLinear/MIN_f.pickle +++ b/js/NonLinear/MIN_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/POWBLK_f.js b/js/NonLinear/POWBLK_f.js index f2b1c07c..2725027e 100644 --- a/js/NonLinear/POWBLK_f.js +++ b/js/NonLinear/POWBLK_f.js @@ -3,16 +3,16 @@ function POWBLK_f() { POWBLK_f.prototype.define = function POWBLK_f() { in1 = 1; this.a = 1.5; - model = scicos_model(); - model.sim = "powblk"; - model.in1 = -1; - model.out = -1; - model.rpar = this.a; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("powblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.a); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = string(this.a); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } POWBLK_f.prototype.details = function POWBLK_f() { @@ -28,7 +28,7 @@ function POWBLK_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -39,15 +39,15 @@ function POWBLK_f() { } graphics.exprs = exprs; if (this.a==int(this.a)) { - model.ipar = this.a; - model.rpar = []; + this.model.ipar = new ScilabDouble(this.a); + this.model.rpar = []; } else { - model.rpar = this.a; - model.ipar = []; + this.model.rpar = new ScilabDouble(this.a); + this.model.ipar = []; } - model.firing = []; + this.model.firing = []; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/NonLinear/POWBLK_f.pickle b/js/NonLinear/POWBLK_f.pickle index 68f9f010..a9f0ac38 100644 --- a/js/NonLinear/POWBLK_f.pickle +++ b/js/NonLinear/POWBLK_f.pickle @@ -6,8 +6,10 @@ S'a' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'a' p1 diff --git a/js/NonLinear/PRODUCT.js b/js/NonLinear/PRODUCT.js index d7587964..8e3f9a39 100644 --- a/js/NonLinear/PRODUCT.js +++ b/js/NonLinear/PRODUCT.js @@ -2,16 +2,16 @@ function PRODUCT() { PRODUCT.prototype.define = function PRODUCT() { this.sgn = [[1],[-1]]; - model = scicos_model(); - model.sim = list("product",4); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.ipar = this.sgn; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("product",4); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.ipar = this.sgn; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(this.sgn); gr_i = []; - this.x = standard_define([2,3],model,exprs,gr_i); + this.x = standard_define([2,3],this.model,exprs,gr_i); return new Product(this.x); } PRODUCT.prototype.details = function PRODUCT() { @@ -26,7 +26,7 @@ function PRODUCT() { this.sgn = inverse(arguments[0]["sgn"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.sgn,exprs] = scicos_getvalue([[" Set multiplication block parameters"],["(multiplication is set with + 1, division with -1)"],[""]],"Number of inputs or sign vector",list("vec",-1),exprs); @@ -57,13 +57,13 @@ function PRODUCT() { } } if (ok) { - [model,graphics,ok] = check_io(model,graphics,in1,nout,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,nout,[],[]); } if (ok) { - model.ipar = this.sgn; + this.model.ipar = new ScilabDouble(this.sgn); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/PRODUCT.pickle b/js/NonLinear/PRODUCT.pickle index 7b79339b..b4766cb8 100644 --- a/js/NonLinear/PRODUCT.pickle +++ b/js/NonLinear/PRODUCT.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'sgn' +aS'model' p3 -atp4 -Rp5 +aS'sgn' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/NonLinear/PROD_f.js b/js/NonLinear/PROD_f.js index 157d61bc..cf325e3e 100644 --- a/js/NonLinear/PROD_f.js +++ b/js/NonLinear/PROD_f.js @@ -1,13 +1,13 @@ /* autogenerated from "macros/NonLinear/PROD_f.sci" */ function PROD_f() { PROD_f.prototype.define = function PROD_f() { - model = scicos_model(); - model.sim = list("prod",2); - model.in1 = [[-1],[-1]]; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; - this.x = standard_define([1,1],model,[],[]); + this.model = scicos_model(); + this.model.sim = list("prod",2); + this.model.in1 = [[-1],[-1]]; + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + this.x = standard_define([1,1],this.model,[],[]); return new BasicBlock(this.x); } PROD_f.prototype.details = function PROD_f() { diff --git a/js/NonLinear/PROD_f.pickle b/js/NonLinear/PROD_f.pickle index 4bea59b8..d5ae4cb3 100644 --- a/js/NonLinear/PROD_f.pickle +++ b/js/NonLinear/PROD_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/QUANT_f.js b/js/NonLinear/QUANT_f.js index bace34cc..0b55fd58 100644 --- a/js/NonLinear/QUANT_f.js +++ b/js/NonLinear/QUANT_f.js @@ -3,17 +3,17 @@ function QUANT_f() { QUANT_f.prototype.define = function QUANT_f() { this.pas = 0.1; this.meth = 1; - model = scicos_model(); - model.sim = "qzrnd"; - model.in1 = -1; - model.out = -1; - model.rpar = this.pas; - model.ipar = this.meth; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("qzrnd"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.rpar = new ScilabDouble(this.pas); + this.model.ipar = new ScilabDouble(this.meth); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.pas)],[string(this.meth)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } QUANT_f.prototype.details = function QUANT_f() { @@ -32,7 +32,7 @@ function QUANT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.pas,this.meth,exprs] = scicos_getvalue("Set parameters",["Step","Quantization Type (1-4)"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -42,21 +42,21 @@ function QUANT_f() { message("Quantization Type must be from 1 to 4"); } else { rpar = this.pas; - model.rpar = rpar; - model.ipar = this.meth; + this.model.rpar = new ScilabDouble(rpar); + this.model.ipar = new ScilabDouble(this.meth); switch (this.meth) { case 1: - model.sim = "qzrnd"; + this.model.sim = new ScilabString("qzrnd"); case 2: - model.sim = "qztrn"; + this.model.sim = new ScilabString("qztrn"); case 3: - model.sim = "qzflr"; + this.model.sim = new ScilabString("qzflr"); case 4: - model.sim = "qzcel"; + this.model.sim = new ScilabString("qzcel"); } graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/QUANT_f.pickle b/js/NonLinear/QUANT_f.pickle index b4faee1b..aac3fdf6 100644 --- a/js/NonLinear/QUANT_f.pickle +++ b/js/NonLinear/QUANT_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'meth' +aS'model' p3 aS'pas' p4 -atp5 -Rp6 +aS'meth' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/SATURATION.js b/js/NonLinear/SATURATION.js index 2eb79d27..a6f2ac2b 100644 --- a/js/NonLinear/SATURATION.js +++ b/js/NonLinear/SATURATION.js @@ -4,18 +4,18 @@ function SATURATION() { this.minp = -1; this.maxp = 1; rpar = [[this.maxp],[this.minp]]; - model = scicos_model(); - model.sim = list("satur",4); - model.in1 = 1; - model.nzcross = 2; - model.nmode = 1; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [true,false]; - exprs = [[string(this.maxp)],[string(this.minp)],[string(model.nmode)]]; + this.model = scicos_model(); + this.model.sim = list("satur",4); + this.model.in1 = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; + exprs = [[string(this.maxp)],[string(this.minp)],[string(this.model.nmode)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SATURATION.prototype.details = function SATURATION() { @@ -36,7 +36,7 @@ function SATURATION() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,this.zeroc,exprs] = scicos_getvalue("Set Saturation parameters",["Upper limit","Lower limit","zero crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -46,17 +46,17 @@ function SATURATION() { message("Upper limit must be > Lower limit"); } else { rpar = [[this.maxp],[this.minp]]; - model.rpar = rpar; + this.model.rpar = rpar; if (this.zeroc!=0) { - model.nzcross = 2; - model.nmode = 1; + this.model.nzcross = new ScilabDouble(2); + this.model.nmode = new ScilabDouble(1); } else { - model.nzcross = 0; - model.nmode = 0; + this.model.nzcross = new ScilabDouble(0); + this.model.nmode = new ScilabDouble(0); } graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/SATURATION.pickle b/js/NonLinear/SATURATION.pickle index 4597f082..496fcd93 100644 --- a/js/NonLinear/SATURATION.pickle +++ b/js/NonLinear/SATURATION.pickle @@ -6,12 +6,14 @@ S'minp' p2 aS'x' p3 -aS'maxp' +aS'model' p4 aS'zeroc' p5 -atp6 -Rp7 +aS'maxp' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/NonLinear/SAT_f.js b/js/NonLinear/SAT_f.js index 72812ed6..f0122f8a 100644 --- a/js/NonLinear/SAT_f.js +++ b/js/NonLinear/SAT_f.js @@ -5,17 +5,17 @@ function SAT_f() { this.maxp = 1; slope = 1; rpar = [[this.minp],[this.maxp],[slope]]; - model = scicos_model(); - model.sim = list("lusat",1); - model.in1 = 1; - model.nzcross = 2; - model.out = 1; - model.rpar = [[this.minp],[this.maxp],[slope]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("lusat",1); + this.model.in1 = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(2); + this.model.out = new ScilabDouble(1); + this.model.rpar = [[this.minp],[this.maxp],[slope]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string(this.minp)],[string(this.maxp)],[string(slope)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SAT_f.prototype.details = function SAT_f() { @@ -36,7 +36,7 @@ function SAT_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.minp,this.maxp,this.pente,exprs] = scicos_getvalue("Set Saturation parameters",["Min","Max","Slope"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -48,11 +48,11 @@ function SAT_f() { message("Slope must be strictly positive"); } else { rpar = [[this.minp/this.pente],[this.maxp/this.pente],[this.pente]]; - model.rpar = rpar; - model.firing = []; + this.model.rpar = rpar; + this.model.firing = []; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/SAT_f.pickle b/js/NonLinear/SAT_f.pickle index bfdf1e21..5ba17f00 100644 --- a/js/NonLinear/SAT_f.pickle +++ b/js/NonLinear/SAT_f.pickle @@ -6,12 +6,14 @@ S'minp' p2 aS'x' p3 -aS'maxp' +aS'model' p4 -aS'pente' +aS'maxp' p5 -atp6 -Rp7 +aS'pente' +p6 +atp7 +Rp8 .(dp0 S'slope' p1 diff --git a/js/NonLinear/SIGNUM.js b/js/NonLinear/SIGNUM.js index f52c4715..274537ab 100644 --- a/js/NonLinear/SIGNUM.js +++ b/js/NonLinear/SIGNUM.js @@ -2,17 +2,17 @@ function SIGNUM() { SIGNUM.prototype.define = function SIGNUM() { nu = -1; - model = scicos_model(); - model.sim = list("signum",4); - model.in1 = nu; - model.out = nu; - model.nzcross = nu; - model.nmode = nu; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("signum",4); + this.model.in1 = new ScilabDouble(nu); + this.model.out = new ScilabDouble(nu); + this.model.nzcross = new ScilabDouble(nu); + this.model.nmode = new ScilabDouble(nu); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [string([1])]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SIGNUM.prototype.details = function SIGNUM() { @@ -29,7 +29,7 @@ function SIGNUM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); if (!ok) { @@ -38,14 +38,14 @@ function SIGNUM() { graphics.exprs = exprs; if (ok) { if (this.zcr!=0) { - model.nmode = -1; - model.nzcross = -1; + this.model.nmode = new ScilabDouble(-1); + this.model.nzcross = new ScilabDouble(-1); } else { - model.nmode = 0; - model.nzcross = 0; + this.model.nmode = new ScilabDouble(0); + this.model.nzcross = new ScilabDouble(0); } this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/SIGNUM.pickle b/js/NonLinear/SIGNUM.pickle index 835aded5..083f7a74 100644 --- a/js/NonLinear/SIGNUM.pickle +++ b/js/NonLinear/SIGNUM.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'zcr' +aS'model' p3 -atp4 -Rp5 +aS'zcr' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/SINBLK_f.js b/js/NonLinear/SINBLK_f.js index 94069384..be034737 100644 --- a/js/NonLinear/SINBLK_f.js +++ b/js/NonLinear/SINBLK_f.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/NonLinear/SINBLK_f.sci" */ function SINBLK_f() { SINBLK_f.prototype.define = function SINBLK_f() { - model = scicos_model(); - model.sim = "sinblk"; - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sinblk"); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SINBLK_f.prototype.details = function SINBLK_f() { diff --git a/js/NonLinear/SINBLK_f.pickle b/js/NonLinear/SINBLK_f.pickle index a1899b57..a48dbb00 100644 --- a/js/NonLinear/SINBLK_f.pickle +++ b/js/NonLinear/SINBLK_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/TANBLK_f.js b/js/NonLinear/TANBLK_f.js index 66fef89f..c422297a 100644 --- a/js/NonLinear/TANBLK_f.js +++ b/js/NonLinear/TANBLK_f.js @@ -2,15 +2,15 @@ function TANBLK_f() { TANBLK_f.prototype.define = function TANBLK_f() { in1 = -1; - model = scicos_model(); - model.sim = "tanblk"; - model.in1 = in1; - model.out = in1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("tanblk"); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(in1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = sci2exp(in1); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TANBLK_f.prototype.details = function TANBLK_f() { diff --git a/js/NonLinear/TANBLK_f.pickle b/js/NonLinear/TANBLK_f.pickle index b1fe08f9..1758e0ab 100644 --- a/js/NonLinear/TANBLK_f.pickle +++ b/js/NonLinear/TANBLK_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/NonLinear/TrigFun.js b/js/NonLinear/TrigFun.js index e0392284..5459db52 100644 --- a/js/NonLinear/TrigFun.js +++ b/js/NonLinear/TrigFun.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/NonLinear/TrigFun.sci" */ function TrigFun() { TrigFun.prototype.define = function TrigFun() { - model = scicos_model(); - model.sim = list("sin_blk",4); - model.in1 = -1; - model.out = -1; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("sin_blk",4); + this.model.in1 = new ScilabDouble(-1); + this.model.out = new ScilabDouble(-1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = "sin"; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TrigFun.prototype.details = function TrigFun() { @@ -25,7 +25,7 @@ function TrigFun() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; PREVAR_FF = [["sin"],["cos"],["tan"],["asin"],["acos"],["atan"],["sinh"],["cosh"],["tanh"],["asinh"],["acosh"],["atanh"]]; PREVAR_GG = [["Choose among "+strcat(PREVAR_FF.slice(1-1,4),", ")],[strcat(PREVAR_FF.slice(5-1,$),", ")]]; while (true) { @@ -39,7 +39,7 @@ function TrigFun() { graphics.exprs = exprs; execstr("model.sim=list(\'"+this.fun+"_blk\',4)"); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/NonLinear/TrigFun.pickle b/js/NonLinear/TrigFun.pickle index b9dda0a5..59115b66 100644 --- a/js/NonLinear/TrigFun.pickle +++ b/js/NonLinear/TrigFun.pickle @@ -6,8 +6,10 @@ S'fun' p2 aS'x' p3 -atp4 -Rp5 +aS'model' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/PDE/PDE.js b/js/PDE/PDE.js index 3268c0e0..3e8a52d7 100644 --- a/js/PDE/PDE.js +++ b/js/PDE/PDE.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/PDE/PDE.sci" */ function PDE() { PDE.prototype.define = function PDE() { - model = scicos_model(); - model.state = zeros(10,1); - model.sim = list("PDE",0); - model.in1 = [[1],[1],[1],[1],[1]]; - model.out = [[10],[0]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.state = new ScilabDouble(zeros(10,1)); + this.model.sim = list("PDE",0); + this.model.in1 = [[1],[1],[1],[1],[1]]; + this.model.out = [[10],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; params_pde = tlist([["paramspde"],["a"],["b"],["txt_exp"],["check_op1"],["a1"],["b1"],["check_op2"],["a2"],["b2"],["check_op3"],["a3"],["b3"],["check_op4"],["a4"],["b4"],["check_op5"],["a5"],["b5"],["check_op6"],["a6"],["b6"],["check_op7"],["a7"],["b7"],["discr_cst"],["discr_non_cst"],["signe"],["rad_automatique"],["rad_manuel"],["methode"],["ord1"],["ord2"],["ord3"],["degre"],["nnode"],["txt_pas"],["CI"],["dCI"],["CLa"],["CLa_exp"],["CLb"],["CLb_exp"],["points"]],"","","","0","","IN_EDP1(t)","0","","IN_EDP2(t)","0","","IN_EDP3(t)","0","","IN_EDP4(t)","0","","IN_EDP5(t)","0","","IN_EDP6(t)","0","","IN_EDP7(t)","0","0","0","0","0","0","","","","","","","","","0","IN_CL1(t)","0","IN_CL2(t)",""); label = list(params_pde,[],""); gr_i = []; - this.x = standard_define([3,3],model,label,gr_i); + this.x = standard_define([3,3],this.model,label,gr_i); return new BasicBlock(this.x); } PDE.prototype.details = function PDE() { @@ -29,7 +29,7 @@ function PDE() { this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; - model = arg1.model; + this.model = arg1.model; params_pde = label[1-1]; while (true) { [ln,fun]=where() @@ -96,29 +96,29 @@ function PDE() { out = [[Nbr_maillage],[size(mesures,"*")]]; } if ((flag_type==1)) { - model.sim = list(this.rdnom,2004); + this.model.sim = list(this.rdnom,2004); if ((find(oper==1)!=[])) { - model.state = zeros(2*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(2*Nbr_maillage,1)); } else { - model.state = zeros(Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(Nbr_maillage,1)); } } else if ((flag_type==2)) { - model.sim = list(this.rdnom,12004); + this.model.sim = list(this.rdnom,12004); if ((find(oper==1)!=[])) { if ((type_meth==3&&(find(oper==2)!=[]||find(oper==4)!=[]))) { - model.state = zeros(6*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(6*Nbr_maillage,1)); } else if ((type_meth==1)) { - model.state = zeros(4*Nbr,1); + this.model.state = new ScilabDouble(zeros(4*Nbr,1)); } else { - model.state = zeros(4*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(4*Nbr_maillage,1)); } } else { if ((type_meth==3&&(find(oper==2)!=[]||find(oper==4)!=[]))) { - model.state = zeros(4*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(4*Nbr_maillage,1)); } else if ((type_meth==1)) { - model.state = zeros(2*Nbr,1); + this.model.state = new ScilabDouble(zeros(2*Nbr,1)); } else { - model.state = zeros(2*Nbr_maillage,1); + this.model.state = new ScilabDouble(zeros(2*Nbr_maillage,1)); } } } @@ -127,13 +127,13 @@ function PDE() { break; } if (!ok) { - [model,graphics,ok] = check_io(model,graphics,ones(k,1),out.slice(),[],[]); + [model,graphics,ok] = check_io(this.model,graphics,ones(k,1),out.slice(),[],[]); } label[1-1] = params_pde; label[2-1] = tt; graphics.exprs = label; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/PDE/PDE.pickle b/js/PDE/PDE.pickle index dd3eb157..ee321f6f 100644 --- a/js/PDE/PDE.pickle +++ b/js/PDE/PDE.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'lab' p2 -aS'okk' -p3 aS'rdnom' +p3 +aS'arbre_decision' p4 -aS'lab' +aS'x' p5 -aS'arbre_decision' +aS'model' p6 -atp7 -Rp8 +aS'okk' +p7 +atp8 +Rp9 .(dp0 S'params_pde' p1 diff --git a/js/Sinks/AFFICH_m.js b/js/Sinks/AFFICH_m.js index 3b073df5..5121a006 100644 --- a/js/Sinks/AFFICH_m.js +++ b/js/Sinks/AFFICH_m.js @@ -7,20 +7,20 @@ function AFFICH_m() { this.nt = 5; this.nd = 1; this.in1 = [1,1]; - model = scicos_model(); - model.sim = list("affich2",4); - model.in1 = this.in1[1-1][1-1]; - model.in2 = this.in1[1-1][2-1]; - model.evtin = 1; - model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; - model.ipar = [[this.font],[this.fontsize],[this.colr],[1000],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; - model.blocktype = "c"; - model.firing = []; - model.dep_ut = [true,false]; - model.label = ""; - exprs = [[sci2exp([model.in1,model.in2])],[string(this.font)],[string(this.fontsize)],[string(this.colr)],[string(this.nt)],[string(this.nd)],[string(0)]]; + this.model = scicos_model(); + this.model.sim = list("affich2",4); + this.model.in1 = new ScilabDouble(this.in1[1-1][1-1]); + this.model.in2 = new ScilabDouble(this.in1[1-1][2-1]); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; + this.model.ipar = [[this.font],[this.fontsize],[this.colr],[1000],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; + this.model.blocktype = new ScilabString("c"); + this.model.firing = []; + this.model.dep_ut = [true,false]; + this.model.label = new ScilabString(""); + exprs = [[sci2exp([this.model.in1,this.model.in2])],[string(this.font)],[string(this.fontsize)],[string(this.colr)],[string(this.nt)],[string(this.nd)],[string(0)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new AfficheBlock(this.x); } AFFICH_m.prototype.details = function AFFICH_m() { @@ -49,7 +49,7 @@ function AFFICH_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,this.font,this.fontsize,this.colr,this.nt,this.nd,this.herit,exprs] = scicos_getvalue("Set parameters",["Input Size","Font number","Font size","Color","Total number of digits","Number of rational part digits","Block inherits (1) or not (0)"],list("mat",[1,2],"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -83,15 +83,15 @@ function AFFICH_m() { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(this.in1,1),list(),ones(1-this.herit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(this.in1,1),list(),ones(1-this.herit,1),[]); } if (ok) { - model.ipar = [[this.font],[this.fontsize],[this.colr],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; - model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; - model.evtin = ones(1-this.herit,1); + this.model.ipar = [[this.font],[this.fontsize],[this.colr],[this.nt],[this.nd],[this.in1[1-1][1-1]]]; + this.model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(this.in1[1-1][1-1]*this.in1[1-1][2-1],1)]]; + this.model.evtin = new ScilabDouble(ones(1-this.herit,1)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/AFFICH_m.pickle b/js/Sinks/AFFICH_m.pickle index 85768c77..55f218ca 100644 --- a/js/Sinks/AFFICH_m.pickle +++ b/js/Sinks/AFFICH_m.pickle @@ -14,12 +14,14 @@ aS'fontsize' p6 aS'x' p7 -aS'font' +aS'model' p8 -aS'nt' +aS'font' p9 -atp10 -Rp11 +aS'nt' +p10 +atp11 +Rp12 .(dp0 S'model.dstate' p1 diff --git a/js/Sinks/BARXY.js b/js/Sinks/BARXY.js index 48eb2b5e..88d642d7 100644 --- a/js/Sinks/BARXY.js +++ b/js/Sinks/BARXY.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Sinks/BARXY.sci" */ function BARXY() { BARXY.prototype.define = function BARXY() { - model = scicos_model(); + this.model = scicos_model(); this.xmin = -15; this.xmax = 15; this.ymin = -15; this.ymax = 15; - model.sim = list("BARXY_sim",5); - model.blocktype = "d"; - model.dep_ut = [true,false]; - model.in1 = [[-1],[-1]]; - model.intyp = [1]; - model.out = []; - model.evtin = [1]; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = 1; - this.x = standard_define([2,2],model,[],[]); + this.model.sim = list("BARXY_sim",5); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; + this.model.in1 = [[-1],[-1]]; + this.model.intyp = [1]; + this.model.out = []; + this.model.evtin = [1]; + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = new ScilabDouble(1); + this.x = standard_define([2,2],this.model,[],[]); this.x.graphics.in_implicit = ["E","E"]; this.x.graphics.out_implicit = []; this.x.graphics.exprs = [["-15"],["15"],["-15"],["15"],["1"]]; @@ -43,7 +43,7 @@ function BARXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.xmin,this.xmax,this.ymin,this.ymax,this.thickness,exprs] = scicos_getvalue("Set Scope parameters",["Xmin","Xmax","Ymin","Ymax","Segs Thickness"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -65,11 +65,11 @@ function BARXY() { if (!ok) { message(mess); } else { - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = this.thickness; + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = new ScilabDouble(this.thickness); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/BARXY.pickle b/js/Sinks/BARXY.pickle index 77eef456..0716001f 100644 --- a/js/Sinks/BARXY.pickle +++ b/js/Sinks/BARXY.pickle @@ -12,10 +12,12 @@ aS'xmin' p5 aS'x' p6 -aS'ymin' +aS'model' p7 -atp8 -Rp9 +aS'ymin' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Sinks/CANIMXY.js b/js/Sinks/CANIMXY.js index 79d741a3..6779db88 100644 --- a/js/Sinks/CANIMXY.js +++ b/js/Sinks/CANIMXY.js @@ -12,20 +12,20 @@ function CANIMXY() { this.ymin = -15; this.ymax = 15; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("canimxy",4); - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("canimxy",4); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[string(this.clrs)],[string(this.siz)],[string(this.win)],["[]"],["[]"],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CANIMXY.prototype.details = function CANIMXY() { @@ -62,7 +62,7 @@ function CANIMXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.xmin,this.xmax,this.ymin,this.ymax,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of Curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin","Xmax","Ymin","Ymax","Buffer size"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -106,7 +106,7 @@ function CANIMXY() { } else { in1 = this.nbr_curves*ones(2,1); in2 = ones(2,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -115,11 +115,11 @@ function CANIMXY() { } rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[0],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CANIMXY.pickle b/js/Sinks/CANIMXY.pickle index 5b769716..56da20f9 100644 --- a/js/Sinks/CANIMXY.pickle +++ b/js/Sinks/CANIMXY.pickle @@ -24,10 +24,12 @@ aS'xmin' p11 aS'x' p12 -aS'nbr_curves' +aS'model' p13 -atp14 -Rp15 +aS'nbr_curves' +p14 +atp15 +Rp16 .(dp0 S'clrs' p1 diff --git a/js/Sinks/CANIMXY3D.js b/js/Sinks/CANIMXY3D.js index ba90c709..fcbbfcf4 100644 --- a/js/Sinks/CANIMXY3D.js +++ b/js/Sinks/CANIMXY3D.js @@ -12,20 +12,20 @@ function CANIMXY3D() { this.vec_y = [[-15],[15]]; this.vec_z = [[-15],[15]]; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("canimxy3d",4); - model.in1 = [[1],[1],[1]]; - model.evtin = 1; - model.in2 = [[1],[1],[1]]; - model.intyp = [[1],[1],[1]]; - model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; - model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("canimxy3d",4); + this.model.in1 = [[1],[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.in2 = [[1],[1],[1]]; + this.model.intyp = [[1],[1],[1]]; + this.model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; + this.model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],["[]"],["[]"],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CANIMXY3D.prototype.details = function CANIMXY3D() { @@ -62,7 +62,7 @@ function CANIMXY3D() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.vec_x,this.vec_y,this.vec_z,this.param3ds,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin and Xmax","Ymin and Ymax","Zmin and Zmax","Alpha and Theta","Buffer size"],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs); if (!ok) { @@ -122,7 +122,7 @@ function CANIMXY3D() { } else { in1 = this.nbr_curves*ones(3,1); in2 = ones(3,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -132,11 +132,11 @@ function CANIMXY3D() { rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; size_siz = size(this.siz,"*"); ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CANIMXY3D.pickle b/js/Sinks/CANIMXY3D.pickle index 85ea96f7..376a0c81 100644 --- a/js/Sinks/CANIMXY3D.pickle +++ b/js/Sinks/CANIMXY3D.pickle @@ -24,10 +24,12 @@ aS'siz' p11 aS'x' p12 -aS'nbr_curves' +aS'model' p13 -atp14 -Rp15 +aS'nbr_curves' +p14 +atp15 +Rp16 .(dp0 S'clrs' p1 diff --git a/js/Sinks/CEVENTSCOPE.js b/js/Sinks/CEVENTSCOPE.js index 9dcd508f..4c4319d8 100644 --- a/js/Sinks/CEVENTSCOPE.js +++ b/js/Sinks/CEVENTSCOPE.js @@ -7,16 +7,16 @@ function CEVENTSCOPE() { this.wdim = [[600],[400]]; this.wpos = [[-1],[-1]]; this.per = 30; - model = scicos_model(); - model.sim = list("cevscpe",4); - model.evtin = 1; - model.rpar = this.per; - model.ipar = [[this.win],[1],[this.clrs[this.nclock-1]],[this.wpos.slice()],[this.wdim.slice()]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cevscpe",4); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.per); + this.model.ipar = [[this.win],[1],[this.clrs[this.nclock-1]],[this.wpos.slice()],[this.wdim.slice()]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[sci2exp(this.nclock)],[strcat(sci2exp(this.clrs[this.nclock-1])," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.per)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CEVENTSCOPE.prototype.details = function CEVENTSCOPE() { @@ -43,7 +43,7 @@ function CEVENTSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nclock,this.clrs,this.win,this.wpos,this.wdim,this.per,exprs] = scicos_getvalue("Set Scope parameters",["Number of event inputs","colors c (>0) or mark (<0)","Output window number (-1 for automatic)","Output window position","Output window sizes","Refresh period"],list("vec",1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",1),exprs); this.nclock = int(this.nclock); @@ -78,7 +78,7 @@ function CEVENTSCOPE() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(),list(),ones(this.nclock,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list(),list(),ones(this.nclock,1),[]); } else { message([["Some specified values are inconsistent:"],[" "],[mess]]); } @@ -91,11 +91,11 @@ function CEVENTSCOPE() { } rpar = this.per; ipar = [[this.win],[1],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = new ScilabDouble(rpar); + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CEVENTSCOPE.pickle b/js/Sinks/CEVENTSCOPE.pickle index 8b6148a9..f2b60d90 100644 --- a/js/Sinks/CEVENTSCOPE.pickle +++ b/js/Sinks/CEVENTSCOPE.pickle @@ -14,10 +14,12 @@ aS'wdim' p6 aS'x' p7 -aS'nclock' +aS'model' p8 -atp9 -Rp10 +aS'nclock' +p9 +atp10 +Rp11 .(dp0 S'clrs' p1 diff --git a/js/Sinks/CFSCOPE.js b/js/Sinks/CFSCOPE.js index d30e6601..099c58b7 100644 --- a/js/Sinks/CFSCOPE.js +++ b/js/Sinks/CFSCOPE.js @@ -9,16 +9,16 @@ function CFSCOPE() { this.ymin = -15; this.ymax = 15; this.per = 30; - model = scicos_model(); - model.sim = list("cfscope",4); - model.evtin = 1; - model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim],[1],[1]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cfscope",4); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim],[1],[1]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[string([1])]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CFSCOPE.prototype.details = function CFSCOPE() { @@ -51,7 +51,7 @@ function CFSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.wu,exprs] = scicos_getvalue("Set Scope parameters",["Color (>0) or mark (<0) vector (8 entries)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin","Ymax","Refresh period","Buffer size","Links to view"],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",-1),exprs); if (!ok) { @@ -104,13 +104,13 @@ function CFSCOPE() { this.clrs[8-1] = 0; } ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()],[size(this.wu,"*")],[this.wu.slice()]]; - model.rpar = rpar; - model.ipar = ipar; - model.firing = []; - model.dep_ut = [true,false]; + this.model.rpar = rpar; + this.model.ipar = ipar; + this.model.firing = []; + this.model.dep_ut = [true,false]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CFSCOPE.pickle b/js/Sinks/CFSCOPE.pickle index 7d3f93b7..c4ff4755 100644 --- a/js/Sinks/CFSCOPE.pickle +++ b/js/Sinks/CFSCOPE.pickle @@ -20,10 +20,12 @@ aS'wdim' p9 aS'x' p10 -aS'ymin' +aS'model' p11 -atp12 -Rp13 +aS'ymin' +p12 +atp13 +Rp14 .(dp0 S'clrs' p1 diff --git a/js/Sinks/CLKOUTV_f.js b/js/Sinks/CLKOUTV_f.js index 4e80cd28..473968a7 100644 --- a/js/Sinks/CLKOUTV_f.js +++ b/js/Sinks/CLKOUTV_f.js @@ -2,15 +2,15 @@ function CLKOUTV_f() { CLKOUTV_f.prototype.define = function CLKOUTV_f() { this.prt = 1; - model = scicos_model(); - model.sim = "output"; - model.evtin = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("output"); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = string(this.prt); - this.x = standard_define([1,1],model,exprs," "); + this.x = standard_define([1,1],this.model,exprs," "); return new EventOutBlock(this.x); } CLKOUTV_f.prototype.details = function CLKOUTV_f() { @@ -25,7 +25,7 @@ function CLKOUTV_f() { this.prt = arguments[0]["prt"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.prt,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CLKOUTV_f")],[" "],["Event output port"]],"Port number",list("vec",1),exprs); @@ -36,11 +36,11 @@ function CLKOUTV_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - model.ipar = this.prt; - model.evtin = 1; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtin = new ScilabDouble(1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CLKOUTV_f.pickle b/js/Sinks/CLKOUTV_f.pickle index 3f6a5ee8..ff26649c 100644 --- a/js/Sinks/CLKOUTV_f.pickle +++ b/js/Sinks/CLKOUTV_f.pickle @@ -12,12 +12,14 @@ aS'prt' p5 aS'x' p6 -aS'type' +aS'model' p7 -aS'options' +aS'type' p8 -atp9 -Rp10 +aS'options' +p9 +atp10 +Rp11 .(dp0 S'[this.x,y]' p1 diff --git a/js/Sinks/CLKOUT_f.js b/js/Sinks/CLKOUT_f.js index 985ef1d8..023c3d86 100644 --- a/js/Sinks/CLKOUT_f.js +++ b/js/Sinks/CLKOUT_f.js @@ -2,15 +2,15 @@ function CLKOUT_f() { CLKOUT_f.prototype.define = function CLKOUT_f() { this.prt = 1; - model = scicos_model(); - model.sim = "output"; - model.evtin = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("output"); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; exprs = string(this.prt); - this.x = standard_define([1,1],model,exprs," "); + this.x = standard_define([1,1],this.model,exprs," "); return new BasicBlock(this.x); } CLKOUT_f.prototype.details = function CLKOUT_f() { @@ -25,7 +25,7 @@ function CLKOUT_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { @@ -37,12 +37,12 @@ function CLKOUT_f() { if (this.prt<=0) { message("Port number must be a positive integer"); } else { - model.ipar = this.prt; - model.evtin = 1; - model.firing = []; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtin = new ScilabDouble(1); + this.model.firing = []; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CLKOUT_f.pickle b/js/Sinks/CLKOUT_f.pickle index 6d7d48d4..4ffa6fb1 100644 --- a/js/Sinks/CLKOUT_f.pickle +++ b/js/Sinks/CLKOUT_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'prt' +aS'model' p3 -atp4 -Rp5 +aS'prt' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Sinks/CMAT3D.js b/js/Sinks/CMAT3D.js index a9d7bb37..04cefb73 100644 --- a/js/Sinks/CMAT3D.js +++ b/js/Sinks/CMAT3D.js @@ -9,19 +9,19 @@ function CMAT3D() { y = -1; size_x = 1; size_y = 1; - model = scicos_model(); - model.sim = list("cmat3d",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.evtin = 1; - model.ipar = [[this.cmin],[this.cmax],[size_c],[size_x],[size_y]]; - model.rpar = [[this.colormap.slice()],[this.x],[y]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cmat3d",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = [[this.cmin],[this.cmax],[size_c],[size_x],[size_y]]; + this.model.rpar = [[this.colormap.slice()],[this.x],[y]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.x)," ")],[strcat(string(y)," ")],[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CMAT3D.prototype.details = function CMAT3D() { @@ -46,7 +46,7 @@ function CMAT3D() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.vec_x,this.vec_y,this.colormap,this.cmin,this.cmax,exprs] = scicos_getvalue("Set Scope parameters",["Bounds Vector X (-1 for standard)","Bounds Vector Y (-1 for standard)","ColorMap","Zmin","Zmax"],list("vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),exprs); if (!ok) { @@ -69,11 +69,11 @@ function CMAT3D() { size_c = size(this.colormap.slice(),1); ipar = [[this.cmin],[this.cmax],[size_c],[size_x]]; rpar = [[this.colormap.slice()],[this.vec_x.slice()],[this.vec_y.slice()]]; - model.ipar = ipar; - model.rpar = rpar; + this.model.ipar = ipar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CMAT3D.pickle b/js/Sinks/CMAT3D.pickle index 2c85dba8..02e065b3 100644 --- a/js/Sinks/CMAT3D.pickle +++ b/js/Sinks/CMAT3D.pickle @@ -2,7 +2,7 @@ c__builtin__ set p0 ((lp1 -S'colormap' +S'cmin' p2 aS'vec_x' p3 @@ -12,12 +12,14 @@ aS'jetcolormap' p5 aS'x' p6 -aS'cmax' +aS'model' p7 -aS'cmin' +aS'cmax' p8 -atp9 -Rp10 +aS'colormap' +p9 +atp10 +Rp11 .(dp0 S'cmin' p1 diff --git a/js/Sinks/CMATVIEW.js b/js/Sinks/CMATVIEW.js index 3789d80b..884f173d 100644 --- a/js/Sinks/CMATVIEW.js +++ b/js/Sinks/CMATVIEW.js @@ -7,19 +7,19 @@ function CMATVIEW() { this.colormap = this.jetcolormap[size_c-1]; alpha_c = 0.24; beta_c = 1; - model = scicos_model(); - model.sim = list("cmatview",4); - model.in1 = -1; - model.in2 = -2; - model.intyp = 1; - model.evtin = 1; - model.ipar = [[this.cmin],[this.cmax],[size_c]]; - model.rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cmatview",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.ipar = [[this.cmin],[this.cmax],[size_c]]; + this.model.rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[string("jetcolormap(25)")],[string(this.cmin)],[string(this.cmax)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CMATVIEW.prototype.details = function CMATVIEW() { @@ -40,7 +40,7 @@ function CMATVIEW() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.colormap,this.cmin,this.cmax,exprs] = scicos_getvalue("Set Scope parameters",["ColorMap","Minimum level range","Maximum level range"],list("vec",-1,"vec",1,"vec",1),exprs); if (!ok) { @@ -61,11 +61,11 @@ function CMATVIEW() { beta_c = sol[2-1]; ipar = [[this.cmin],[this.cmax],[size_c]]; rpar = [[alpha_c],[beta_c],[this.colormap.slice()]]; - model.ipar = ipar; - model.rpar = rpar; + this.model.ipar = ipar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CMATVIEW.pickle b/js/Sinks/CMATVIEW.pickle index ba289a81..d750e107 100644 --- a/js/Sinks/CMATVIEW.pickle +++ b/js/Sinks/CMATVIEW.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'colormap' p2 -aS'cmax' -p3 aS'jetcolormap' +p3 +aS'x' p4 -aS'colormap' +aS'model' p5 -aS'cmin' +aS'cmax' p6 -atp7 -Rp8 +aS'cmin' +p7 +atp8 +Rp9 .(dp0 S'cmin' p1 diff --git a/js/Sinks/CMSCOPE.js b/js/Sinks/CMSCOPE.js index f3115496..6a5670b1 100644 --- a/js/Sinks/CMSCOPE.js +++ b/js/Sinks/CMSCOPE.js @@ -12,19 +12,19 @@ function CMSCOPE() { this.per = [[30],[30]]; yy = [[transpose(this.ymin.slice())],[transpose(this.ymax.slice())]]; period = transpose(this.per.slice()); - model = scicos_model(); - model.sim = list("cmscope",4); - model.in1 = this.in1; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; - model.rpar = [[0],[period.slice()],[yy.slice()]]; - model.ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice(1-1,sum(this.in1))]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cmscope",4); + this.model.in1 = this.in1; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[0],[period.slice()],[yy.slice()]]; + this.model.ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice(1-1,sum(this.in1))]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.in1)," ")],[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp([])],[strcat(string(this.ymin)," ")],[strcat(string(this.ymax)," ")],[strcat(string(this.per)," ")],[string(this.N)],[string(0)],[emptystr()]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CMSCOPE.prototype.details = function CMSCOPE() { @@ -61,7 +61,7 @@ function CMSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.heritance,this.nom,exprs] = scicos_getvalue("Set Scope parameters",["Input ports sizes","Drawing colors (>0) or mark (<0)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin vector","Ymax vector","Refresh period","Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"],list("vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec",1,"vec",1,"str",1),exprs); if (!ok) { @@ -121,7 +121,7 @@ function CMSCOPE() { this.in1 = this.in1.slice(); a = size(this.in1,1); in2 = ones(a,1); - [model,graphics,ok] = set_io(model,graphics,list([this.in1,in2],ones(a,1)),list(),ones(1-this.heritance,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([this.in1,in2],ones(a,1)),list(),ones(1-this.heritance,1),[]); } if (ok) { if (this.wpos==[]) { @@ -136,15 +136,15 @@ function CMSCOPE() { rpar = [[0],[period.slice()],[yy.slice()]]; this.clrs = this.clrs.slice(1-1,sum(this.in1)); ipar = [[this.win],[size(this.in1,"*")],[this.N],[this.wpos.slice()],[this.wdim.slice()],[this.in1.slice()],[this.clrs.slice()],[this.heritance]]; - model.evtin = ones(1-this.heritance,1); - model.dstate = []; - model.rpar = rpar; - model.ipar = ipar; - model.label = this.nom; + this.model.evtin = new ScilabDouble(ones(1-this.heritance,1)); + this.model.dstate = []; + this.model.rpar = rpar; + this.model.ipar = ipar; + this.model.label = new ScilabDouble(this.nom); graphics.id = this.nom; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CMSCOPE.pickle b/js/Sinks/CMSCOPE.pickle index 5cefa80a..822ba1ff 100644 --- a/js/Sinks/CMSCOPE.pickle +++ b/js/Sinks/CMSCOPE.pickle @@ -22,12 +22,14 @@ aS'wdim' p10 aS'x' p11 -aS'ymin' +aS'model' p12 -aS'heritance' +aS'ymin' p13 -atp14 -Rp15 +aS'heritance' +p14 +atp15 +Rp16 .(dp0 S'clrs' p1 diff --git a/js/Sinks/CSCOPE.js b/js/Sinks/CSCOPE.js index 43549e3b..286de553 100644 --- a/js/Sinks/CSCOPE.js +++ b/js/Sinks/CSCOPE.js @@ -9,18 +9,18 @@ function CSCOPE() { this.ymin = -15; this.ymax = 15; this.per = 30; - model = scicos_model(); - model.sim = list("cscope",4); - model.in1 = -1; - model.in2 = 1; - model.evtin = 1; - model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim]]; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("cscope",4); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[0],[this.ymin],[this.ymax],[this.per]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.wpos],[this.wdim]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(string(this.clrs)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.ymin)],[string(this.ymax)],[string(this.per)],[string(this.N)],[transpose(string(0))],[emptystr()]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CSCOPE.prototype.details = function CSCOPE() { @@ -55,7 +55,7 @@ function CSCOPE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.clrs,this.win,this.wpos,this.wdim,this.ymin,this.ymax,this.per,this.N,this.heritance,this.nom,exprs] = scicos_getvalue("Set Scope parameters",["Color (>0) or mark (<0) vector (8 entries)","Output window number (-1 for automatic)","Output window position","Output window sizes","Ymin","Ymax","Refresh period","Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"str",1),exprs); if (!ok) { @@ -94,7 +94,7 @@ function CSCOPE() { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([-1,1],1),list(),ones(1-this.heritance,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,1],1),list(),ones(1-this.heritance,1),[]); } if (ok) { if (this.wpos==[]) { @@ -105,14 +105,14 @@ function CSCOPE() { } rpar = [[0],[this.ymin],[this.ymax],[this.per]]; ipar = [[this.win],[1],[this.N],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; - model.rpar = rpar; - model.ipar = ipar; - model.evtin = ones(1-this.heritance,1); - model.label = this.nom; + this.model.rpar = rpar; + this.model.ipar = ipar; + this.model.evtin = new ScilabDouble(ones(1-this.heritance,1)); + this.model.label = new ScilabDouble(this.nom); graphics.id = this.nom; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CSCOPE.pickle b/js/Sinks/CSCOPE.pickle index cdc0fc5c..04612b4d 100644 --- a/js/Sinks/CSCOPE.pickle +++ b/js/Sinks/CSCOPE.pickle @@ -20,12 +20,14 @@ aS'wdim' p9 aS'x' p10 -aS'ymin' +aS'model' p11 -aS'heritance' +aS'ymin' p12 -atp13 -Rp14 +aS'heritance' +p13 +atp14 +Rp15 .(dp0 S'clrs' p1 diff --git a/js/Sinks/CSCOPXY.js b/js/Sinks/CSCOPXY.js index 2c7d2606..41dda84c 100644 --- a/js/Sinks/CSCOPXY.js +++ b/js/Sinks/CSCOPXY.js @@ -12,19 +12,19 @@ function CSCOPXY() { this.ymin = -15; this.ymax = 15; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("cscopxy",4); - model.in1 = [[1],[1]]; - model.in2 = [[1],[1]]; - model.intyp = [[1],[1]]; - model.evtin = 1; - model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cscopxy",4); + this.model.in1 = [[1],[1]]; + this.model.in2 = [[1],[1]]; + this.model.intyp = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[sci2exp(this.clrs)],[sci2exp(this.siz)],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.xmin)],[string(this.xmax)],[string(this.ymin)],[string(this.ymax)],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CSCOPXY.prototype.details = function CSCOPXY() { @@ -61,7 +61,7 @@ function CSCOPXY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.xmin,this.xmax,this.ymin,this.ymax,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of Curves","color (>0) or mark (<0)","line or mark size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin","Xmax","Ymin","Ymax","Buffer size"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -105,7 +105,7 @@ function CSCOPXY() { } else { in1 = this.nbr_curves*ones(2,1); in2 = ones(2,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -114,11 +114,11 @@ function CSCOPXY() { } rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; ipar = [[this.win],[1],[this.N],[this.clrs],[this.siz],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/CSCOPXY.pickle b/js/Sinks/CSCOPXY.pickle index 866d8dfd..ac3e7d28 100644 --- a/js/Sinks/CSCOPXY.pickle +++ b/js/Sinks/CSCOPXY.pickle @@ -24,10 +24,12 @@ aS'xmin' p11 aS'x' p12 -aS'nbr_curves' +aS'model' p13 -atp14 -Rp15 +aS'nbr_curves' +p14 +atp15 +Rp16 .(dp0 S'clrs' p1 diff --git a/js/Sinks/CSCOPXY3D.js b/js/Sinks/CSCOPXY3D.js index 7f8075d7..1a323cc1 100644 --- a/js/Sinks/CSCOPXY3D.js +++ b/js/Sinks/CSCOPXY3D.js @@ -12,19 +12,19 @@ function CSCOPXY3D() { this.vec_y = [[-15],[15]]; this.vec_z = [[-15],[15]]; this.nbr_curves = 1; - model = scicos_model(); - model.sim = list("cscopxy3d",4); - model.in1 = [[1],[1],[1]]; - model.in2 = [[1],[1],[1]]; - model.intyp = [[1],[1],[1]]; - model.evtin = 1; - model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; - model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cscopxy3d",4); + this.model.in1 = [[1],[1],[1]]; + this.model.in2 = [[1],[1],[1]]; + this.model.intyp = [[1],[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; + this.model.ipar = [[this.win],[8],[this.N],[this.clrs.slice()],[this.siz.slice()],[8],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[string(this.nbr_curves)],[strcat(string(this.clrs)," ")],[strcat(string(this.siz)," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[strcat(string(this.vec_x)," ")],[strcat(string(this.vec_y)," ")],[strcat(string(this.vec_z)," ")],[strcat(string(this.param3ds)," ")],[string(this.N)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CSCOPXY3D.prototype.details = function CSCOPXY3D() { @@ -61,7 +61,7 @@ function CSCOPXY3D() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.nbr_curves,this.clrs,this.siz,this.win,this.wpos,this.wdim,this.vec_x,this.vec_y,this.vec_z,this.param3ds,this.N,exprs] = scicos_getvalue("Set Scope parameters",["Number of curves","color (>0) or mark (<0)","Line or Mark Size","Output window number (-1 for automatic)","Output window position","Output window sizes","Xmin and Xmax","Ymin and Ymax","Zmin and Zmax","Alpha and Theta","Buffer size"],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",2,"vec",2,"vec",2,"vec",2,"vec",1),exprs); if (!ok) { @@ -115,7 +115,7 @@ function CSCOPXY3D() { if (ok) { in1 = this.nbr_curves*ones(3,1); in2 = ones(3,1); - [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]); if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } @@ -125,11 +125,11 @@ function CSCOPXY3D() { rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]]; size_siz = size(this.siz,"*"); ipar = [[this.win],[size_siz],[this.N],[this.clrs.slice()],[this.siz.slice()],[1],[this.wpos.slice()],[this.wdim.slice()],[this.nbr_curves]]; - model.rpar = rpar; - model.ipar = ipar; + this.model.rpar = rpar; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } else { message(mess); diff --git a/js/Sinks/CSCOPXY3D.pickle b/js/Sinks/CSCOPXY3D.pickle index 6c11c475..721b6b62 100644 --- a/js/Sinks/CSCOPXY3D.pickle +++ b/js/Sinks/CSCOPXY3D.pickle @@ -24,10 +24,12 @@ aS'siz' p11 aS'x' p12 -aS'nbr_curves' +aS'model' p13 -atp14 -Rp15 +aS'nbr_curves' +p14 +atp15 +Rp16 .(dp0 S'clrs' p1 diff --git a/js/Sinks/OUTIMPL_f.js b/js/Sinks/OUTIMPL_f.js index eb1aff0e..b0e9595d 100644 --- a/js/Sinks/OUTIMPL_f.js +++ b/js/Sinks/OUTIMPL_f.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Sinks/OUTIMPL_f.sci" */ function OUTIMPL_f() { OUTIMPL_f.prototype.define = function OUTIMPL_f() { - model = scicos_model(); - model.in1 = [-1]; - model.in2 = [1]; + this.model = scicos_model(); + this.model.in1 = [-1]; + this.model.in2 = [1]; this.prt = 1; - model.sim = "outimpl"; - model.ipar = [1]; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model.sim = new ScilabString("outimpl"); + this.model.ipar = [1]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "PORT"; mo.inputs = "n"; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = "1"; gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; return new ImplicitOutBlock(this.x); } @@ -32,7 +32,7 @@ function OUTIMPL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[1-1]; } @@ -45,14 +45,14 @@ function OUTIMPL_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - if (model.ipar!=this.prt) { + if (this.model.ipar!=this.prt) { needcompile = 4; y = needcompile; } - model.ipar = this.prt; + this.model.ipar = new ScilabDouble(this.prt); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/OUTIMPL_f.pickle b/js/Sinks/OUTIMPL_f.pickle index 79131fd4..e5dda12a 100644 --- a/js/Sinks/OUTIMPL_f.pickle +++ b/js/Sinks/OUTIMPL_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'prt' +aS'model' p3 -atp4 -Rp5 +aS'prt' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Sinks/OUT_f.js b/js/Sinks/OUT_f.js index 4a81d71f..624915bf 100644 --- a/js/Sinks/OUT_f.js +++ b/js/Sinks/OUT_f.js @@ -3,17 +3,17 @@ function OUT_f() { OUT_f.prototype.define = function OUT_f() { n = -1; this.prt = 1; - model = scicos_model(); - model.sim = "output"; - model.in1 = -1; - model.in2 = -2; - model.intyp = -1; - model.ipar = this.prt; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("output"); + this.model.in1 = new ScilabDouble(-1); + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(-1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = string(this.prt); gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new ExplicitOutBlock(this.x); } OUT_f.prototype.details = function OUT_f() { @@ -28,7 +28,7 @@ function OUT_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,"*")==2) { exprs = exprs[1-1]; @@ -42,10 +42,10 @@ function OUT_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - model.ipar = this.prt; + this.model.ipar = new ScilabDouble(this.prt); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/OUT_f.pickle b/js/Sinks/OUT_f.pickle index 1ba039dd..318c53a1 100644 --- a/js/Sinks/OUT_f.pickle +++ b/js/Sinks/OUT_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'prt' +aS'model' p3 -atp4 -Rp5 +aS'prt' +p4 +atp5 +Rp6 .(dp0 S'model.in2' p1 diff --git a/js/Sinks/TOWS_c.js b/js/Sinks/TOWS_c.js index 67f4cf64..dea5b7ba 100644 --- a/js/Sinks/TOWS_c.js +++ b/js/Sinks/TOWS_c.js @@ -5,22 +5,22 @@ function TOWS_c() { this.nz = 128; this.varnam = "A"; this.herit = 0; - model = scicos_model(); - model.sim = list("tows_c",4); - model.in1 = [nu]; - model.in2 = -2; - model.intyp = -1; - model.out = []; - model.evtin = [1]; - model.evtout = []; - model.rpar = []; - model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("tows_c",4); + this.model.in1 = [nu]; + this.model.in2 = new ScilabDouble(-2); + this.model.intyp = new ScilabDouble(-1); + this.model.out = []; + this.model.evtin = [1]; + this.model.evtout = []; + this.model.rpar = []; + this.model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; gr_i = []; exprs = [[string(this.nz)],[string(this.varnam)],[string(this.herit)]]; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TOWS_c.prototype.details = function TOWS_c() { @@ -40,7 +40,7 @@ function TOWS_c() { this.herit = parseFloat(arguments[0]["herit"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.nz,this.varnam,this.herit,exprs] = scicos_getvalue("Set Xcos buffer block",["Size of buffer","Scilab variable name","Inherit (no:0, yes:1)"],list("vec",1,"str",1,"vec",1),exprs); @@ -59,16 +59,16 @@ function TOWS_c() { } execstr("if type("+this.varnam+") <> 17 | or(fieldnames("+this.varnam+") <> [\"values\"; \"time\"]) then"+" message([\"Protected variable name.\"; \"Please choose another variable name.\"]);"+" ok = %f;"+" end","errcatch"); if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([-1,-2],-1),list(),ones(1-this.herit,1),[]); + [model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],-1),list(),ones(1-this.herit,1),[]); if (this.herit==1) { - model.blocktype = "x"; + this.model.blocktype = new ScilabString("x"); } else { - model.blocktype = "d"; + this.model.blocktype = new ScilabString("d"); } - model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; + this.model.ipar = [[this.nz],[length(this.varnam)],[transpose(this.ascii[this.varnam-1])]]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/TOWS_c.pickle b/js/Sinks/TOWS_c.pickle index 3fd146ce..20e16678 100644 --- a/js/Sinks/TOWS_c.pickle +++ b/js/Sinks/TOWS_c.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'herit' p2 aS'nz' p3 -aS'herit' +aS'x' p4 -aS'ascii' +aS'model' p5 -aS'varnam' +aS'ascii' p6 -atp7 -Rp8 +aS'varnam' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Sinks/TRASH_f.js b/js/Sinks/TRASH_f.js index 19c2156b..3d8a402a 100644 --- a/js/Sinks/TRASH_f.js +++ b/js/Sinks/TRASH_f.js @@ -2,15 +2,15 @@ function TRASH_f() { TRASH_f.prototype.define = function TRASH_f() { in1 = -1; - model = scicos_model(); - model.sim = "trash"; - model.in1 = in1; - model.evtin = 1; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("trash"); + this.model.in1 = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = " "; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TRASH_f.prototype.details = function TRASH_f() { diff --git a/js/Sinks/TRASH_f.pickle b/js/Sinks/TRASH_f.pickle index e56faa0c..e5dde935 100644 --- a/js/Sinks/TRASH_f.pickle +++ b/js/Sinks/TRASH_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Sinks/WFILE_f.js b/js/Sinks/WFILE_f.js index 96bf2ea2..c09b1f9c 100644 --- a/js/Sinks/WFILE_f.js +++ b/js/Sinks/WFILE_f.js @@ -7,17 +7,17 @@ function WFILE_f() { fname = "foo"; lunit = 0; this.N = 2; - model = scicos_model(); - model.sim = "writef"; - model.in1 = this.in1; - model.evtin = 1; - model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; - model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]]]; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("writef"); + this.model.in1 = new ScilabDouble(this.in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + this.model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } WFILE_f.prototype.details = function WFILE_f() { @@ -45,8 +45,8 @@ function WFILE_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; lunit = dstate[2-1]; fname = exprs[2-1]; frmt = exprs[3-1]; @@ -89,13 +89,13 @@ function WFILE_f() { if (prod(size(dstate))!=(nin+1)*this.N+2) { dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } - model.in1 = nin; - model.dstate = dstate; - model.ipar = ipar; - model.dep_ut = [true,false]; + this.model.in1 = new ScilabDouble(nin); + this.model.dstate = dstate; + this.model.ipar = ipar; + this.model.dep_ut = [true,false]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/WFILE_f.pickle b/js/Sinks/WFILE_f.pickle index 7bc34bab..e42167dc 100644 --- a/js/Sinks/WFILE_f.pickle +++ b/js/Sinks/WFILE_f.pickle @@ -16,8 +16,10 @@ aS'frmt1' p7 aS'x' p8 -atp9 -Rp10 +aS'model' +p9 +atp10 +Rp11 .(dp0 S'model.dstate' p1 diff --git a/js/Sinks/WRITEAU_f.js b/js/Sinks/WRITEAU_f.js index d5302a86..529703df 100644 --- a/js/Sinks/WRITEAU_f.js +++ b/js/Sinks/WRITEAU_f.js @@ -8,17 +8,17 @@ function WRITEAU_f() { this.swap = 0; lunit = 0; this.N = 2; - model = scicos_model(); - model.sim = list("writeau",2); - model.in1 = in1; - model.evtin = 1; - model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("writeau",2); + this.model.in1 = new ScilabDouble(in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; exprs = [string(this.N),string(this.swap)]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } WRITEAU_f.prototype.details = function WRITEAU_f() { @@ -37,9 +37,9 @@ function WRITEAU_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; - dstate = model.dstate; + this.model = arg1.model; + ipar = this.model.ipar; + dstate = this.model.dstate; lunit = dstate[2-1]; while (true) { [ok,this.N,this.swap,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","WRITEAU_f")],[" "],["Write \'.au\' sound file on audio device"]],["Buffer Size","Swap Mode (0:No, 1:Yes)"],list("vec",1,"vec",1),exprs); @@ -65,12 +65,12 @@ function WRITEAU_f() { if (prod(size(dstate))!=(nin+1)*this.N+2) { dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } - model.in1 = 1; - model.dstate = dstate; - model.ipar = ipar; + this.model.in1 = new ScilabDouble(1); + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/WRITEAU_f.pickle b/js/Sinks/WRITEAU_f.pickle index 385fa47f..8829778b 100644 --- a/js/Sinks/WRITEAU_f.pickle +++ b/js/Sinks/WRITEAU_f.pickle @@ -4,16 +4,18 @@ p0 ((lp1 S'_str2code' p2 -aS'x' +aS'N' p3 aS'alreadyran' p4 -aS'swap' +aS'x' p5 -aS'N' +aS'model' p6 -atp7 -Rp8 +aS'swap' +p7 +atp8 +Rp9 .(dp0 S'model.dstate' p1 diff --git a/js/Sinks/WRITEC_f.js b/js/Sinks/WRITEC_f.js index b8be9fc4..1198b764 100644 --- a/js/Sinks/WRITEC_f.js +++ b/js/Sinks/WRITEC_f.js @@ -8,17 +8,17 @@ function WRITEC_f() { this.swap = 0; lunit = 0; this.N = 2; - model = scicos_model(); - model.sim = list("writec",2); - model.in1 = this.in1; - model.evtin = 1; - model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; - model.blocktype = "d"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("writec",2); + this.model.in1 = new ScilabDouble(this.in1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[this.N],[this.swap],[this._str2code[fname-1]]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [true,false]; exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N),string(this.swap)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } WRITEC_f.prototype.details = function WRITEC_f() { @@ -43,9 +43,9 @@ function WRITEC_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - ipar = model.ipar; - dstate = model.dstate; + this.model = arg1.model; + ipar = this.model.ipar; + dstate = this.model.dstate; lunit = dstate[2-1]; fname = exprs[2-1]; frmt = exprs[3-1]; @@ -92,12 +92,12 @@ function WRITEC_f() { if (prod(size(dstate))!=(nin+1)*this.N+2) { dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } - model.in1 = nin; - model.dstate = dstate; - model.ipar = ipar; + this.model.in1 = new ScilabDouble(nin); + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sinks/WRITEC_f.pickle b/js/Sinks/WRITEC_f.pickle index 17706b57..7a858bab 100644 --- a/js/Sinks/WRITEC_f.pickle +++ b/js/Sinks/WRITEC_f.pickle @@ -18,10 +18,12 @@ aS'swap' p8 aS'x' p9 -aS'alreadyran' +aS'model' p10 -atp11 -Rp12 +aS'alreadyran' +p11 +atp12 +Rp13 .(dp0 S'model.dstate' p1 diff --git a/js/Sources/CLKINV_f.js b/js/Sources/CLKINV_f.js index 15cccf2a..72b26ff8 100644 --- a/js/Sources/CLKINV_f.js +++ b/js/Sources/CLKINV_f.js @@ -2,16 +2,16 @@ function CLKINV_f() { CLKINV_f.prototype.define = function CLKINV_f() { this.prt = 1; - model = scicos_model(); - model.sim = "input"; - model.evtout = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("input"); + this.model.evtout = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = string(this.prt); gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new EventInBlock(this.x); } CLKINV_f.prototype.details = function CLKINV_f() { @@ -26,7 +26,7 @@ function CLKINV_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { @@ -38,12 +38,12 @@ function CLKINV_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong values for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - model.ipar = this.prt; - model.evtout = 1; - model.firing = -1; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/CLKINV_f.pickle b/js/Sources/CLKINV_f.pickle index 114fe3c1..bc5efd27 100644 --- a/js/Sources/CLKINV_f.pickle +++ b/js/Sources/CLKINV_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'prt' +aS'model' p3 -atp4 -Rp5 +aS'prt' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Sources/CLKIN_f.js b/js/Sources/CLKIN_f.js index 08373047..03f3c741 100644 --- a/js/Sources/CLKIN_f.js +++ b/js/Sources/CLKIN_f.js @@ -2,15 +2,15 @@ function CLKIN_f() { CLKIN_f.prototype.define = function CLKIN_f() { this.prt = 1; - model = scicos_model(); - model.sim = "input"; - model.evtout = 1; - model.ipar = this.prt; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("input"); + this.model.evtout = new ScilabDouble(1); + this.model.ipar = new ScilabDouble(this.prt); + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = string(this.prt); - this.x = standard_define([1,1],model,exprs," "); + this.x = standard_define([1,1],this.model,exprs," "); return new BasicBlock(this.x); } CLKIN_f.prototype.details = function CLKIN_f() { @@ -25,7 +25,7 @@ function CLKIN_f() { this.prt = parseFloat(arguments[0]["prt"]) this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { @@ -37,12 +37,12 @@ function CLKIN_f() { if (this.prt<=0) { message("Port number must be a positive integer"); } else { - model.ipar = this.prt; - model.evtout = 1; - model.firing = -1; + this.model.ipar = new ScilabDouble(this.prt); + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/CLKIN_f.pickle b/js/Sources/CLKIN_f.pickle index 39b30975..b7886c50 100644 --- a/js/Sources/CLKIN_f.pickle +++ b/js/Sources/CLKIN_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'prt' +aS'model' p3 -atp4 -Rp5 +aS'prt' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Sources/CLOCK_c.js b/js/Sources/CLOCK_c.js index 97df9d39..bb04a18a 100644 --- a/js/Sources/CLOCK_c.js +++ b/js/Sources/CLOCK_c.js @@ -66,10 +66,10 @@ function CLOCK_c() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs; - model = xx.model; - t0_old = model.firing; - dt_old = model.rpar[1-1]; - model_n = model; + this.model = xx.model; + t0_old = this.model.firing; + dt_old = this.model.rpar[1-1]; + model_n = this.model; while (true) { [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","CLOCK_c")],[" "],["Event clock generator"],[" "],[" Do not start if \'Initialisation Time\' is negative"],[" "]],["Period","Initialisation Time"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -81,9 +81,9 @@ function CLOCK_c() { } if (ok) { xx.graphics.exprs = this.exprs0; - model.rpar = [[this.dt],[this.t0]]; - model.firing = this.t0; - xx.model = model; + this.model.rpar = [[this.dt],[this.t0]]; + this.model.firing = new ScilabDouble(this.t0); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } diff --git a/js/Sources/CLOCK_c.pickle b/js/Sources/CLOCK_c.pickle index c0628324..1b13bb38 100644 --- a/js/Sources/CLOCK_c.pickle +++ b/js/Sources/CLOCK_c.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'dt' +aS'model' p3 -aS'exprs0' +aS'dt' p4 aS't0' p5 -atp6 -Rp7 +aS'exprs0' +p6 +atp7 +Rp8 .(dp0 S'diagram.objs[1-1]' p1 diff --git a/js/Sources/CLOCK_f.js b/js/Sources/CLOCK_f.js index 2f7509a5..c387dbca 100644 --- a/js/Sources/CLOCK_f.js +++ b/js/Sources/CLOCK_f.js @@ -66,10 +66,10 @@ function CLOCK_f() { newpar = list(); xx = arg1.model.rpar.objs[path-1]; exprs = xx.graphics.exprs; - model = xx.model; - t0_old = model.firing; - dt_old = model.rpar; - model_n = model; + this.model = xx.model; + t0_old = this.model.firing; + dt_old = this.model.rpar; + model_n = this.model; while (true) { [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue("Set Clock block parameters",["Period","Init time"],list("vec",1,"vec",1),exprs); if (!ok) { @@ -81,9 +81,9 @@ function CLOCK_f() { } if (ok) { xx.graphics.exprs = this.exprs0; - model.rpar = this.dt; - model.firing = this.t0; - xx.model = model; + this.model.rpar = new ScilabDouble(this.dt); + this.model.firing = new ScilabDouble(this.t0); + xx.model = this.model; arg1.model.rpar.objs[path-1] = xx; break; } diff --git a/js/Sources/CLOCK_f.pickle b/js/Sources/CLOCK_f.pickle index d1dda939..c7f5264f 100644 --- a/js/Sources/CLOCK_f.pickle +++ b/js/Sources/CLOCK_f.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'dt' +aS'model' p3 -aS'exprs0' +aS'dt' p4 aS't0' p5 -atp6 -Rp7 +aS'exprs0' +p6 +atp7 +Rp8 .(dp0 S'diagram.objs[1-1]' p1 diff --git a/js/Sources/CONST.js b/js/Sources/CONST.js index 34c1ca06..af405b98 100644 --- a/js/Sources/CONST.js +++ b/js/Sources/CONST.js @@ -2,16 +2,16 @@ function CONST() { CONST.prototype.define = function CONST() { this.C = 1; - model = scicos_model(); - model.sim = list("cstblk4",4); - model.in1 = []; - model.out = 1; - model.rpar = this.C; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk4",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.C); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(sci2exp(this.C)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONST.prototype.details = function CONST() { @@ -27,7 +27,7 @@ function CONST() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); if (!ok) { @@ -40,11 +40,11 @@ function CONST() { } else if (and(sz>1)) { message("C matrix is not supported, use CONST_m instead"); } else { - model.rpar = this.C.slice(); - model.out = nout; + this.model.rpar = this.C.slice(); + this.model.out = new ScilabDouble(nout); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/CONST.pickle b/js/Sources/CONST.pickle index 9e82cdd4..4fea4b94 100644 --- a/js/Sources/CONST.pickle +++ b/js/Sources/CONST.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'C' +aS'model' p3 -atp4 -Rp5 +aS'C' +p4 +atp5 +Rp6 .(dp0 S'sz' p1 diff --git a/js/Sources/CONST_f.js b/js/Sources/CONST_f.js index 900a953b..edc52303 100644 --- a/js/Sources/CONST_f.js +++ b/js/Sources/CONST_f.js @@ -2,16 +2,16 @@ function CONST_f() { CONST_f.prototype.define = function CONST_f() { this.C = 1; - model = scicos_model(); - model.sim = list("cstblk",1); - model.in1 = []; - model.out = 1; - model.rpar = this.C; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk",1); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.C); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = strcat(sci2exp(this.C)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONST_f.prototype.details = function CONST_f() { @@ -27,7 +27,7 @@ function CONST_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,exprs] = scicos_getvalue(["Set Contant Block"],"Constant",list("vec",-1),exprs); if (!ok) { @@ -37,11 +37,11 @@ function CONST_f() { if (nout==0) { message("C must have at least one element"); } else { - model.rpar = this.C.slice(); - model.out = nout; + this.model.rpar = this.C.slice(); + this.model.out = new ScilabDouble(nout); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/CONST_f.pickle b/js/Sources/CONST_f.pickle index ab138cac..503aafba 100644 --- a/js/Sources/CONST_f.pickle +++ b/js/Sources/CONST_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'C' +aS'model' p3 -atp4 -Rp5 +aS'C' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Sources/CONST_m.js b/js/Sources/CONST_m.js index 2c187bf2..5fea4537 100644 --- a/js/Sources/CONST_m.js +++ b/js/Sources/CONST_m.js @@ -2,19 +2,19 @@ function CONST_m() { CONST_m.prototype.define = function CONST_m() { this.C = [1]; - model = scicos_model(); - model.sim = list("cstblk4",4); - model.in1 = []; - model.out = size(this.C,1); - model.in2 = []; - model.out2 = size(this.C,2); - model.rpar = this.C; - model.opar = list(); - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk4",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(size(this.C,1)); + this.model.in2 = []; + this.model.out2 = new ScilabDouble(size(this.C,2)); + this.model.rpar = this.C; + this.model.opar = list(); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = sci2exp(this.C); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } CONST_m.prototype.details = function CONST_m() { @@ -30,7 +30,7 @@ function CONST_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONST_m")],[" "],["Constant value generator"],[" "]],"Constant Value",list("vec",-1),exprs); if (!ok) { @@ -40,8 +40,8 @@ function CONST_m() { if (find(nout==0)!=[]) { block_parameter_error(msprintf("Wrong size for \'%s\' parameter","Constant Value"),"Constant value must have at least one element."); } else { - model.sim = list("cstblk4_m",4); - model.opar = list(this.C); + this.model.sim = list("cstblk4_m",4); + this.model.opar = list(this.C); if ((this.type[this.C-1]==1)) { if (isreal(this.C)) { ot = 1; @@ -65,11 +65,11 @@ function CONST_m() { ok = false; } if (ok) { - model.rpar = []; - [model,graphics,ok] = set_io(model,graphics,list(),list(nout,ot),[],[]); + this.model.rpar = []; + [model,graphics,ok] = set_io(this.model,graphics,list(),list(nout,ot),[],[]); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/CONST_m.pickle b/js/Sources/CONST_m.pickle index 43d820e8..20600687 100644 --- a/js/Sources/CONST_m.pickle +++ b/js/Sources/CONST_m.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'C' +aS'model' p3 aS'type' p4 -atp5 -Rp6 +aS'C' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/Sources/CURVE_c.pickle b/js/Sources/CURVE_c.pickle index cf6add0f..a510c446 100644 --- a/js/Sources/CURVE_c.pickle +++ b/js/Sources/CURVE_c.pickle @@ -4,30 +4,32 @@ p0 ((lp1 S'rparin' p2 -aS'yy' +aS'curwin' p3 -aS'xx' +aS'yy' p4 -aS'ixy' +aS'xx' p5 -aS'PeriodicOption' +aS'ixy' p6 -aS'argn' +aS'graf' p7 -aS'xy' +aS'argn' p8 -aS'x' +aS'xy' p9 -aS'curwin' +aS'x' p10 -aS'Method' +aS'model' p11 -aS'graf' +aS'Method' p12 -aS'iparin' +aS'PeriodicOption' p13 -atp14 -Rp15 +aS'iparin' +p14 +atp15 +Rp16 .(dp0 S'mean4' p1 diff --git a/js/Sources/CURV_f.js b/js/Sources/CURV_f.js index f3d042a8..67f997cb 100644 --- a/js/Sources/CURV_f.js +++ b/js/Sources/CURV_f.js @@ -7,16 +7,16 @@ function CURV_f() { axisdata = [[2],[10],[2],[10]]; ipar = [[size(xx,1)],[axisdata.slice()]]; rpar = [[xx],[yy],[rect.slice()]]; - model = scicos_model(); - model.sim = "intplt"; - model.in1 = []; - model.out = 1; - model.rpar = [[xx],[yy],[rect.slice()]]; - model.ipar = [[size(xx,1)],[axisdata.slice()]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("intplt"); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = [[xx],[yy],[rect.slice()]]; + this.model.ipar = [[size(xx,1)],[axisdata.slice()]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } CURV_f.prototype.details = function CURV_f() { @@ -29,10 +29,10 @@ function CURV_f() { } CURV_f.prototype.set = function CURV_f() { this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; - rpar = model.rpar; - ipar = model.ipar; + rpar = this.model.rpar; + ipar = this.model.ipar; n = ipar[1-1]; xx = rpar.slice(1-1,n); yy = rpar.slice(n+1-1,2*n); @@ -53,14 +53,14 @@ function CURV_f() { ok = false; } if (ok) { - model.sim = "intplt"; - model.firing = []; + this.model.sim = new ScilabString("intplt"); + this.model.firing = []; rect = gc[1-1]; - model.rpar = [[xx.slice()],[yy.slice()],[rect.slice()]]; + this.model.rpar = [[xx.slice()],[yy.slice()],[rect.slice()]]; axisdata = gc[2-1]; - model.ipar = [[size(xx,"*")],[axisdata.slice()]]; + this.model.ipar = [[size(xx,"*")],[axisdata.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/CURV_f.pickle b/js/Sources/CURV_f.pickle index 9d4622db..12a93f4d 100644 --- a/js/Sources/CURV_f.pickle +++ b/js/Sources/CURV_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/Sources/Counter.js b/js/Sources/Counter.js index 5ef219d4..4053bfb2 100644 --- a/js/Sources/Counter.js +++ b/js/Sources/Counter.js @@ -4,18 +4,18 @@ function Counter() { this.minim = 0; this.maxim = 2; this.rule = 1; - model = scicos_model(); - model.sim = list("counter",4); - model.evtin = 1; - model.out = 1; - model.out2 = 1; - model.dstate = 0; - model.ipar = [[this.rule],[this.maxim],[this.minim]]; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("counter",4); + this.model.evtin = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.ipar = [[this.rule],[this.maxim],[this.minim]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [[string(this.minim)],[string(this.maxim)],[string(this.rule)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } Counter.prototype.details = function Counter() { @@ -36,7 +36,7 @@ function Counter() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.minim,this.maxim,this.rule,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","Counter")],[" "],["Integer counter generator"],[" "]],["Minimum","Maximum","Rule (1:Increment, 2:Decrement)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -50,10 +50,10 @@ function Counter() { block_parameter_error(msprintf("Wrong value for \'Rule\' parameter: %d",this.rule),msprintf("Must be in the interval %s.","[1,2]")); } else { graphics.exprs = exprs; - model.dstate = 0; - model.ipar = [[this.rule],[this.maxim],[this.minim]]; + this.model.dstate = new ScilabDouble(0); + this.model.ipar = [[this.rule],[this.maxim],[this.minim]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/Counter.pickle b/js/Sources/Counter.pickle index 52822486..b3bc225a 100644 --- a/js/Sources/Counter.pickle +++ b/js/Sources/Counter.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'maxim' +aS'model' p3 -aS'rule' +aS'maxim' p4 -aS'minim' +aS'rule' p5 -atp6 -Rp7 +aS'minim' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/Sources/FROMWSB.js b/js/Sources/FROMWSB.js index 3645aad4..e12c0852 100644 --- a/js/Sources/FROMWSB.js +++ b/js/Sources/FROMWSB.js @@ -6,9 +6,9 @@ function FROMWSB() { scs_m_1.objs[2-1] = scicos_link(xx=[[295.37067],[295.37067],[233.23733],[233.23733],[295.37067],[295.37067]],yy=[[255.86971],[223.45067],[223.45067],[337.85067],[337.85067],[307.29829]],id="drawlink",thick=[0,0],ct=[5,-1],from=[1,1,0],to=[1,1,1]); scs_m_1.objs[3-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[358.9421,271.584],sz=[20,20],flip=true,theta=0,exprs="1",pin=4,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=-2,intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[4-1] = scicos_link(xx=[[338.9421],[358.9421]],yy=[[281.584],[281.584]],id="drawlink",thick=[0,0],ct=[1,1],from=[1,1,0],to=[3,1,1]); - model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=-2,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); + this.model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=-2,outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); gr_i = []; - this.x = standard_define([5,2],model,[],gr_i); + this.x = standard_define([5,2],this.model,[],gr_i); return new BasicBlock(this.x); } FROMWSB.prototype.details = function FROMWSB() { @@ -41,40 +41,40 @@ function FROMWSB() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (!this.isequalbitwise[this.xxn-1][xx-1]) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)||or(this.model.in2!=model_n.in2)||or(this.model.out2!=model_n.out2)||or(this.model.outtyp!=model_n.outtyp)||or(this.model.intyp!=model_n.intyp)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; diff --git a/js/Sources/FROMWSB.pickle b/js/Sources/FROMWSB.pickle index 25f3b09a..26da62eb 100644 --- a/js/Sources/FROMWSB.pickle +++ b/js/Sources/FROMWSB.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'xxn' +aS'model' p3 -aS'isequalbitwise' +aS'xxn' p4 -atp5 -Rp6 +aS'isequalbitwise' +p5 +atp6 +Rp7 .(dp0 S'ppath' p1 diff --git a/js/Sources/FROMWS_c.js b/js/Sources/FROMWS_c.js index 00630b65..4b058495 100644 --- a/js/Sources/FROMWS_c.js +++ b/js/Sources/FROMWS_c.js @@ -5,20 +5,20 @@ function FROMWS_c() { this.Method = 1; this.ZC = 1; this.OutEnd = 0; - model = scicos_model(); - model.sim = list("fromws_c",4); - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; - model.evtin = [1]; - model.evtout = [1]; - model.firing = [0]; - model.blocktype = "d"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("fromws_c",4); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; + this.model.evtin = [1]; + this.model.evtout = [1]; + this.model.firing = [0]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,true]; gr_i = []; exprs = [[string(this.varnam)],[string(this.Method)],[string(this.ZC)],[string(this.OutEnd)]]; - this.x = standard_define([3.5,2],model,exprs,gr_i); + this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } FROMWS_c.prototype.details = function FROMWS_c() { @@ -41,7 +41,7 @@ function FROMWS_c() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.varnam,this.Method,this.ZC,this.OutEnd,exprs] = scicos_getvalue("Set From_Workspace block parameters",["Variable name","Interpolation Method","Enable zero crossing(0:No, 1:Yes)?","Output at end(0:Zero, 1:Hold, 2:Repeat)"],list("str",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -66,12 +66,12 @@ function FROMWS_c() { ok = false; } if (ok) { - model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; - [model,graphics,ok] = set_io(model,graphics,list(),list([-1,-2],-1),1,1); + this.model.ipar = [[length(this.varnam)],[this._str2code[this.varnam-1]],[this.Method],[this.ZC],[this.OutEnd]]; + [model,graphics,ok] = set_io(this.model,graphics,list(),list([-1,-2],-1),1,1); if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/FROMWS_c.pickle b/js/Sources/FROMWS_c.pickle index 1da2a6de..ea260d7b 100644 --- a/js/Sources/FROMWS_c.pickle +++ b/js/Sources/FROMWS_c.pickle @@ -10,12 +10,14 @@ aS'OutEnd' p4 aS'x' p5 -aS'Method' +aS'model' p6 -aS'varnam' +aS'Method' p7 -atp8 -Rp9 +aS'varnam' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Sources/GENSIN_f.js b/js/Sources/GENSIN_f.js index 93ce008b..b602ea6e 100644 --- a/js/Sources/GENSIN_f.js +++ b/js/Sources/GENSIN_f.js @@ -2,18 +2,18 @@ function GENSIN_f() { GENSIN_f.prototype.define = function GENSIN_f() { rpar = [[1],[1],[0]]; - model = scicos_model(); - model.sim = "gensin"; - model.in1 = []; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.rpar = [[1],[1],[0]]; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gensin"); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.rpar = [[1],[1],[0]]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = [[string(rpar[1-1])],[string(rpar[2-1])],[string(rpar[3-1])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GENSIN_f.prototype.details = function GENSIN_f() { @@ -34,7 +34,7 @@ function GENSIN_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.M,this.F,this.P,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","GENSIN_f")],[" "],["Sine wave generator"],[" "]],["Magnitude","Frequency (rad/s)","Phase (rad)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -45,13 +45,13 @@ function GENSIN_f() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[],1,[],[]); - model.rpar = [[this.M],[this.F],[this.P]]; - model.out2 = 1; - model.outtyp = 1; + [model,graphics,ok] = check_io(this.model,graphics,[],1,[],[]); + this.model.rpar = [[this.M],[this.F],[this.P]]; + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/GENSIN_f.pickle b/js/Sources/GENSIN_f.pickle index 8e00c76e..4176a2e1 100644 --- a/js/Sources/GENSIN_f.pickle +++ b/js/Sources/GENSIN_f.pickle @@ -4,14 +4,16 @@ p0 ((lp1 S'x' p2 -aS'M' +aS'model' p3 -aS'P' +aS'M' p4 -aS'F' +aS'P' p5 -atp6 -Rp7 +aS'F' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Sources/GENSQR_f.js b/js/Sources/GENSQR_f.js index d4dbe567..3cffcef1 100644 --- a/js/Sources/GENSQR_f.js +++ b/js/Sources/GENSQR_f.js @@ -2,18 +2,18 @@ function GENSQR_f() { GENSQR_f.prototype.define = function GENSQR_f() { this.Amplitude = 1; - model = scicos_model(); - model.sim = "gensqr"; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.evtin = 1; - model.dstate = this.Amplitude; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gensqr"); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.Amplitude); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = string(this.Amplitude); gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GENSQR_f.prototype.details = function GENSQR_f() { @@ -30,7 +30,7 @@ function GENSQR_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[2-1]; } @@ -40,11 +40,11 @@ function GENSQR_f() { break; } graphics.exprs = exprs; - model.dstate = this.Amplitude; - model.out2 = 1; - model.outtyp = 1; + this.model.dstate = new ScilabDouble(this.Amplitude); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Sources/GENSQR_f.pickle b/js/Sources/GENSQR_f.pickle index d6df150f..b43e515b 100644 --- a/js/Sources/GENSQR_f.pickle +++ b/js/Sources/GENSQR_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'Amplitude' +aS'model' p3 -atp4 -Rp5 +aS'Amplitude' +p4 +atp5 +Rp6 .(dp0 S'model.sim' p1 diff --git a/js/Sources/GEN_SQR.js b/js/Sources/GEN_SQR.js index d6a3d32a..509cf149 100644 --- a/js/Sources/GEN_SQR.js +++ b/js/Sources/GEN_SQR.js @@ -18,36 +18,36 @@ function GEN_SQR() { scs_m_1.objs[14-1] = scicos_link(xx=[[164.84097],[184.40238]],yy=[[289.42294],[288.75198]],id="drawlink",thick=[0,0],ct=[1,1],from=[4,1,0],to=[13,1,1]); scs_m_1.objs[15-1] = scicos_block(gui="SampleCLK",graphics=scicos_graphics(orig=[18.313686,403.57431],sz=[60,40],flip=true,theta=0,exprs=[["F/2"],["0"]],pin=[],pout=[],pein=[],peout=16,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="sampleclk",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=[[1/2],[0]],ipar=[],opar=list(),blocktype="d",firing=-1,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[16-1] = scicos_link(xx=[[48.313686],[48.229901]],yy=[[403.57431],[385.21998]],id="drawlink",thick=[0,0],ct=[5,-1],from=[15,1,0],to=[1,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.odstate = list(); - model.rpar = scs_m_1; - model.ipar = 1; - model.opar = list(); - model.blocktype = "h"; - model.firing = []; - model.dep_ut = [false,false]; - model.label = ""; - model.nzcross = 0; - model.nmode = 0; - model.equations = list(); + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.odstate = list(); + this.model.rpar = new ScilabDouble(scs_m_1); + this.model.ipar = new ScilabDouble(1); + this.model.opar = list(); + this.model.blocktype = new ScilabString("h"); + this.model.firing = []; + this.model.dep_ut = [false,false]; + this.model.label = new ScilabString(""); + 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 = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GEN_SQR.prototype.details = function GEN_SQR() { diff --git a/js/Sources/GEN_SQR.pickle b/js/Sources/GEN_SQR.pickle index fe10ccba..6d4c3f8b 100644 --- a/js/Sources/GEN_SQR.pickle +++ b/js/Sources/GEN_SQR.pickle @@ -14,8 +14,10 @@ aS'scicos_context.Amin' p6 aS'scicos_context.F' p7 -atp8 -Rp9 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'model.odstate' p1 diff --git a/js/Sources/Ground_g.js b/js/Sources/Ground_g.js index 686c27a7..37887703 100644 --- a/js/Sources/Ground_g.js +++ b/js/Sources/Ground_g.js @@ -2,20 +2,20 @@ function Ground_g() { Ground_g.prototype.define = function Ground_g() { C = [0]; - model = scicos_model(); - model.sim = list("cstblk4_m",4); - model.in1 = []; - model.out = 1; - model.in2 = []; - model.out2 = 1; - model.outtyp = -1; - model.rpar = []; - model.opar = list(C); - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("cstblk4_m",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.in2 = []; + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(-1); + this.model.rpar = []; + this.model.opar = list(C); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } Ground_g.prototype.details = function Ground_g() { diff --git a/js/Sources/Ground_g.pickle b/js/Sources/Ground_g.pickle index eea3cae8..8d528a45 100644 --- a/js/Sources/Ground_g.pickle +++ b/js/Sources/Ground_g.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Sources/INIMPL_f.js b/js/Sources/INIMPL_f.js index 9df4edbe..10b32d3a 100644 --- a/js/Sources/INIMPL_f.js +++ b/js/Sources/INIMPL_f.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Sources/INIMPL_f.sci" */ function INIMPL_f() { INIMPL_f.prototype.define = function INIMPL_f() { - model = scicos_model(); - model.sim = "inimpl"; - model.out = [-1]; - model.out2 = [1]; - model.ipar = [1]; - model.dep_ut = [false,false]; - model.blocktype = "c"; + this.model = scicos_model(); + this.model.sim = new ScilabString("inimpl"); + this.model.out = [-1]; + this.model.out2 = [1]; + this.model.ipar = [1]; + this.model.dep_ut = [false,false]; + this.model.blocktype = new ScilabString("c"); mo = modelica(); mo.model = "PORT"; mo.outputs = "n"; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); this.prt = 1; exprs = "1"; gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); this.x.graphics.out_implicit = ["I"]; return new ImplicitInBlock(this.x); } @@ -32,7 +32,7 @@ function INIMPL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==2) { exprs = exprs[1-1]; } @@ -45,14 +45,14 @@ function INIMPL_f() { if (this.prt<=0) { block_parameter_error(msprintf("Wrong value for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { - if (model.ipar!=this.prt) { + if (this.model.ipar!=this.prt) { needcompile = 4; y = needcompile; } - model.ipar = this.prt; + this.model.ipar = new ScilabDouble(this.prt); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/INIMPL_f.pickle b/js/Sources/INIMPL_f.pickle index 5b3558e6..a715bfa6 100644 --- a/js/Sources/INIMPL_f.pickle +++ b/js/Sources/INIMPL_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'prt' +aS'model' p3 -atp4 -Rp5 +aS'prt' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/js/Sources/IN_f.js b/js/Sources/IN_f.js index 35abf0bb..d3a1e578 100644 --- a/js/Sources/IN_f.js +++ b/js/Sources/IN_f.js @@ -2,17 +2,17 @@ function IN_f() { IN_f.prototype.define = function IN_f() { prt = 1; - model = scicos_model(); - model.sim = "input"; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.ipar = prt; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("input"); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.ipar = new ScilabDouble(prt); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = sci2exp(prt); gr_i = []; - this.x = standard_define([1,1],model,exprs,gr_i); + this.x = standard_define([1,1],this.model,exprs,gr_i); return new ExplicitInBlock(this.x); } IN_f.prototype.details = function IN_f() { @@ -26,7 +26,7 @@ function IN_f() { IN_f.prototype.set = function IN_f() { this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; if (size(exprs,"*")==2) { exprs = exprs[1-1]; @@ -47,18 +47,18 @@ function IN_f() { } else if (((ot<1||ot>9)&&(ot!=-1))) { message(_("Outport type must be a number between 1 and 9, or -1 for inheritance.")); } else { - if (model.ipar!=prt) { + if (this.model.ipar!=prt) { needcompile = 4; y = needcompile; } - model.ipar = prt; - model.firing = []; - model.out = otsz[1-1]; - model.out2 = otsz[2-1]; - model.outtyp = ot; + this.model.ipar = new ScilabDouble(prt); + this.model.firing = []; + this.model.out = new ScilabDouble(otsz[1-1]); + this.model.out2 = new ScilabDouble(otsz[2-1]); + this.model.outtyp = new ScilabDouble(ot); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/IN_f.pickle b/js/Sources/IN_f.pickle index 9027cd73..4bfdc5a8 100644 --- a/js/Sources/IN_f.pickle +++ b/js/Sources/IN_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/Sources/Modulo_Count.js b/js/Sources/Modulo_Count.js index d65b6931..fa1eb183 100644 --- a/js/Sources/Modulo_Count.js +++ b/js/Sources/Modulo_Count.js @@ -3,17 +3,17 @@ function Modulo_Count() { Modulo_Count.prototype.define = function Modulo_Count() { this.ini_c = 0; this.base = 3; - model = scicos_model(); - model.sim = list("modulo_count",4); - model.evtin = 1; - model.out = 1; - model.dstate = this.ini_c; - model.ipar = this.base; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("modulo_count",4); + this.model.evtin = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(this.ini_c); + this.model.ipar = new ScilabDouble(this.base); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [[string(this.ini_c)],[string(this.base)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } Modulo_Count.prototype.details = function Modulo_Count() { @@ -32,7 +32,7 @@ function Modulo_Count() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.ini_c,this.base,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","Modulo_Count")],[" "],["Modulo counter (0 to N counter)"],[" "]],["Initial State (zero or positive number)","Upper Limit (positive number)"],list("vec",1,"vec",1),exprs); this.ini_c = int(this.ini_c); @@ -46,10 +46,10 @@ function Modulo_Count() { block_parameter_error(msprintf("Wrong values for \'Upper Limit\' parameter: %d.",this.base),"Strictly positive integer expected."); } else { graphics.exprs = exprs; - model.ipar = this.base; - model.dstate = this.ini_c; + this.model.ipar = new ScilabDouble(this.base); + this.model.dstate = new ScilabDouble(this.ini_c); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/Modulo_Count.pickle b/js/Sources/Modulo_Count.pickle index 11d19748..d2532ce2 100644 --- a/js/Sources/Modulo_Count.pickle +++ b/js/Sources/Modulo_Count.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'base' +aS'model' p3 -aS'ini_c' +aS'base' p4 -atp5 -Rp6 +aS'ini_c' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Sources/PULSE_SC.js b/js/Sources/PULSE_SC.js index 496a0a2d..3823707f 100644 --- a/js/Sources/PULSE_SC.js +++ b/js/Sources/PULSE_SC.js @@ -13,36 +13,36 @@ function PULSE_SC() { scs_m_1.objs[9-1] = scicos_link(xx=[[112.34974],[112.34974],[119.33985],[119.33985]],yy=[[274.21741],[248.21372],[248.21372],[231.80809]],id="drawlink",thick=[0,0],ct=[5,-1],from=[6,1,0],to=[3,1,1]); scs_m_1.objs[10-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[174.57795,196.09381],sz=[20,20],flip=true,theta=0,exprs="1",pin=11,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=-2,intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[11-1] = scicos_link(xx=[[154.57795],[174.57795]],yy=[[206.09381],[206.09381]],id="drawlink",thick=[0,0],ct=[1,1],from=[3,1,0],to=[10,1,1]); - model = scicos_model(); - model.sim = "csuper"; - model.in1 = []; - model.in2 = []; - model.intyp = 1; - model.out = -1; - model.out2 = -2; - model.outtyp = -1; - model.evtin = []; - model.evtout = []; - model.state = []; - model.dstate = []; - model.odstate = list(); - model.rpar = scs_m_1; - model.ipar = 1; - model.opar = list(); - model.blocktype = "h"; - model.firing = []; - model.dep_ut = [false,false]; - model.label = ""; - model.nzcross = 0; - model.nmode = 0; - model.equations = list(); + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = new ScilabDouble(1); + this.model.out = new ScilabDouble(-1); + this.model.out2 = new ScilabDouble(-2); + this.model.outtyp = new ScilabDouble(-1); + this.model.evtin = []; + this.model.evtout = []; + this.model.state = []; + this.model.dstate = []; + this.model.odstate = list(); + this.model.rpar = new ScilabDouble(scs_m_1); + this.model.ipar = new ScilabDouble(1); + this.model.opar = list(); + this.model.blocktype = new ScilabString("h"); + this.model.firing = []; + this.model.dep_ut = [false,false]; + this.model.label = new ScilabString(""); + 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 = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } PULSE_SC.prototype.details = function PULSE_SC() { diff --git a/js/Sources/PULSE_SC.pickle b/js/Sources/PULSE_SC.pickle index cc8d499f..c2906a0a 100644 --- a/js/Sources/PULSE_SC.pickle +++ b/js/Sources/PULSE_SC.pickle @@ -8,14 +8,16 @@ aS'scicos_context.W' p3 aS'x' p4 -aS'scicos_context.A' +aS'model' p5 -aS'scicos_context.F' +aS'scicos_context.A' p6 -aS'scicos_context.E' +aS'scicos_context.F' p7 -atp8 -Rp9 +aS'scicos_context.E' +p8 +atp9 +Rp10 .(dp0 S'model.odstate' p1 diff --git a/js/Sources/RAMP.js b/js/Sources/RAMP.js index f34a816a..e3ad460e 100644 --- a/js/Sources/RAMP.js +++ b/js/Sources/RAMP.js @@ -5,18 +5,18 @@ function RAMP() { this.iout = 0; this.stt = 0; rpar = [[this.slope],[this.stt],[this.iout]]; - model = scicos_model(); - model.sim = list("ramp",4); - model.in1 = []; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.nmode = 1; - model.nzcross = 1; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("ramp",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); + this.model.dep_ut = [false,true]; exprs = [string(rpar)]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RAMP.prototype.details = function RAMP() { @@ -37,7 +37,7 @@ function RAMP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.slope,this.stt,this.iout,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","RAMP")],[" "],["Ramp function"],[" "]],["Slope","Start Time","Initial Value"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -46,10 +46,10 @@ function RAMP() { if (this.stt<0) { block_parameter_error(msprintf("Wrong value for \'Start Time\' parameter: %e.",this.stt),"Null or positive integer expected."); } else { - model.rpar = [[this.slope],[this.stt],[this.iout]]; + this.model.rpar = [[this.slope],[this.stt],[this.iout]]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/RAMP.pickle b/js/Sources/RAMP.pickle index b4c9f675..5efd46d0 100644 --- a/js/Sources/RAMP.pickle +++ b/js/Sources/RAMP.pickle @@ -6,12 +6,14 @@ S'slope' p2 aS'x' p3 -aS'stt' +aS'model' p4 aS'iout' p5 -atp6 -Rp7 +aS'stt' +p6 +atp7 +Rp8 .(dp0 S'slope' p1 diff --git a/js/Sources/RAND_f.js b/js/Sources/RAND_f.js index fb90a1e8..af0850f7 100644 --- a/js/Sources/RAND_f.js +++ b/js/Sources/RAND_f.js @@ -6,18 +6,18 @@ function RAND_f() { dt = 0; out = 1; this.flag = 0; - model = scicos_model(); - model.sim = "rndblk"; - model.out = out; - model.evtin = 1; - model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; - model.rpar = [[this.a.slice()],[this.b.slice()]]; - model.ipar = this.flag; - model.blocktype = "d"; - model.dep_ut = [false,false]; - exprs = [[string(this.flag)],[sci2exp(this.a.slice())],[sci2exp(this.b.slice())],[string(model.dstate[1-1])]]; + this.model = scicos_model(); + this.model.sim = new ScilabString("rndblk"); + this.model.out = new ScilabDouble(out); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; + this.model.rpar = [[this.a.slice()],[this.b.slice()]]; + this.model.ipar = new ScilabDouble(this.flag); + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; + exprs = [[string(this.flag)],[sci2exp(this.a.slice())],[sci2exp(this.b.slice())],[string(this.model.dstate[1-1])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RAND_f.prototype.details = function RAND_f() { @@ -40,12 +40,12 @@ function RAND_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==5) { exprs = exprs.slice(1-1,3); } if (size(exprs,"*")==3) { - exprs = [[exprs],[string(model.dstate[1-1])]]; + exprs = [[exprs],[string(this.model.dstate[1-1])]]; } while (true) { [ok,this.flag,this.a,this.b,this.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 vector with equal sizes"],["seed is the seed of random number generator (integer<2**31)"]],["flag","A","B","seed"],list("vec",1,"vec",-1,"vec","size(%2,\'*\')","vec",1),exprs); @@ -57,12 +57,12 @@ function RAND_f() { } else { nout = size(this.a,"*"); graphics.exprs = exprs; - model.out = nout; - model.ipar = this.flag; - model.rpar = [[this.a.slice()],[this.b.slice()]]; - model.dstate = [[this.seed_c],[0*this.a.slice()]]; + this.model.out = new ScilabDouble(nout); + this.model.ipar = new ScilabDouble(this.flag); + this.model.rpar = [[this.a.slice()],[this.b.slice()]]; + this.model.dstate = [[this.seed_c],[0*this.a.slice()]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/RAND_f.pickle b/js/Sources/RAND_f.pickle index 7adc7fdb..984969db 100644 --- a/js/Sources/RAND_f.pickle +++ b/js/Sources/RAND_f.pickle @@ -4,16 +4,18 @@ p0 ((lp1 S'a' p2 -aS'x' +aS'b' p3 -aS'flag' +aS'seed_c' p4 -aS'b' +aS'flag' p5 -aS'seed_c' +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'model.dstate' p1 diff --git a/js/Sources/RAND_m.js b/js/Sources/RAND_m.js index f602ae68..d8fc327c 100644 --- a/js/Sources/RAND_m.js +++ b/js/Sources/RAND_m.js @@ -7,26 +7,26 @@ function RAND_m() { this.flag = 0; function_name = "rndblk_m"; funtyp = 4; - model = scicos_model(); - model.sim = list(function_name,funtyp); - model.in1 = []; - 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*this.a.slice()]]; - model.rpar = [this.a.slice(),this.b.slice()]; - model.ipar = this.flag; - model.blocktype = "d"; - model.firing = []; - model.dep_ut = [false,false]; - exprs = [[sci2exp(1)],[string(this.flag)],[sci2exp([this.a])],[sci2exp([this.b])],[sci2exp([model.dstate[1-1],int(rand()*(10^7-1))])]]; + this.model = scicos_model(); + this.model.sim = list(function_name,funtyp); + this.model.in1 = []; + this.model.in2 = []; + this.model.intyp = []; + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = []; + this.model.state = []; + this.model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; + this.model.rpar = [this.a.slice(),this.b.slice()]; + this.model.ipar = new ScilabDouble(this.flag); + this.model.blocktype = new ScilabString("d"); + this.model.firing = []; + this.model.dep_ut = [false,false]; + exprs = [[sci2exp(1)],[string(this.flag)],[sci2exp([this.a])],[sci2exp([this.b])],[sci2exp([this.model.dstate[1-1],int(rand()*(10^7-1))])]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RAND_m.prototype.details = function RAND_m() { @@ -51,7 +51,7 @@ function RAND_m() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; if (size(exprs,"*")==14) { exprs[9-1] = []; } @@ -66,26 +66,26 @@ function RAND_m() { out = size(this.a); if (this.typ==1) { function_name = "rndblk_m"; - model.rpar = [[real(this.a.slice())],[real(this.b.slice())]]; - model.dstate = [[this.seed_c[1-1]],[0*real(this.a.slice())]]; + this.model.rpar = [[real(this.a.slice())],[real(this.b.slice())]]; + this.model.dstate = [[this.seed_c[1-1]],[0*real(this.a.slice())]]; ot = 1; } else if (this.typ==2) { function_name = "rndblkz_m"; ot = 2; - model.rpar = [[real(this.a.slice())],[imag(this.a.slice())],[real(this.b.slice())],[imag(this.b.slice())]]; - model.dstate = [[this.seed_c.slice()],[0*[[real(this.a.slice())],[imag(this.a.slice())]]]]; + this.model.rpar = [[real(this.a.slice())],[imag(this.a.slice())],[real(this.b.slice())],[imag(this.b.slice())]]; + this.model.dstate = [[this.seed_c.slice()],[0*[[real(this.a.slice())],[imag(this.a.slice())]]]]; } else { message("Datatype is not supported"); ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list([],[]),list(out,ot),1,[]); + [model,graphics,ok] = set_io(this.model,graphics,list([],[]),list(out,ot),1,[]); if (ok) { - model.sim = list(function_name,4); + this.model.sim = list(function_name,4); graphics.exprs = exprs; - model.ipar = this.flag; + this.model.ipar = new ScilabDouble(this.flag); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/RAND_m.pickle b/js/Sources/RAND_m.pickle index 99914cfd..0edfeeda 100644 --- a/js/Sources/RAND_m.pickle +++ b/js/Sources/RAND_m.pickle @@ -12,10 +12,12 @@ aS'flag' p5 aS'x' p6 -aS'typ' +aS'model' p7 -atp8 -Rp9 +aS'typ' +p8 +atp9 +Rp10 .(dp0 S'model.dstate' p1 diff --git a/js/Sources/READAU_f.js b/js/Sources/READAU_f.js index e808579b..9a3996f2 100644 --- a/js/Sources/READAU_f.js +++ b/js/Sources/READAU_f.js @@ -12,17 +12,17 @@ function READAU_f() { outmask = 1; ievt = 0; nout = size(outmask,"*"); - model = scicos_model(); - model.sim = list("readau",2); - model.out = nout; - model.evtin = 1; - model.dstate = [[1],[1],[lunit],[zeros(this.N*M,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[M],[this.swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("readau",2); + this.model.out = new ScilabDouble(nout); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = [[1],[1],[lunit],[zeros(this.N*M,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[M],[this.swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[fname],[string(this.N)],[string(this.swap)]]; gr_i = []; - this.x = standard_define([5,2],model,exprs,gr_i); + this.x = standard_define([5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } READAU_f.prototype.details = function READAU_f() { @@ -43,10 +43,10 @@ function READAU_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - out = model.out; - dstate = model.dstate; - ipar = model.ipar; + this.model = arg1.model; + out = this.model.out; + dstate = this.model.dstate; + ipar = this.model.ipar; imask = 9+ipar[1-1]; tmask = ipar[imask-1]; lunit = dstate[3-1]; @@ -74,18 +74,18 @@ function READAU_f() { } else if (this.swap!=0&&this.swap!=1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Swap Mode",this.swap),msprintf("Must be in the interval %s.","[0, 1]")); } else { - [model,graphics,ok] = check_io(model,graphics,[],1,1,[]); + [model,graphics,ok] = check_io(this.model,graphics,[],1,1,[]); frmt1 = part(frmt1,1,3); if (ok) { ipar = [[length(this.fname1)],[this._str2code[frmt1-1]],[0],[this.N],[M],[this.swap],[offset,this._str2code[this.fname1-1]],[tmask1,outmask.slice()]]; if (prod(size(dstate))!=(this.N*M)+3) { dstate = [[-1],[-1],[lunit],[zeros(this.N*M,1)]]; } - model.dstate = dstate; - model.ipar = ipar; + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/READAU_f.pickle b/js/Sources/READAU_f.pickle index 645d82bd..a9f6a4a0 100644 --- a/js/Sources/READAU_f.pickle +++ b/js/Sources/READAU_f.pickle @@ -12,10 +12,12 @@ aS'alreadyran' p5 aS'x' p6 -aS'swap' +aS'model' p7 -atp8 -Rp9 +aS'swap' +p8 +atp9 +Rp10 .(dp0 S'tmask' p1 diff --git a/js/Sources/READC_f.js b/js/Sources/READC_f.js index e6f44c28..5084d60e 100644 --- a/js/Sources/READC_f.js +++ b/js/Sources/READC_f.js @@ -14,19 +14,19 @@ function READC_f() { ievt = 0; nout = size(this.outmask,"*"); ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; - model = scicos_model(); - model.sim = list("readc",2); - model.out = nout; - model.evtin = 1; - model.evtout = []; - model.dstate = [[1],[1],[lunit],[zeros(this.N*this.M,1)]]; - model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("readc",2); + this.model.out = new ScilabDouble(nout); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = []; + this.model.dstate = [[1],[1],[lunit],[zeros(this.N*this.M,1)]]; + this.model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[fname-1]],[tmask],[this.outmask]]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = [["[]"],[sci2exp(this.outmask)],[fname],[frmt],[string(this.M)],[string(this.N)],[string(this.offset)],[string(this.swap)]]; gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } READC_f.prototype.details = function READC_f() { @@ -55,12 +55,12 @@ function READC_f() { this.offset = parseFloat(arguments[0]["offset"]) this.swap = parseFloat(arguments[0]["swap"]) this.x = arg1; - model = this.x.model; + this.model = this.x.model; graphics = arg1.graphics; exprs = graphics.exprs; - out = model.out; - dstate = model.dstate; - ipar = model.ipar; + out = this.model.out; + dstate = this.model.dstate; + ipar = this.model.ipar; imask = 9+ipar[1-1]; tmask = ipar[imask-1]; lunit = dstate[3-1]; @@ -113,23 +113,23 @@ function READC_f() { outpt = 1; } out = size(this.outmask,"*"); - [model,graphics,ok] = check_io(model,graphics,[],out,1,outpt); + [model,graphics,ok] = check_io(this.model,graphics,[],out,1,outpt); this.frmt1 = part(this.frmt1,1,3); if (ok) { if (ievt==0) { - model.firing = -1; + this.model.firing = new ScilabDouble(-1); } else { - model.firing = 0; + this.model.firing = new ScilabDouble(0); } ipar = [[length(this.fname1)],[this._str2code[this.frmt1-1]],[ievt],[this.N],[this.M],[this.swap],[this.offset],[this._str2code[this.fname1-1]],[this.tmask1],[this.outmask.slice()]]; if (prod(size(dstate))!=(this.N*this.M)+3) { dstate = [[-1],[-1],[lunit],[zeros(this.N*this.M,1)]]; } - model.dstate = dstate; - model.ipar = ipar; + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/READC_f.pickle b/js/Sources/READC_f.pickle index 0332b448..784bffe7 100644 --- a/js/Sources/READC_f.pickle +++ b/js/Sources/READC_f.pickle @@ -20,12 +20,14 @@ aS'offset' p9 aS'x' p10 -aS'tmask1' +aS'model' p11 -aS'alreadyran' +aS'tmask1' p12 -atp13 -Rp14 +aS'alreadyran' +p13 +atp14 +Rp15 .(dp0 S'tmask' p1 diff --git a/js/Sources/RFILE_f.js b/js/Sources/RFILE_f.js index 419f0bb1..18a469ac 100644 --- a/js/Sources/RFILE_f.js +++ b/js/Sources/RFILE_f.js @@ -12,17 +12,17 @@ function RFILE_f() { this.outmask = 1; ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; dstate = [[1],[1],[lunit],[zeros((nout)*this.N,1)]]; - model = scicos_model(); - model.sim = "readf"; - model.out = nout; - model.evtin = 1; - model.dstate = dstate; - model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("readf"); + this.model.out = new ScilabDouble(nout); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = dstate; + this.model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]],[tmask],[this.outmask]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[sci2exp([])],[sci2exp(this.outmask)],[fname],[frmt],[string(this.N)],[sci2exp(out)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RFILE_f.prototype.details = function RFILE_f() { @@ -47,9 +47,9 @@ function RFILE_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; - ipar = model.ipar; + this.model = arg1.model; + dstate = this.model.dstate; + ipar = this.model.ipar; ievt = ipar[3-1]; this.N = ipar[4-1]; imask = 5+ipar[1-1]+ipar[2-1]; @@ -97,22 +97,22 @@ function RFILE_f() { ievt = 1; cout = 1; } - [model,graphics,ok] = check_io(model,graphics,[],nout,1,cout); + [model,graphics,ok] = check_io(this.model,graphics,[],nout,1,cout); if (ok) { if (ievt==0) { - model.firing = []; + this.model.firing = []; } else { - model.firing = 0; + this.model.firing = new ScilabDouble(0); } ipar = [[length(this.fname1)],[length(this.frmt1)],[ievt],[this.N],[this._str2code[this.fname1-1]],[this._str2code[this.frmt1-1]],[this.tmask1],[this.outmask.slice()]]; if (prod(size(dstate))!=(nout+ievt)*this.N+3) { dstate = [[-1],[-1],[lunit],[zeros((nout+ievt)*this.N,1)]]; } - model.dstate = dstate; - model.ipar = ipar; + this.model.dstate = dstate; + this.model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/RFILE_f.pickle b/js/Sources/RFILE_f.pickle index 27183e5c..81197c15 100644 --- a/js/Sources/RFILE_f.pickle +++ b/js/Sources/RFILE_f.pickle @@ -14,10 +14,12 @@ aS'N' p6 aS'x' p7 -aS'tmask1' +aS'model' p8 -atp9 -Rp10 +aS'tmask1' +p9 +atp10 +Rp11 .(dp0 S'tmask' p1 diff --git a/js/Sources/SAWTOOTH_f.js b/js/Sources/SAWTOOTH_f.js index 5650778d..40a2aaa4 100644 --- a/js/Sources/SAWTOOTH_f.js +++ b/js/Sources/SAWTOOTH_f.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/Sources/SAWTOOTH_f.sci" */ function SAWTOOTH_f() { SAWTOOTH_f.prototype.define = function SAWTOOTH_f() { - model = scicos_model(); - model.sim = "sawtth"; - model.out = 1; - model.evtin = 1; - model.dstate = 0; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sawtth"); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; exprs = " "; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } SAWTOOTH_f.prototype.details = function SAWTOOTH_f() { diff --git a/js/Sources/SAWTOOTH_f.pickle b/js/Sources/SAWTOOTH_f.pickle index 9bc296b1..40c4ca73 100644 --- a/js/Sources/SAWTOOTH_f.pickle +++ b/js/Sources/SAWTOOTH_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Sources/STEP.js b/js/Sources/STEP.js index 1d5fbe8a..af7fb2cc 100644 --- a/js/Sources/STEP.js +++ b/js/Sources/STEP.js @@ -2,20 +2,20 @@ function STEP() { STEP.prototype.define = function STEP() { rpar = [[0],[1]]; - model = scicos_model(); - model.sim = list("step_func",4); - model.evtin = 1; - model.evtout = 1; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.firing = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("step_func",4); + this.model.evtin = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.firing = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; exprs = [[string(1)],[string(rpar)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } STEP.prototype.details = function STEP() { @@ -36,7 +36,7 @@ function STEP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.temps,this.in1,this.fi,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","STEP_FUNCTION")],[" "],["Step Function"],[" "]],["Step Time","Initial Value","Final Value"],list("vec",1,"vec",-1,"vec",-1),exprs); if (!ok) { @@ -55,21 +55,21 @@ function STEP() { } } if (ok) { - model.out2 = 1; - model.outtyp = 1; - [model,graphics,ok] = check_io(model,graphics,[],size(this.fi,"*"),1,1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + [model,graphics,ok] = check_io(this.model,graphics,[],size(this.fi,"*"),1,1); } if (ok) { - model.firing = this.temps; + this.model.firing = new ScilabDouble(this.temps); if (this.temps==0) { rpar = [[this.fi],[this.fi]]; } else { rpar = [[this.in1],[this.fi]]; } - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/STEP.pickle b/js/Sources/STEP.pickle index 026264fc..61507c43 100644 --- a/js/Sources/STEP.pickle +++ b/js/Sources/STEP.pickle @@ -6,12 +6,14 @@ S'temps' p2 aS'x' p3 -aS'in1' +aS'model' p4 -aS'fi' +aS'in1' p5 -atp6 -Rp7 +aS'fi' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Sources/STEP_FUNCTION.js b/js/Sources/STEP_FUNCTION.js index bc6c83da..696ea445 100644 --- a/js/Sources/STEP_FUNCTION.js +++ b/js/Sources/STEP_FUNCTION.js @@ -8,25 +8,25 @@ function STEP_FUNCTION() { scs_m_1.objs[4-1] = scicos_link(); blk = scs_m_1.objs[1-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [0,0]; graphics.sz = [40,40]; graphics.pein = 4; graphics.peout = 4; graphics.pout = 3; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[1-1] = blk; blk = scs_m_1.objs[2-1]; graphics = blk.graphics; - model = blk.model; + this.model = blk.model; graphics.orig = [80,10]; graphics.sz = [20,20]; graphics.exprs = ["1"]; - model.ipar = 1; + this.model.ipar = new ScilabDouble(1); graphics.pin = 3; blk.graphics = graphics; - blk.model = model; + blk.model = this.model; scs_m_1.objs[2-1] = blk; lnk = scs_m_1.objs[3-1]; lnk.from = [1,1,0]; @@ -41,14 +41,14 @@ function STEP_FUNCTION() { scs_m_1.objs[4-1] = lnk; blk={}; lnk={}; - model = scicos_model(); - model.sim = "csuper"; - model.out = 1; - model.out2 = 1; - model.outtyp = 1; - model.rpar = scs_m_1; + this.model = scicos_model(); + this.model.sim = new ScilabString("csuper"); + this.model.out = new ScilabDouble(1); + this.model.out2 = new ScilabDouble(1); + this.model.outtyp = new ScilabDouble(1); + this.model.rpar = scs_m_1; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } STEP_FUNCTION.prototype.details = function STEP_FUNCTION() { @@ -80,37 +80,37 @@ function STEP_FUNCTION() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (diffobjs(this.xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; diff --git a/js/Sources/STEP_FUNCTION.pickle b/js/Sources/STEP_FUNCTION.pickle index fb7b5d49..16eeb41f 100644 --- a/js/Sources/STEP_FUNCTION.pickle +++ b/js/Sources/STEP_FUNCTION.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'xxn' +aS'model' p3 -atp4 -Rp5 +aS'xxn' +p4 +atp5 +Rp6 .(dp0 S'lnk.ct' p1 diff --git a/js/Sources/SampleCLK.js b/js/Sources/SampleCLK.js index a91881eb..34505fc0 100644 --- a/js/Sources/SampleCLK.js +++ b/js/Sources/SampleCLK.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Sources/SampleCLK.sci" */ function SampleCLK() { SampleCLK.prototype.define = function SampleCLK() { - model = scicos_model(); - model.sim = "sampleclk"; - model.evtout = 1; - model.rpar = [1,0]; - model.blocktype = "d"; - model.firing = -1; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("sampleclk"); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [1,0]; + this.model.blocktype = new ScilabString("d"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [false,false]; exprs = [[sci2exp(1)],[sci2exp(0)]]; - this.x = standard_define([2,2],model,exprs," "); + this.x = standard_define([2,2],this.model,exprs," "); return new BasicBlock(this.x); } SampleCLK.prototype.details = function SampleCLK() { @@ -27,7 +27,7 @@ function SampleCLK() { this.offset = arguments[0]["offset"] this.x = arg1; graphics = arg1.graphics; - model = arg1.model; + this.model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",1,"vec",1),exprs); @@ -43,16 +43,16 @@ function SampleCLK() { ok = false; } if (ok) { - if (or(model.rpar.slice()!=[[this.frequ],[this.offset]])) { + if (or(this.model.rpar.slice()!=[[this.frequ],[this.offset]])) { needcompile = 4; y = needcompile; } - model.rpar = [[this.frequ],[this.offset]]; - model.evtout = 1; - model.firing = -1; + this.model.rpar = [[this.frequ],[this.offset]]; + this.model.evtout = new ScilabDouble(1); + this.model.firing = new ScilabDouble(-1); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Sources/SampleCLK.pickle b/js/Sources/SampleCLK.pickle index 19edde44..4cf41094 100644 --- a/js/Sources/SampleCLK.pickle +++ b/js/Sources/SampleCLK.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'frequ' +aS'model' p3 -aS'offset' +aS'frequ' p4 -atp5 -Rp6 +aS'offset' +p5 +atp6 +Rp7 .(dp0 S'needcompile' p1 diff --git a/js/Sources/Sigbuilder.js b/js/Sources/Sigbuilder.js index 89064608..8dcd8461 100644 --- a/js/Sources/Sigbuilder.js +++ b/js/Sources/Sigbuilder.js @@ -10,9 +10,9 @@ function Sigbuilder() { scs_m_1.objs[6-1] = scicos_link(xx=[[378.20616],[398.20616]],yy=[[626.18517],[626.18517]],id="drawlink",thick=[0,0],ct=[1,1],from=[1,1,0],to=[5,1,1]); scs_m_1.objs[7-1] = scicos_block(gui="CLKOUTV_f",graphics=scicos_graphics(orig=[339.49528,505.10704],sz=[20,30],flip=true,theta=0,exprs="1",pin=[],pout=[],pein=8,peout=[],gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="output",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=1,evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[8-1] = scicos_link(xx=[[349.49528],[349.49528]],yy=[[565.10704],[535.10704]],id="drawlink",thick=[0,0],ct=[5,-1],from=[3,1,0],to=[7,1,1]); - model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); + this.model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=-1,out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()); gr_i = []; - this.x = standard_define([3,2],model,[],gr_i); + this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } Sigbuilder.prototype.details = function Sigbuilder() { @@ -46,40 +46,40 @@ function Sigbuilder() { xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (diffobjs(this.xxn,xx)) { - model = xx.model; + this.model = xx.model; model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label); - if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) { + modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); + if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)||or(this.model.in2!=model_n.in2)||or(this.model.out2!=model_n.out2)||or(this.model.outtyp!=model_n.outtyp)||or(this.model.intyp!=model_n.intyp)) { needcompile = 1; } - if (or(model.firing!=model_n.firing)) { + if (or(this.model.firing!=model_n.firing)) { needcompile = 2; } - if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) { + if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))) { needcompile = 4; } - if (model.sim=="input"||model.sim=="output") { - if (model.ipar!=model_n.ipar) { + if (this.model.sim=="input"||this.model.sim=="output") { + if (this.model.ipar!=model_n.ipar) { needcompile = 4; } } - if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) { + if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { needcompile = 4; } - if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) { + if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { - if (model.sim[1-1]!=model_n.sim[1-1]) { + if (this.model.sim[1-1]!=model_n.sim[1-1]) { needcompile = 4; } } } } else { - modified = or(model_n!=model); - eq = model.equations; + modified = or(model_n!=this.model); + eq = this.model.equations; eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { needcompile = 4; diff --git a/js/Sources/Sigbuilder.pickle b/js/Sources/Sigbuilder.pickle index f013555d..2c79062e 100644 --- a/js/Sources/Sigbuilder.pickle +++ b/js/Sources/Sigbuilder.pickle @@ -8,14 +8,16 @@ aS'y' p3 aS'x' p4 -aS'N' +aS'model' p5 -aS'ORDER2' +aS'N' p6 -aS'order' +aS'ORDER2' p7 -atp8 -Rp9 +aS'order' +p8 +atp9 +Rp10 .(dp0 S'Y[j-1]' p1 diff --git a/js/Sources/TIME_f.js b/js/Sources/TIME_f.js index e0476b40..4fbd512e 100644 --- a/js/Sources/TIME_f.js +++ b/js/Sources/TIME_f.js @@ -1,13 +1,13 @@ /* autogenerated from "macros/Sources/TIME_f.sci" */ function TIME_f() { TIME_f.prototype.define = function TIME_f() { - model = scicos_model(); - model.sim = "timblk"; - model.out = 1; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = new ScilabString("timblk"); + this.model.out = new ScilabDouble(1); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } TIME_f.prototype.details = function TIME_f() { diff --git a/js/Sources/TIME_f.pickle b/js/Sources/TIME_f.pickle index 50df16d2..8cc9b048 100644 --- a/js/Sources/TIME_f.pickle +++ b/js/Sources/TIME_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Sources/TKSCALE.js b/js/Sources/TKSCALE.js index c29ec00e..4f31582a 100644 --- a/js/Sources/TKSCALE.js +++ b/js/Sources/TKSCALE.js @@ -4,16 +4,16 @@ function TKSCALE() { this.a = -10; this.b = 10; this.f = 1; - model = scicos_model(); - model.sim = list("tkscaleblk",5); - model.out = 1; - model.evtin = 1; - model.rpar = [[this.a],[this.b],[this.f]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.sim = list("tkscaleblk",5); + this.model.out = new ScilabDouble(1); + this.model.evtin = new ScilabDouble(1); + this.model.rpar = [[this.a],[this.b],[this.f]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; exprs = [[sci2exp(this.a)],[sci2exp(this.b)],[sci2exp(this.f)]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TKSCALE.prototype.details = function TKSCALE() { @@ -34,13 +34,13 @@ function TKSCALE() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; [ok,this.a,this.b,this.f,exprs] = scicos_getvalue("Set scale block parameters",["Min value","Max value","Normalization"],list("vec",1,"vec",1,"vec",1),exprs); if (ok) { graphics.exprs = exprs; - model.rpar = [[this.a],[this.b],[this.f]]; + this.model.rpar = [[this.a],[this.b],[this.f]]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; } return new BasicBlock(this.x); } diff --git a/js/Sources/TKSCALE.pickle b/js/Sources/TKSCALE.pickle index d4dc27cf..6e70cea7 100644 --- a/js/Sources/TKSCALE.pickle +++ b/js/Sources/TKSCALE.pickle @@ -6,12 +6,14 @@ S'a' p2 aS'x' p3 -aS'b' +aS'model' p4 -aS'f' +aS'b' p5 -atp6 -Rp7 +aS'f' +p6 +atp7 +Rp8 .(dp0 S'a' p1 diff --git a/js/Threshold/GENERAL_f.js b/js/Threshold/GENERAL_f.js index adc77cb3..cc6e31c3 100644 --- a/js/Threshold/GENERAL_f.js +++ b/js/Threshold/GENERAL_f.js @@ -4,18 +4,18 @@ function GENERAL_f() { rpar = [[0],[0],[0],[0]]; this.in1 = 1; this.out = 1; - model = scicos_model(); - model.sim = list("zcross",1); - model.nzcross = this.in1; - model.in1 = this.in1; - model.evtout = ones(this.out,1); - model.rpar = [[0],[0],[0],[0]]; - model.blocktype = "z"; - model.firing = -ones(this.out,1); - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.in1 = new ScilabDouble(this.in1); + this.model.evtout = new ScilabDouble(ones(this.out,1)); + this.model.rpar = [[0],[0],[0],[0]]; + this.model.blocktype = new ScilabString("z"); + this.model.firing = new ScilabDouble(-ones(this.out,1)); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.in1))],[strcat(sci2exp(this.out))]]; gr_i = []; - this.x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } GENERAL_f.prototype.details = function GENERAL_f() { @@ -34,15 +34,15 @@ function GENERAL_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - rpar = model.rpar; - this.in1 = model.in1; - this.out = model.evtout; + this.model = arg1.model; + rpar = this.model.rpar; + this.in1 = this.model.in1; + this.out = this.model.evtout; nin = sum(this.in1); nout = sum(this.out); [ok,this.in1,this.out,exprs] = scicos_getvalue("Set General Zero-Crossing parameters",["Input size","Number of event output"],list("vec",1,"vec",1),exprs); if (ok) { - [model,graphics,ok] = check_io(model,graphics,this.in1,[],[],ones(this.out,1)); + [model,graphics,ok] = check_io(this.model,graphics,this.in1,[],[],ones(this.out,1)); if (ok) { nout1 = this.out; nin1 = this.in1; @@ -55,12 +55,12 @@ function GENERAL_f() { result = x_mdialog("routing matrix",string(1,nout1),string(1,2^(2*nin1)),string(rp.slice().slice())); if (result!=[]) { rp.slice(1-1,nout1).slice(1-1,2*n) = evstr(result); - model.nzcross = this.in1; - model.rpar = rp.slice(); - model.firing = -ones(this.out,1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.rpar = rp.slice(); + this.model.firing = new ScilabDouble(-ones(this.out,1)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; } } } diff --git a/js/Threshold/GENERAL_f.pickle b/js/Threshold/GENERAL_f.pickle index 6ca65ee0..19047dfc 100644 --- a/js/Threshold/GENERAL_f.pickle +++ b/js/Threshold/GENERAL_f.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'in1' +aS'model' p3 -aS'out' +aS'in1' p4 -atp5 -Rp6 +aS'out' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 diff --git a/js/Threshold/NEGTOPOS_f.js b/js/Threshold/NEGTOPOS_f.js index d23001d0..81862e86 100644 --- a/js/Threshold/NEGTOPOS_f.js +++ b/js/Threshold/NEGTOPOS_f.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/Threshold/NEGTOPOS_f.sci" */ function NEGTOPOS_f() { NEGTOPOS_f.prototype.define = function NEGTOPOS_f() { - model = scicos_model(); - model.sim = list("zcross",1); - model.nzcross = 1; - model.in1 = 1; - model.evtout = 1; - model.rpar = [[-1],[-1],[0],[-1]]; - model.blocktype = "z"; - model.firing = -1; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.nzcross = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[-1],[-1],[0],[-1]]; + this.model.blocktype = new ScilabString("z"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [true,false]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } NEGTOPOS_f.prototype.details = function NEGTOPOS_f() { diff --git a/js/Threshold/NEGTOPOS_f.pickle b/js/Threshold/NEGTOPOS_f.pickle index dc317b49..6955283d 100644 --- a/js/Threshold/NEGTOPOS_f.pickle +++ b/js/Threshold/NEGTOPOS_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Threshold/POSTONEG_f.js b/js/Threshold/POSTONEG_f.js index 24aae903..8913a995 100644 --- a/js/Threshold/POSTONEG_f.js +++ b/js/Threshold/POSTONEG_f.js @@ -2,17 +2,17 @@ function POSTONEG_f() { POSTONEG_f.prototype.define = function POSTONEG_f() { rpar = [[-1],[-1],[-1],[0]]; - model = scicos_model(); - model.sim = list("zcross",1); - model.nzcross = 1; - model.in1 = 1; - model.evtout = 1; - model.rpar = [[-1],[-1],[-1],[0]]; - model.blocktype = "z"; - model.dep_ut = [true,false]; - model.firing = [-1]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.nzcross = new ScilabDouble(1); + this.model.in1 = new ScilabDouble(1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[-1],[-1],[-1],[0]]; + this.model.blocktype = new ScilabString("z"); + this.model.dep_ut = [true,false]; + this.model.firing = [-1]; gr_i = []; - this.x = standard_define([2,2],model,[],gr_i); + this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } POSTONEG_f.prototype.details = function POSTONEG_f() { diff --git a/js/Threshold/POSTONEG_f.pickle b/js/Threshold/POSTONEG_f.pickle index 18fad599..2905c4eb 100644 --- a/js/Threshold/POSTONEG_f.pickle +++ b/js/Threshold/POSTONEG_f.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Threshold/ZCROSS_f.js b/js/Threshold/ZCROSS_f.js index fae6bbaf..606966d0 100644 --- a/js/Threshold/ZCROSS_f.js +++ b/js/Threshold/ZCROSS_f.js @@ -3,18 +3,18 @@ function ZCROSS_f() { ZCROSS_f.prototype.define = function ZCROSS_f() { rpar = [[-1],[-1],[0],[0]]; this.in1 = 1; - model = scicos_model(); - model.sim = list("zcross",1); - model.in1 = this.in1; - model.nzcross = this.in1; - model.evtout = 1; - model.rpar = [[-1],[-1],[0],[0]]; - model.blocktype = "z"; - model.firing = -1; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("zcross",1); + this.model.in1 = new ScilabDouble(this.in1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.evtout = new ScilabDouble(1); + this.model.rpar = [[-1],[-1],[0],[0]]; + this.model.blocktype = new ScilabString("z"); + this.model.firing = new ScilabDouble(-1); + this.model.dep_ut = [true,false]; exprs = strcat(sci2exp(this.in1)); gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } ZCROSS_f.prototype.details = function ZCROSS_f() { @@ -30,7 +30,7 @@ function ZCROSS_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.in1,exprs] = scicos_getvalue([["Set Zero-Crossing parameters"],["All surfaces must cross together"]],"Input size",list("vec",1),exprs); if (!ok) { @@ -44,13 +44,13 @@ function ZCROSS_f() { for (jj=1;jj<=this.in1;jj+=1) { kk = kk+2^(this.in1+jj-1); } - model.rpar = [[-ones(kk,1)],[zeros(2^(2*this.in1)-kk,1)]]; + this.model.rpar = [[-ones(kk,1)],[zeros(2^(2*this.in1)-kk,1)]]; graphics.exprs = exprs; - model.in1 = this.in1; - model.nzcross = this.in1; - model.firing = -1; + this.model.in1 = new ScilabDouble(this.in1); + this.model.nzcross = new ScilabDouble(this.in1); + this.model.firing = new ScilabDouble(-1); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } diff --git a/js/Threshold/ZCROSS_f.pickle b/js/Threshold/ZCROSS_f.pickle index 49628617..a2c25b4d 100644 --- a/js/Threshold/ZCROSS_f.pickle +++ b/js/Threshold/ZCROSS_f.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'in1' +aS'model' p3 -atp4 -Rp5 +aS'in1' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 diff --git a/sci2jslex.py b/sci2jslex.py index b644797f..9db84caf 100755 --- a/sci2jslex.py +++ b/sci2jslex.py @@ -264,7 +264,7 @@ FUNCTION_NAMES.update(dict.fromkeys(VECTOR_FUNCTION_NAMES, VECTOR_TYPE)) OBJECTS = { # 'PREVAR_scicos_context': 'PREVAR_SCICOS_CONTEXT', # 'arg1': 'ARG1', -# 'model': 'MODEL', + 'model': 'MODEL', # 'scicos_context': 'SCICOS_CONTEXT', } diff --git a/sci2jsyacc.py b/sci2jsyacc.py index 4bf1d9a2..cc293477 100755 --- a/sci2jsyacc.py +++ b/sci2jsyacc.py @@ -39,6 +39,16 @@ PARSE_MAP = { VECTOR_TYPE: 'inverse', } +MODEL_MAP = { + BOOLEAN_TYPE: 'ScilabBoolean', + DOUBLE_TYPE: 'ScilabDouble', + MATRIX_TYPE: '', + NULL_TYPE: '', + OBJECT_TYPE: '', + STRING_TYPE: 'ScilabString', + VECTOR_TYPE: '', +} + start = 'functionblocks' JOB_BLOCKS = {} @@ -476,11 +486,50 @@ def p_elsestatement_else(p): # define assignment -def p_assignment_expression(p): +def p_lterm_assignment_expression(p): 'assignment : lterm ASSIGNMENT expression' p[0] = '%*s%s = %s' % (INDENT_LEVEL * INDENT_SIZE, ' ', p[1], p[3][0]) add_var_vartype(p[1], p[3][1]) +def p_model_assignment_expression(p): + 'assignment : MODEL ASSIGNMENT expression' + p[0] = '%*sthis.%s = %s' % (INDENT_LEVEL * INDENT_SIZE, ' ', p[1], p[3][0]) + var = p[1] + add_global_var(var) + add_var_vartype(var, p[3][1]) + +def p_modelvar_modelvar_var(p): + 'modelvar : modelvar DOT VAR' + p[0] = '%s.%s' % (p[1], p[3]) + +def p_modelvar_var(p): + 'modelvar : VAR' + p[0] = '%s' % (p[1]) + +def p_modelvar_modelvar_expression(p): + 'modelvar : modelvar OPENBRACKET expression CLOSEBRACKET' + p[0] = '%s[%s]' % (p[1], p[3]) + +def p_model_var_assignment_expression(p): + 'assignment : MODEL DOT modelvar ASSIGNMENT expression' + var = 'this.%s.%s' % (p[1], p[3]) + vartype = MODEL_MAP.get(p[5][1], 'ScilabDouble') + if vartype != '': + p[0] = '%*s%s = new %s(%s)' % (INDENT_LEVEL * INDENT_SIZE, ' ', var, vartype, p[5][0]) + else: + p[0] = '%*s%s = %s' % (INDENT_LEVEL * INDENT_SIZE, ' ', var, p[5][0]) + add_var_vartype(var, p[5][1]) + +def p_model_in_assignment_expression(p): + 'assignment : MODEL DOT IN ASSIGNMENT expression' + var = 'this.%s.%s1' % (p[1], p[3]) + vartype = MODEL_MAP.get(p[5][1], 'ScilabDouble') + if vartype != '': + p[0] = '%*s%s = new %s(%s)' % (INDENT_LEVEL * INDENT_SIZE, ' ', var, vartype, p[5][0]) + else: + p[0] = '%*s%s = %s' % (INDENT_LEVEL * INDENT_SIZE, ' ', var, p[5][0]) + add_var_vartype(var, p[5][1]) + def p_getvalueassignment_getvalue_arguments(p): 'getvalueassignment : lterm ASSIGNMENT SCICOS_GETVALUE OPENBRACKET getvaluearguments CLOSEBRACKET' p[0] = '%*s%s = %s(%s)' % (INDENT_LEVEL * INDENT_SIZE, ' ', p[1], p[3], p[5]) @@ -585,11 +634,13 @@ def p_getvaluearg4_expression(p): # define ltermarraylist def p_ltermarraylist_ltermarraylist_comma_ltermvar(p): - 'ltermarraylist : ltermarraylist COMMA ltermvar''' + '''ltermarraylist : ltermarraylist COMMA ltermvar + | ltermarraylist COMMA MODEL''' p[0] = '%s,%s' % (p[1], p[3]) def p_ltermarraylist_ltermvar(p): - 'ltermarraylist : ltermvar' + '''ltermarraylist : ltermvar + | MODEL''' p[0] = '%s' % (p[1]) # end define ltermarraylist @@ -626,7 +677,8 @@ def p_list_list_expression(p): p[0] = ('%s,%s' % (p[1][0], p[3][0]), VECTOR_TYPE) def p_list_list_var_expression(p): - 'list : list COMMA VAR ASSIGNMENT expression' + '''list : list COMMA VAR ASSIGNMENT expression + | list COMMA MODEL ASSIGNMENT expression''' p[0] = ('%s,%s=%s' % (p[1][0], p[3], p[5][0]), VECTOR_TYPE) def p_list_list_in_expression(p): @@ -807,7 +859,8 @@ def p_lterm_ltermvar(p): p[0] = '%s' % (p[1]) def p_ltermvar_ltermvar_dot_var(p): - 'ltermvar : ltermvar DOT VAR' + '''ltermvar : ltermvar DOT VAR + | ltermvar DOT MODEL''' p[0] = '%s.%s' % (p[1], p[3]) def p_ltermvar_ltermvar_dot_in(p): @@ -1020,7 +1073,8 @@ def p_term_termvar(p): # A.B def p_termvar_termvar_dot_var(p): - 'termvar : termvar DOT VAR' + '''termvar : termvar DOT VAR + | termvar DOT MODEL''' var = p[1][0] if var[:5] == 'this.': basevar = var[5:] @@ -1053,7 +1107,8 @@ def p_termvar_termvar_dot_in(p): # A def p_termvar_var(p): - 'termvar : VAR' + '''termvar : VAR + | MODEL''' var = p[1] add_global_var(var) vartype = VAR_TYPES[var] if var in VAR_TYPES else None |