diff options
Diffstat (limited to 'combined.js')
-rw-r--r-- | combined.js | 8706 |
1 files changed, 4353 insertions, 4353 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; } } |