diff options
-rw-r--r-- | data_structures_correct/ABS_VALUE.js | 29 | ||||
-rw-r--r-- | data_structures_correct/AFFICH_m.js | 33 | ||||
-rw-r--r-- | data_structures_correct/ANDBLK.js | 130 | ||||
-rw-r--r-- | data_structures_correct/ANDLOG_f.js | 50 | ||||
-rw-r--r-- | data_structures_correct/AUTOMAT.js | 49 | ||||
-rw-r--r-- | data_structures_correct/BACKLASH.js | 21 | ||||
-rw-r--r-- | data_structures_correct/BARXY.js | 30 | ||||
-rw-r--r-- | data_structures_correct/BIGSOM_f.js | 27 | ||||
-rw-r--r-- | data_structures_correct/BOUNCE.js | 50 | ||||
-rw-r--r-- | data_structures_correct/Bache.js | 46 | ||||
-rw-r--r-- | data_structures_correct/CFSCOPE.js | 43 | ||||
-rw-r--r-- | data_structures_correct/CLOCK_c.js | 79 | ||||
-rw-r--r-- | data_structures_correct/CMSCOPE.js | 63 | ||||
-rw-r--r-- | data_structures_correct/CONST_m.js | 38 | ||||
-rw-r--r-- | data_structures_correct/EVTDLY_c.js | 49 | ||||
-rw-r--r-- | data_structures_correct/IFTHEL_f.js | 60 | ||||
-rw-r--r-- | dependencies.js | 240 | ||||
-rw-r--r-- | details.js | 540 | ||||
-rw-r--r-- | finalmodsheet.xsl | 18 |
19 files changed, 1105 insertions, 490 deletions
diff --git a/data_structures_correct/ABS_VALUE.js b/data_structures_correct/ABS_VALUE.js new file mode 100644 index 0000000..bf0b6fb --- /dev/null +++ b/data_structures_correct/ABS_VALUE.js @@ -0,0 +1,29 @@ +function ABS_VALUE() { + + ABS_VALUE.prototype.define = function ABS_VALUE() { + + this.nu = -1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["absolute_value"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.nu]); + model.out = new ScilabDouble([this.nu]); + model.nzcross = new ScilabDouble([this.nu]); + model.nmode = new ScilabDouble([this.nu]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ABS_VALUE\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + this.x.graphics.style = new ScilabString(["ABS_VALUE"]); + return new BasicBlock(this.x); + + } + + ABS_VALUE.prototype.details = function ABS_VALUE() { + return this.x; + } + +} diff --git a/data_structures_correct/AFFICH_m.js b/data_structures_correct/AFFICH_m.js new file mode 100644 index 0000000..fe63c41 --- /dev/null +++ b/data_structures_correct/AFFICH_m.js @@ -0,0 +1,33 @@ +function AFFICH_m() { + + AFFICH_m.prototype.define = function AFFICH_m() { + this.font = 1; + this.fontsize = 1; + this.colr = 1; + this.nt = 5; + this.nd = 1; + this.in1 = [1, 1]; + + var model = scicos_model(); + model.sim = list(new ScilabString(["affich2"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.in1[0]]); + model.in2 = new ScilabDouble([this.in1[1]]); + model.evtin = new ScilabDouble([1]); + model.dstate = new ScilabDouble([-1], [0], [0], [1], [1], [0], ...zeros(this.in1[0] * this.in1[1], 1)); + model.ipar = new ScilabDouble([this.font], [this.fontsize], [this.colr], [1000], [this.nt], [this.nd], [this.in1[0]]); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + model.label = new ScilabString([""]); + var exprs = new ScilabString([sci2exp([parseFloat(...getData(model.in)), parseFloat(...getData(model.in2))])], [this.font.toString()], [this.fontsize.toString()], [this.colr.toString()], [this.nt.toString()], [this.nd.toString()], [(0).toString()]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"AFFICH_m\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + this.x.graphics.style = new ScilabString(["AFFICH_m"]); + return new AfficheBlock(this.x); + } + + AFFICH_m.prototype.details = function AFFICH_m() { + return this.x; + } +} diff --git a/data_structures_correct/ANDBLK.js b/data_structures_correct/ANDBLK.js new file mode 100644 index 0000000..4f632ff --- /dev/null +++ b/data_structures_correct/ANDBLK.js @@ -0,0 +1,130 @@ +function ANDBLK() { + + ANDBLK.prototype.define = function ANDBLK() { + + var andlog = new ANDLOG_f().internal(); + andlog.graphics.orig = new ScilabDouble([194, 133]); + andlog.graphics.sz = new ScilabDouble([60, 60]); + andlog.graphics.flip = new ScilabBoolean([true]); + andlog.graphics.pout = new ScilabDouble([9]); + andlog.graphics.pein = new ScilabDouble([4], [11]); + andlog.model.uid = new ScilabString([count]); + andlog.doc = list(new ScilabString([count++])); + + var input_port1 = new CLKIN_f().internal(); + input_port1.graphics.orig = new ScilabDouble([149, 287]); + input_port1.graphics.sz = new ScilabDouble([20, 20]); + input_port1.graphics.flip = new ScilabBoolean([true]); + input_port1.graphics.exprs = new ScilabString(["1"]); + input_port1.graphics.peout = new ScilabDouble([4]); + input_port1.model.ipar = new ScilabDouble([1]); + input_port1.model.uid = new ScilabString([count]); + input_port1.doc = list(new ScilabString([count++])); + + var output_port = new CLKOUT_f().internal(); + output_port.graphics.orig = new ScilabDouble([450, 83]); + output_port.graphics.sz = new ScilabDouble([20, 20]); + output_port.graphics.flip = new ScilabBoolean([true]); + output_port.graphics.exprs = new ScilabString(["1"]); + output_port.graphics.pein = new ScilabDouble([8]); + output_port.model.ipar = new ScilabDouble([1]); + output_port.model.uid = new ScilabString([count]); + output_port.doc = list(new ScilabString([count++])); + + var input_port2 = new CLKIN_f().internal(); + input_port2.graphics.orig = new ScilabDouble([141, 330]); + input_port2.graphics.sz = new ScilabDouble([20, 20]); + input_port2.graphics.flip = new ScilabBoolean([true]); + input_port2.graphics.exprs = new ScilabString(["2"]); + input_port2.graphics.peout = new ScilabDouble([6]); + input_port2.model.ipar = new ScilabDouble([2]); + input_port2.model.uid = new ScilabString([count]); + input_port2.doc = list(new ScilabString([count++])); + + var ifthel = new IFTHEL_f().internal(); + ifthel.graphics.orig = new ScilabDouble([331, 137]); + ifthel.graphics.sz = new ScilabDouble([60, 60]); + ifthel.graphics.flip = new ScilabBoolean([true]); + ifthel.graphics.pin = new ScilabDouble([9]); + ifthel.graphics.pein = new ScilabDouble([12]); + ifthel.graphics.peout = new ScilabDouble([8], [0]); + ifthel.model.uid = new ScilabString([count]); + ifthel.doc = list(new ScilabString([count++])); + + + var split = new CLKSPLIT_f().internal(); + split.graphics.orig = new ScilabDouble([234, 275.78348]); + split.graphics.pein = new ScilabDouble([6]); + split.graphics.peout = new ScilabDouble([11], [12]); + split.model.uid = new ScilabString([count]); + split.doc = list(new ScilabString([count++])); + + var diagram = scicos_diagram(); + diagram.objs.push(andlog); + diagram.objs.push(input_port1); + diagram.objs.push(output_port); + diagram.objs.push(input_port2); + diagram.objs.push(ifthel); + diagram.objs.push(split); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([169], [214], [214]), + yy: new ScilabDouble([297], [297], [198.71]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([2, 1, 0]), + to: new ScilabDouble([1, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([161], [234], [234]), + yy: new ScilabDouble([340], [340], [275.78]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([4, 1, 0]), + to: new ScilabDouble([6, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([351], [351], [450]), + yy: new ScilabDouble([131.29], [93], [93]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([5, 1, 0]), + to: new ScilabDouble([3, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([262.57], [322.43]), + yy: new ScilabDouble([163], [167]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([1, 1, 0]), + to: new ScilabDouble([5, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([234], [234]), + yy: new ScilabDouble([275.78], [198.71]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([6, 1, 0]), + to: new ScilabDouble([1, 2, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([234], [361], [361]), + yy: new ScilabDouble([275.78], [275.78], [202.71]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([6, 2, 0]), + to: new ScilabDouble([5, 1, 1]) + })); + this.x = scicos_block(); + this.x.gui = new ScilabString(["ANDBLK"]); + this.x.graphics.sz = new ScilabDouble([2, 2]); + this.x.graphics.gr_i = new ScilabDouble(); + this.x.graphics.pein = new ScilabDouble([0, 0]); + this.x.graphics.peout = new ScilabDouble([0]); + this.x.model.sim = new ScilabString(["csuper"]); + this.x.model.evtin = new ScilabDouble([1, 1]); + this.x.model.evtout = new ScilabDouble([1]); + this.x.model.blocktype = new ScilabString(["h"]); + this.x.model.firing = new ScilabBoolean([false]); + this.x.model.dep_ut = new ScilabBoolean([false, false]); + this.x.model.rpar = diagram; + return new BasicBlock(this.x); + } + ANDBLK.prototype.details = function ANDBLK() { + return this.x; + } + +} diff --git a/data_structures_correct/ANDLOG_f.js b/data_structures_correct/ANDLOG_f.js new file mode 100644 index 0000000..674a653 --- /dev/null +++ b/data_structures_correct/ANDLOG_f.js @@ -0,0 +1,50 @@ +function ANDLOG_f() { + + ANDLOG_f.prototype.internal = function() { + var model = scicos_model(); + model.sim = new ScilabString(["andlog"]); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); // null -> 1 + model.evtin = new ScilabDouble([-1], [-1]); // 1, 1 -> -1, -1 + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([false, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ANDLOG_f\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([80, 80]), model, new ScilabDouble(), gr_i); // 3 -> 80 + + // Style + block.graphics.out_implicit = new ScilabString(["E"]); + // changed + block.graphics.out_label = new ScilabString([""]); + block.graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]); + block.graphics.style = new ScilabString(["ANDLOG_f"]); + return block; + } + + ANDLOG_f.prototype.define = function ANDLOG() { + var model = scicos_model(); + model.sim = new ScilabString(["andlog"]); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); // null -> 1 + model.evtin = new ScilabDouble([-1], [-1]); // 1, 1 -> -1, -1 + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([false, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ANDLOG_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([80, 80]), model, new ScilabDouble(), gr_i); // 3 -> 80 + + // Style + this.x.graphics.out_implicit = new ScilabString(["E"]); + // changed + this.x.graphics.out_label = new ScilabString([""]); + this.x.graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]); + this.x.graphics.style = new ScilabString(["ANDLOG_f"]); + return new BasicBlock(this.x); + } + + ANDLOG_f.prototype.details = function ANDLOG() { + return this.x; + } +} diff --git a/data_structures_correct/AUTOMAT.js b/data_structures_correct/AUTOMAT.js new file mode 100644 index 0000000..931db5e --- /dev/null +++ b/data_structures_correct/AUTOMAT.js @@ -0,0 +1,49 @@ +function AUTOMAT() { + + AUTOMAT.prototype.define = function AUTOMAT() { + this.NMode = 2; + + this.Minitial = 1; + + this.NX = 1; + + this.X0 = [0.0]; + + this.XP = [ + [1], + [1] + ]; + + this.C1 = [2]; + + this.C2 = [1]; + + var exprs = new ScilabString([this.NMode.toString()], [this.Minitial.toString()], [this.NX.toString()], [sci2exp(this.X0)], [sci2exp(this.XP)], [sci2exp(this.C1)], [sci2exp(this.C2)]); + + var ipar = new ScilabDouble([this.NMode], [this.Minitial], [this.NX], ...this.XP, this.C1, this.C2); + + var rpar = new ScilabDouble(this.X0); + + var model = scicos_model(); + model.sim = list(new ScilabString(["automat"]), new ScilabDouble([10004])); + model.in = new ScilabDouble([2 * this.NX + 1], [2 * this.NX + 1]); + model.out = new ScilabDouble([2], [2 * this.NX]); + model.state = new ScilabDouble(...ones(2 * this.NX, 1)); + model.nzcross = new ScilabDouble([1]); + model.blocktype = new ScilabString(["c"]); + model.evtout = new ScilabDouble([1]); + model.firing = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([false, true]); + model.ipar = ipar; + model.rpar = rpar; + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"AUTOMAT\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([4, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + + } + + AUTOMAT.prototype.details = function AUTOMAT() { + return this.x; + } +} diff --git a/data_structures_correct/BACKLASH.js b/data_structures_correct/BACKLASH.js new file mode 100644 index 0000000..6ea6f08 --- /dev/null +++ b/data_structures_correct/BACKLASH.js @@ -0,0 +1,21 @@ +function BACKLASH() { + BACKLASH.prototype.define = function BACKLASH() { + + var exprs = new ScilabString(["0"], ["1"], ["1"]); + var model = scicos_model(); + model.sim = list(new ScilabString(["backlash"]), new ScilabDouble([4])); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.rpar = new ScilabDouble([0], [1]); + model.nzcross = new ScilabDouble([2]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"BACKLASH\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x) + } + BACKLASH.prototype.details = function BACKLASH() { + return this.x; + } +} diff --git a/data_structures_correct/BARXY.js b/data_structures_correct/BARXY.js new file mode 100644 index 0000000..51d9dfc --- /dev/null +++ b/data_structures_correct/BARXY.js @@ -0,0 +1,30 @@ +function BARXY() { + + BARXY.prototype.define = function BARXY() { + + var model = scicos_model(); + this.xmin = -15; + this.xmax = 15; + this.ymin = -15; + this.ymax = 15; + + model.sim = list(new ScilabString(["BARXY_sim"]), new ScilabDouble([5])); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([true, false]); + model.in = new ScilabDouble([-1], [-1]); + model.intyp = new ScilabDouble([1]); + model.out = new ScilabDouble(); + model.evtin = new ScilabDouble([1]); + model.rpar = new ScilabDouble([xmin], [xmax], [ymin], [ymax]); + model.ipar = new ScilabDouble([1]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, [], []); + this.x.graphics.in_implicit = new ScilabString(["E", , "E"]); + this.x.graphics.out_implicit = new ScilabDouble(); + this.x.graphics.exprs = new ScilabString(["-15"], ["15"], ["-15"], ["15"], ["1"]); + return new BasicBlock(this.x); + } + BARXY.prototype.details = function BARXY() { + return this.x; + } + +} diff --git a/data_structures_correct/BIGSOM_f.js b/data_structures_correct/BIGSOM_f.js new file mode 100644 index 0000000..7a4627a --- /dev/null +++ b/data_structures_correct/BIGSOM_f.js @@ -0,0 +1,27 @@ +function BIGSOM_f() { + + BIGSOM_f.prototype.define = function BIGSOM_f() { + this.sgn = [ + [1], + [1] + ]; + + var model = scicos_model(); + model.sim = list(new ScilabString(["sum"]), new ScilabDouble([2])); + model.in = new ScilabDouble([-1], [-1]); + model.out = new ScilabDouble([-1]); + model.rpar = new ScilabDouble(...this.sgn); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.sgn)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"BIGSOM_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 3]), model, exprs, gr_i); + this.x.graphics.style = new ScilabString(["BIGSOM_f"]); + return new BigSom(this.x); + } + BIGSOM_f.prototype.details = function BIGSOM_f() { + return this.x; + } +} diff --git a/data_structures_correct/BOUNCE.js b/data_structures_correct/BOUNCE.js new file mode 100644 index 0000000..427b00a --- /dev/null +++ b/data_structures_correct/BOUNCE.js @@ -0,0 +1,50 @@ +function BOUNCE() { + + + var n = 2; + + var k = 0; + var ipar=[]; + + for(var i=1; i<=n; i++) + { + for(var j=i+1; j<=n ;j++) + { + ipar[k]=[i]; + k++; + ipar[k]=[j]; + k++; + } + } + + var walls=[[0],[5],[0],[5]]; + var x=[[2],[2.5]]; + var xd=[[0],[0]]; + var y=[[3],[5]]; + var yd=[[0],[0]]; + var g=9.81; + var C=0; + var rpar1=ones(n,1); + var rpar2=rpar1; + var state=[x,xd,y,yd]; + console.log(math.transpose([[1, 4], [2, 5], [3, 6]])); + state=math.transpose(state); + + var model=scicos_model(); + model.sim=list(new ScilabString(["bounce_ball"]),new ScilabDouble([4])); + model.in=new ScilabDouble(); + model.out=new ScilabDouble([n],[n]); + model.state=new ScilabDouble(...state); + model.rpar=new ScilabDouble(...rpar1,...rpar2,...walls,[g],[C]); + model.ipar=new ScilabDouble(...ipar); + model.nzcross=new ScilabDouble([n*(n-1)/2+4*n]); + model.blocktype=new ScilabString(["c"]); + model.dep_ut=new ScilabBoolean([false,true]); + + var exprs=new ScilabString(); + // var exprs=[strcat(sci2exp(rpar1));strcat(sci2exp(rpar2));strcat(sci2exp(walls));strcat(sci2exp(x));strcat(sci2exp(xd));strcat(sci2exp(y));strcat(sci2exp(yd))] + var gr_i=new ScilabString(["xstringb(orig(1),orig(2),\"BOUNCE\",sz(1),sz(2));"]); + this.x=new standard_define(new ScilabDouble([3,2]),model,exprs,gr_i); + + return new BasicBlock(this.x); +}
\ No newline at end of file diff --git a/data_structures_correct/Bache.js b/data_structures_correct/Bache.js new file mode 100644 index 0000000..5a2585c --- /dev/null +++ b/data_structures_correct/Bache.js @@ -0,0 +1,46 @@ +function Bache() { + + Bache.prototype.define = function Bache() { + this.in1 = 2; + this.out = 3; + + var model = scicos_model(); + model.in = new ScilabDouble(math.transpose(math.range(-1, -this.in1, -1, true))); + model.out = new ScilabDouble(math.transpose(math.range(-1, -this.out, -1, true))); + + this.Patm = 1.013E5; + this.A = 1; + this.ze1 = 40; + this.ze2 = 0; + this.zs1 = 40; + this.zs2 = 0; + this.z0 = 30; + this.T0 = 290; + this.p_rho = 0; + + model.rpar = new ScilabDouble([this.Patm], [this.A], [this.ze1], [this.ze2], [this.zs1], [this.zs2], [this.z0], [this.T0], [this.p_rho]); + model.sim = new ScilabString(["Bache"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["Bache"]); + mo.inputs = new ScilabString(["Ce1", "Ce2"]); + mo.outputs = new ScilabString(["Cs1", "Cs2", "yNiveau"]); + mo.parameters = list(new ScilabString(["Patm"], ["A"], ["ze1"], ["ze2"], ["zs1"], ["zs2"], ["z0"], ["T0"], ["p_rho"]), new ScilabDouble([this.Patm], [this.A], [this.ze1], [this.ze2], [this.zs1], [this.zs2], [this.z0], [this.T0], [this.p_rho])); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(getData(mo.inputs), '*'), 1)); + model.out = new ScilabDouble(...ones(size(getData(mo.outputs), '*'), 1)); + + var exprs = new ScilabString([this.Patm.toString()], [this.A.toString()], [this.ze1.toString()], [this.ze2.toString()], [this.zs1.toString()], [this.zs2.toString()], [this.z0.toString()], [this.T0.toString()], [this.p_rho.toString()]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Bache\",sz(1),sz(2));"]); + this.x = new standard_define([2, 2], model, exprs, list(gr_i, 0)); + this.x.graphics.in_implicit = new ScilabString(["I"], ["I"]); + this.x.graphics.out_implicit = new ScilabString(["I"], ["I"], ["E"]); + return new BasicBlock(this.x); + } + Bache.prototype.details = function Bache() { + return this.x; + } +} diff --git a/data_structures_correct/CFSCOPE.js b/data_structures_correct/CFSCOPE.js new file mode 100644 index 0000000..16ee3e5 --- /dev/null +++ b/data_structures_correct/CFSCOPE.js @@ -0,0 +1,43 @@ +function CFSCOPE() { + + CFSCOPE.prototype.define = function CFSCOPE() { + this.win = -1; + this.wdim = [ + [600], + [400] + ]; + this.wpos = [ + [-1], + [-1] + ]; + this.clrs = [ + [1], + [3], + [5], + [7], + [9], + [11], + [13], + [15] + ]; + this.N = 2; + this.ymin = -15; + this.ymax = 15; + this.per = 30; + var model = scicos_model(); + model.sim = list(new ScilabString(["cfscope"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.rpar = new ScilabDouble([0], [this.ymin], [this.ymax], [this.per]); + model.ipar = new ScilabDouble([this.win], [1], [this.N], ...this.clrs, ...this.wpos, ...this.wdim, [1], [1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + var exprs = new ScilabString([this.clrs.toString().replace(/,/g, " ")], [this.win], [sci2exp([])], [sci2exp(this.wdim)], [this.ymin], [this.ymax], [this.per], [this.N], [1]); + var gr_i = list(new ScilabString(["xstringb(orig(1),orig(2),\"CFSCOPE\",sz(1),sz(2));"]), new ScilabDouble([8])); + this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 2 -> 80 + this.x.graphics.style = new ScilabString(["CFSCOPE"]); + return new BasicBlock(this.x); + } + CFSCOPE.prototype.details = function CFSCOPE() { + return this.x; + } +} diff --git a/data_structures_correct/CLOCK_c.js b/data_structures_correct/CLOCK_c.js new file mode 100644 index 0000000..1284626 --- /dev/null +++ b/data_structures_correct/CLOCK_c.js @@ -0,0 +1,79 @@ +function CLOCK_c() { + CLOCK_c.prototype.define = function CLOCK_c() { + var evtdly = new EVTDLY_c().internal(); + evtdly.graphics.orig = new ScilabDouble([320, 232]); + evtdly.graphics.sz = new ScilabDouble([40, 40]); + evtdly.graphics.flip = new ScilabBoolean([true]); + evtdly.graphics.exprs = new ScilabString(["0.1"], ["0.1"]); + evtdly.graphics.pein = new ScilabDouble([6]); + evtdly.graphics.peout = new ScilabDouble([3]); + evtdly.model.rpar = new ScilabDouble([0.1], [0.1]); + evtdly.model.firing = new ScilabDouble([0.1]); + + evtdly.model.uid = new ScilabString([count]); // changed + evtdly.doc = list(new ScilabString([count++])); + evtdly.model.evtin = new ScilabDouble([-1]); + evtdly.model.evtout = new ScilabDouble([-1]); + evtdly.graphics.peout = new ScilabDouble([4]); + + var output_port = new CLKOUT_f().internal(); + output_port.graphics.orig = new ScilabDouble([399, 162]); + output_port.graphics.sz = new ScilabDouble([20, 20]); + output_port.graphics.flip = new ScilabBoolean([true]); + output_port.graphics.exprs = new ScilabString(["1"]); + output_port.graphics.pein = new ScilabDouble([5]); + output_port.model.ipar = new ScilabDouble([1]); + + output_port.model.uid = new ScilabString([count]); // changed + output_port.doc = list(new ScilabString([count++])); + + var split = new CLKSPLIT_f().internal(); + split.graphics.orig = new ScilabDouble([380.71066, 172]); + split.graphics.pein = new ScilabDouble([3]); + split.graphics.peout = new ScilabDouble([5], [6]); + split.model.uid = new ScilabString([count]); + split.doc = list(new ScilabString([count++])); + split.graphics.pein = new ScilabDouble([4]); // changed + + var diagram = scicos_diagram(); + diagram.objs.push(output_port); + diagram.objs.push(evtdly); + diagram.objs.push(split); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([340], [340], [380.71]), + yy: new ScilabDouble([226.29], [172], [172]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([2, 1, 0]), + to: new ScilabDouble([3, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([380.71], [399]), + yy: new ScilabDouble([172], [172]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([3, 1, 0]), + to: new ScilabDouble([1, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([380.71], [380.71], [340], [340]), + yy: new ScilabDouble([172], [302], [302], [277.71]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([3, 2, 0]), + to: new ScilabDouble([2, 1, 1]) + })); + this.x = scicos_block(); + this.x.gui = new ScilabString(["CLOCK_c"]); + this.x.graphics.sz = new ScilabDouble([2, 2]); + this.x.graphics.gr_i = new ScilabString([]); + this.x.graphics.peout = new ScilabDouble([0]); + this.x.model.sim = new ScilabString(["csuper"]); + this.x.model.evtout = new ScilabDouble([1]); + this.x.model.blocktype = new ScilabString(["h"]); + this.x.model.firing = new ScilabBoolean([false]); + this.x.model.dep_ut = new ScilabBoolean([false, false]); + this.x.model.rpar = diagram; + return new BasicBlock(this.x); + } + CLOCK_c.prototype.details = function CLOCK_c() { + return this.x; + } +} diff --git a/data_structures_correct/CMSCOPE.js b/data_structures_correct/CMSCOPE.js new file mode 100644 index 0000000..b5d1562 --- /dev/null +++ b/data_structures_correct/CMSCOPE.js @@ -0,0 +1,63 @@ +function CMSCOPE() { + CMSCOPE.prototype.define = function CMSCOPE() { + this.win = -1; + this.in1 = [ + [1], + [1] + ]; + this.wdim = [ + [-1], + [-1] + ]; + this.wpos = [ + [-1], + [-1] + ]; + this.clrs = [ + [1], + [3], + [5], + [7], + [9], + [11], + [13], + [15] + ]; + this.N = 20; + this.ymin = [ + [-1], + [-5] + ]; + this.ymax = [ + [1], + [5] + ]; + this.per = [ + [30], + [30] + ]; + this.yy = [...transpose(this.ymin), ...transpose(this.ymax)]; + this.period = transpose(this.per); + + + var model = scicos_model(); + model.sim = list(new ScilabString(["cmscope"]), new ScilabDouble([4])); + model.in = new ScilabDouble(...this.in1); + model.in2 = new ScilabDouble([1], [1]); + model.intyp = new ScilabDouble([1], [1]); + model.evtin = new ScilabDouble([1]); + model.rpar = new ScilabDouble([0], ...colon_operator(this.period), ...colon_operator(this.yy)); + model.ipar = new ScilabDouble([this.win], [this.in1.length], [this.N], ...this.wpos, ...this.wdim, ...this.in1, this.clrs[0], this.clrs[1]); + + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + var exprs = new ScilabString([this.in1.toString().replace(/,/g, " ")], [this.clrs.toString().replace(/,/g, " ")], [this.win], [sci2exp([])], [sci2exp([])], [this.ymin.toString().replace(/,/g, " ")], [this.ymax.toString().replace(/,/g, " ")], [this.per.toString().replace(/,/g, " ")], [this.N], [0], [""]); + var gr_i = list(new ScilabString(["xstringb(orig(1),orig(2),\"CMSCOPE\",sz(1),sz(2));"]), new ScilabDouble([8])); + this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 2 -> 80 + this.x.graphics.style = new ScilabString(["CMSCOPE"]); + return new BasicBlock(this.x); + } + CMSCOPE.prototype.details = function CMSCOPE() { + return this.x; + } +} diff --git a/data_structures_correct/CONST_m.js b/data_structures_correct/CONST_m.js new file mode 100644 index 0000000..410fffa --- /dev/null +++ b/data_structures_correct/CONST_m.js @@ -0,0 +1,38 @@ +function CONST_m() { + CONST_m.prototype.get = function CONST_m() { + + var options = { + vec: ["Constant Value", this.c.toString()] + }; + return options; + } + CONST_m.prototype.set = function CONST_m() { + this.c = [arguments[0]["vec"]]; + this.x.model.rpar = new ScilabDouble(); + this.x.graphics.exprs = new ScilabString([sci2exp(this.c)]); + return new BasicBlock(this.x); + } + CONST_m.prototype.define = function CONST_m() { + this.c = [1]; + var model = new scicos_model(); + model.sim = list(new ScilabString(["cstblk4"]), new ScilabDouble([4])); + model.in = new ScilabDouble(); + model.out = new ScilabDouble([this.c.length]); + model.in2 = new ScilabDouble(); + model.out2 = new ScilabDouble([this.c.length]); + model.rpar = new ScilabDouble(this.c); + model.opar = list(); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONST_m\",sz(1),sz(2));"]); + var exprs = new ScilabString([sci2exp(this.c)]); + this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 1 -> 80 + this.x.graphics.style = new ScilabString(["CONST_m"]); + return new BasicBlock(this.x); + } + CONST_m.prototype.details = function CONST_m() { + return this.x; + + } +} diff --git a/data_structures_correct/EVTDLY_c.js b/data_structures_correct/EVTDLY_c.js new file mode 100644 index 0000000..16e5101 --- /dev/null +++ b/data_structures_correct/EVTDLY_c.js @@ -0,0 +1,49 @@ +function EVTDLY_c() { + + EVTDLY_c.prototype.internal = function() { + var dt = 0.1; + var ff = 0.0; + var model = scicos_model(); + model.sim = list(new ScilabString(["evtdly4"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar = new ScilabDouble([dt], [ff]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([ff]); + model.dep_ut = new ScilabBoolean([false, false]); + // changed + model.outtyp = new ScilabDouble(); + var exprs = new ScilabString([dt], [ff]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_c\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 3,2 -> 80 + block.graphics.style = new ScilabString(["EVTDLY_c"]); + return block; + + } + + EVTDLY_c.prototype.define = function EVTDLY_C() { + this.dt = 0.1; + this.ff = 0.0; + var model = scicos_model(); + model.sim = list(new ScilabString(["evtdly4"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar = new ScilabDouble([this.dt], [this.ff]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([this.ff]); + model.dep_ut = new ScilabBoolean([false, false]); + // changed + model.outtyp = new ScilabDouble(); + var exprs = new ScilabString([this.dt], [this.ff]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_c\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 3,2 -> 80 + this.x.graphics.style = new ScilabString(["EVTDLY_c"]); + return new BasicBlock(this.x); + + } + + EVTDLY_c.prototype.details = function EVTDLY_c() { + + return this.x; + } +} diff --git a/data_structures_correct/IFTHEL_f.js b/data_structures_correct/IFTHEL_f.js new file mode 100644 index 0000000..ff1a229 --- /dev/null +++ b/data_structures_correct/IFTHEL_f.js @@ -0,0 +1,60 @@ +function IFTHEL_f() { + + IFTHEL_f.prototype.internal = function() { + var model = scicos_model(); + model.sim = list(new ScilabString(["ifthel"]), new ScilabDouble([-1])); + model.in = new ScilabDouble([1]); + model.in2 = new ScilabDouble([1]); + model.intyp = new ScilabDouble([-1]); + model.evtin = new ScilabDouble([-1]); + model.outtyp = new ScilabDouble(); // changed + model.evtout = new ScilabDouble([-1], [-1]) // 1, 1 -> -1, -1 inverse + model.blocktype = new ScilabString(["l"]); + model.firing = new ScilabDouble([-1], [-1]); // inverse + model.dep_ut = new ScilabBoolean([true, false]); + model.nmode = new ScilabDouble([1]); + model.nzcross = new ScilabDouble([1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IFTHEL_f\",sz(1),sz(2));"]); + var exprs = new ScilabString(["1"], ["1"]); // value model.in, model.nmode inverse + + var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 3 -> 80 + block.graphics.in_implicit = new ScilabString(["E"]); + // changed + block.graphics.in_label = new ScilabString([""]); + block.graphics.in_style = new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]); + block.graphics.style = new ScilabString(["IFTHEL_f"]); + return block; + } + + IFTHEL_f.prototype.define = function IFTHEL_F() { + var model = scicos_model(); + model.sim = list(new ScilabString(["ifthel"]), new ScilabDouble([-1])); + model.in = new ScilabDouble([1]); + model.in2 = new ScilabDouble([1]); + model.intyp = new ScilabDouble([-1]); + model.evtin = new ScilabDouble([-1]); + model.outtyp = new ScilabDouble(); // changed + model.evtout = new ScilabDouble([-1], [-1]) // 1, 1 -> -1, -1 inverse + model.blocktype = new ScilabString(["l"]); + model.firing = new ScilabDouble([-1], [-1]); // inverse + model.dep_ut = new ScilabBoolean([true, false]); + model.nmode = new ScilabDouble([1]); + model.nzcross = new ScilabDouble([1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IFTHEL_f\",sz(1),sz(2));"]); + var exprs = new ScilabString(["1"], ["1"]); // value model.in, model.nmode inverse + + this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 3 -> 80 + this.x.graphics.in_implicit = new ScilabString(["E"]); + // changed + this.x.graphics.in_label = new ScilabString([""]); + this, x.graphics.in_style = new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]); + this.x.graphics.style = new ScilabString(["IFTHEL_f"]); + return new BasicBlock(this.x); + } + + IFTHEL_f.prototype.details = function IFTHEL_F() { + return this.x; + } +} diff --git a/dependencies.js b/dependencies.js new file mode 100644 index 0000000..c662af0 --- /dev/null +++ b/dependencies.js @@ -0,0 +1,240 @@ +var dir = ["data_structures_correct"]; +var fileextension = "."; + +$.each(dir, function(index, value) { + $.ajax({ // http://stackoverflow.com/a/18480589 + url: value, + success: function(data) { + $(data).find("a:contains(" + fileextension + ")").each(function() { + var filename = this.href.replace(window.location.host, ""); + filename = filename.replace("https://", value); + filename = filename.replace("http://", value); + var script = document.createElement("script"); + script.src = filename; + document.head.appendChild(script); + }); + } + }); +}); + +function AfficheBlock() { + if (arguments.length > 0) { + var options = arguments[0]; + this.angle = options.angle; // Not Known + this.blockType = getData(options.model.blocktype)[0]; + this.connectable = options.connectable; // Not Known + var dep_ut = getData(options.model.dep_ut); + if (dep_ut[0] == "true") + this.dependsOnU = "1"; + if (dep_ut[1] == "true") + this.dependsOnT = "1"; + this.id = options.id; + this.interfaceFunctionName = arguments.callee.caller.name; + this.ordering = options.ordering; + this.parent = options.parent; + if (options.model.sim instanceof Array) { + this.simulationFunctionName = getData(options.model.sim[0])[0]; + var func_type; + switch (getData(options.model.sim[1])[0].toString()) { + case "-2.0": + func_type = "ESELECT"; + break; + case "-1.0": + func_type = "IFTHENELSE"; + break; + case "1.0": + func_type = "TYPE_1"; + break; + case "2.0": + func_type = "TYPE_2"; + break; + case "3.0": + func_type = "TYPE_3"; + break; + case "4.0": + func_type = "C_OR_FORTRAN"; + break; + case "5.0": + func_type = "SCILAB"; + break; + case "99.0": + func_type = "DEBUG"; + break; + case "1001.0": + func_type = "DYNAMIC_FORTRAN_1"; + break; + case "2001.0": + func_type = "DYNAMIC_C_1"; + break; + case "2004.0": + func_type = "DYNAMIC_EXPLICIT_4"; + break; + case "10001.0": + func_type = "OLDBLOCKS"; + break; + case "10004.0": + func_type = "IMPLICIT_C_OR_FORTRAN"; + break; + case "30004.0": + func_type = "MODELICA"; + break; + } + this.simulationFunctionType = func_type; + } else { + this.simulationFunctionName = getData(options.model.sim)[0]; + this.simulationFunctionType = "DEFAULT"; + } + this.style = arguments.callee.caller.name; + this.value = options.value; // Not Known + this.vertex = options.vertex; // Not Known + this.visible = options.visible; // Not Known + this.exprs = options.graphics.exprs; + this.realParameters = options.model.rpar; + this.integerParameters = options.model.ipar; + this.objectsParameters = options.model.opar; + this.nbZerosCrossing = options.model.nzcross; + this.nmode = options.model.nmode; + this.dState = options.model.dstate; + this.oDState = list(); + this.equations = list(); // Not Known + this.blockName = "AfficheBlock"; + this.blockElementName = arguments.callee.caller.name; + } +} + +function BigSom() { + if (arguments.length > 0) { + var options = arguments[0]; + + var dep_ut = getData(options.model.dep_ut); + if (dep_ut[0] == "true") + this.dependsOnU = "1"; + + this.id = options.id; + this.interfaceFunctionName = arguments.callee.caller.name; + this.ordering = options.ordering; + this.parent = options.parent; + if (options.model.sim instanceof Array) { + this.simulationFunctionName = getData(options.model.sim[0])[0]; + var func_type; + switch (getData(options.model.sim[1])[0].toString()) { + case "-2.0": + func_type = "ESELECT"; + break; + case "-1.0": + func_type = "IFTHENELSE"; + break; + case "1.0": + func_type = "TYPE_1"; + break; + case "2.0": + func_type = "TYPE_2"; + break; + case "3.0": + func_type = "TYPE_3"; + break; + case "4.0": + func_type = "C_OR_FORTRAN"; + break; + case "5.0": + func_type = "SCILAB"; + break; + case "99.0": + func_type = "DEBUG"; + break; + case "1001.0": + func_type = "DYNAMIC_FORTRAN_1"; + break; + case "2001.0": + func_type = "DYNAMIC_C_1"; + break; + case "2004.0": + func_type = "DYNAMIC_EXPLICIT_4"; + break; + case "10001.0": + func_type = "OLDBLOCKS"; + break; + case "10004.0": + func_type = "IMPLICIT_C_OR_FORTRAN"; + break; + case "30004.0": + func_type = "MODELICA"; + break; + } + this.simulationFunctionType = func_type; + } else { + this.simulationFunctionName = getData(options.model.sim)[0]; + this.simulationFunctionType = "DEFAULT"; + } + this.style = arguments.callee.caller.name; + this.value = "+"; // Not Known + this.exprs = options.graphics.exprs; + this.realParameters = options.model.rpar; + this.integerParameters = options.model.ipar; + this.objectsParameters = options.model.opar; + this.nbZerosCrossing = options.model.nzcross; + this.nmode = options.model.nmode; + this.oDState = list(); + this.equations = list(); // Not Known + this.blockName = "BigSom"; + this.blockElementName = arguments.callee.caller.name; + } +} + + +function zeros() { + if (arguments.length == 0) { + return [0]; + } else if (arguments.length == 1) { + var a = arguments[0]; + if (typeof a.length === 'undefined') { + return [0]; + } else { + return math.zeros(math.size(a)); + } + } else { + var args = Array.prototype.slice.call(arguments); + return math.zeros(args); + } +} + +function ones() { + if (arguments.length == 0) { + return [1]; + } else if (arguments.length == 1) { + var a = arguments[0]; + if (typeof a.length === 'undefined') { + return [1]; + } else { + return math.ones(math.size(a)); + } + } else { + var args = Array.prototype.slice.call(arguments); + return math.ones(args); + } +} + +function size() { + + if (arguments.length == 1) + return math.size(arguments[0]) + else { + var res = math.size(arguments[0]); + + if (res.length == 1) + res.push(1); + + switch (arguments[1]) { + case 'r': + case 1: + return res[0]; + case 'c': + case 2: + return res[1]; + case '*': + return res[0] * res[1]; + default: + return res[arguments[1]]; + } + } +}
\ No newline at end of file @@ -4,6 +4,9 @@ /* Authors: Adhitya, Nimish, Chhavi, Saarang */ +var script = document.createElement("script"); +script.src = "dependencies.js"; +document.head.appendChild(script); var count = 1; function scicos_block() { @@ -302,11 +305,13 @@ function getData() { } function modelica() { - var model = []; - var inputs = []; - var outputs = []; - var parameters = list([], list()); - var mo = tlist(["modelica", "model", "inputs", "outputs", "parameters"], model, inputs, outputs, parameters); + var modelica_type = ["modelica", "model", "inputs", "outputs", "parameters"]; + this.modelica = new ScilabString(modelica_type); + this.model = []; + this.inputs = []; + this.outputs = []; + this.parameters = list([], list()); + var mo = tlist(modelica_type, this.modelica, this.model, this.inputs, this.outputs, this.parameters); return mo; } @@ -319,493 +324,74 @@ function createInstanceTag() { return new instance(arguments[0]); } -function CONST_m() { - CONST_m.prototype.get = function() { - var options = { - vec: ["Constant Value", this.c.toString()] - }; - return options; - } - CONST_m.prototype.set = function() { - this.c = [arguments[0]["vec"]]; - this.x.model.rpar = new ScilabDouble(); - this.x.graphics.exprs = new ScilabString([sci2exp(this.c)]); - return new BasicBlock(this.x); - } - CONST_m.prototype.define = function() { - this.c = [1]; - var model = new scicos_model(); - model.sim = list(new ScilabString(["cstblk4"]), new ScilabDouble([4])); - model.in = new ScilabDouble(); - model.out = new ScilabDouble([this.c.length]); - model.in2 = new ScilabDouble(); - model.out2 = new ScilabDouble([this.c.length]); - model.rpar = new ScilabDouble(this.c); - model.opar = list(); +function CLKIN_f() { + + CLKIN_f.prototype.internal = function() { + var model = scicos_model(); + var port = 1; + + model.sim = new ScilabString(["input"]); + model.outtyp = new ScilabDouble(); //changed + model.evtout = new ScilabDouble([-1]); // 1, 1 -> -1, -1 + model.ipar = new ScilabDouble([port]); model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1]); model.dep_ut = new ScilabBoolean([false, false]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONST_m\",sz(1),sz(2));"]); - var exprs = new ScilabString([sci2exp(this.c)]); - this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 1 -> 80 - this.x.graphics.style = new ScilabString(["CONST_m"]); - return new BasicBlock(this.x); - } - CONST_m.prototype.details = function() { - return this.x; + var exprs = new ScilabString([port]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKIN_f\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 1 -> 80 + block.graphics.style = new ScilabString(["CLKIN_f"]); + return block; } } -function ANDLOG_f() { - - var model = scicos_model(); - model.sim = new ScilabString(["andlog"]); - model.out = new ScilabDouble([1]); - model.out2 = new ScilabDouble([1]); // null -> 1 - model.evtin = new ScilabDouble([-1], [-1]); // 1, 1 -> -1, -1 - model.blocktype = new ScilabString(["d"]); - model.firing = new ScilabDouble(); - model.dep_ut = new ScilabBoolean([false, false]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ANDLOG_f\",sz(1),sz(2));"]); - var block = new standard_define(new ScilabDouble([80, 80]), model, new ScilabDouble(), gr_i); // 3 -> 80 - - // Style - block.graphics.out_implicit = new ScilabString(["E"]); - // changed - block.graphics.out_label = new ScilabString([""]); - block.graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]); - block.graphics.style = new ScilabString(["ANDLOG_f"]); - return block; -} - -function ANDBLK() { - - ANDBLK.prototype.define = function() { - - var andlog = ANDLOG_f("define"); - andlog.graphics.orig = new ScilabDouble([194, 133]); - andlog.graphics.sz = new ScilabDouble([60, 60]); - andlog.graphics.flip = new ScilabBoolean([true]); - andlog.graphics.pout = new ScilabDouble([9]); - andlog.graphics.pein = new ScilabDouble([4], [11]); - andlog.model.uid = new ScilabString([count]); - andlog.doc = list(new ScilabString([count++])); - - var input_port1 = CLKIN_f("define"); - input_port1.graphics.orig = new ScilabDouble([149, 287]); - input_port1.graphics.sz = new ScilabDouble([20, 20]); - input_port1.graphics.flip = new ScilabBoolean([true]); - input_port1.graphics.exprs = new ScilabString(["1"]); - input_port1.graphics.peout = new ScilabDouble([4]); - input_port1.model.ipar = new ScilabDouble([1]); - input_port1.model.uid = new ScilabString([count]); - input_port1.doc = list(new ScilabString([count++])); - - var output_port = CLKOUT_f("define"); - output_port.graphics.orig = new ScilabDouble([450, 83]); - output_port.graphics.sz = new ScilabDouble([20, 20]); - output_port.graphics.flip = new ScilabBoolean([true]); - output_port.graphics.exprs = new ScilabString(["1"]); - output_port.graphics.pein = new ScilabDouble([8]); - output_port.model.ipar = new ScilabDouble([1]); - output_port.model.uid = new ScilabString([count]); - output_port.doc = list(new ScilabString([count++])); - - var input_port2 = CLKIN_f("define"); - input_port2.graphics.orig = new ScilabDouble([141, 330]); - input_port2.graphics.sz = new ScilabDouble([20, 20]); - input_port2.graphics.flip = new ScilabBoolean([true]); - input_port2.graphics.exprs = new ScilabString(["2"]); - input_port2.graphics.peout = new ScilabDouble([6]); - input_port2.model.ipar = new ScilabDouble([2]); - input_port2.model.uid = new ScilabString([count]); - input_port2.doc = list(new ScilabString([count++])); - - var ifthel = IFTHEL_f("define"); - ifthel.graphics.orig = new ScilabDouble([331, 137]); - ifthel.graphics.sz = new ScilabDouble([60, 60]); - ifthel.graphics.flip = new ScilabBoolean([true]); - ifthel.graphics.pin = new ScilabDouble([9]); - ifthel.graphics.pein = new ScilabDouble([12]); - ifthel.graphics.peout = new ScilabDouble([8], [0]); - ifthel.model.uid = new ScilabString([count]); - ifthel.doc = list(new ScilabString([count++])); - - - var split = CLKSPLIT_f("define"); - split.graphics.orig = new ScilabDouble([234, 275.78348]); - split.graphics.pein = new ScilabDouble([6]); - split.graphics.peout = new ScilabDouble([11], [12]); - split.model.uid = new ScilabString([count]); - split.doc = list(new ScilabString([count++])); - - var diagram = scicos_diagram(); - diagram.objs.push(andlog); - diagram.objs.push(input_port1); - diagram.objs.push(output_port); - diagram.objs.push(input_port2); - diagram.objs.push(ifthel); - diagram.objs.push(split); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([169], [214], [214]), - yy: new ScilabDouble([297], [297], [198.71]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([2, 1, 0]), - to: new ScilabDouble([1, 1, 1]) - })); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([161], [234], [234]), - yy: new ScilabDouble([340], [340], [275.78]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([4, 1, 0]), - to: new ScilabDouble([6, 1, 1]) - })); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([351], [351], [450]), - yy: new ScilabDouble([131.29], [93], [93]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([5, 1, 0]), - to: new ScilabDouble([3, 1, 1]) - })); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([262.57], [322.43]), - yy: new ScilabDouble([163], [167]), - ct: new ScilabDouble([1, 1]), - from: new ScilabDouble([1, 1, 0]), - to: new ScilabDouble([5, 1, 1]) - })); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([234], [234]), - yy: new ScilabDouble([275.78], [198.71]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([6, 1, 0]), - to: new ScilabDouble([1, 2, 1]) - })); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([234], [361], [361]), - yy: new ScilabDouble([275.78], [275.78], [202.71]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([6, 2, 0]), - to: new ScilabDouble([5, 1, 1]) - })); - this.x = scicos_block(); - this.x.gui = new ScilabString(["ANDBLK"]); - this.x.graphics.sz = new ScilabDouble([2, 2]); - this.x.graphics.gr_i = new ScilabDouble(); - this.x.graphics.pein = new ScilabDouble([0, 0]); - this.x.graphics.peout = new ScilabDouble([0]); - this.x.model.sim = new ScilabString(["csuper"]); - this.x.model.evtin = new ScilabDouble([1, 1]); - this.x.model.evtout = new ScilabDouble([1]); - this.x.model.blocktype = new ScilabString(["h"]); - this.x.model.firing = new ScilabBoolean([false]); - this.x.model.dep_ut = new ScilabBoolean([false, false]); - this.x.model.rpar = diagram; - return new BasicBlock(this.x); - } - ANDBLK.prototype.details = function() { - return this.x; - } - -} - - +function CLKOUT_f() { -function CFSCOPE() { - - CFSCOPE.prototype.define = function() { - this.win = -1; - this.wdim = [ - [600], - [400] - ]; - this.wpos = [ - [-1], - [-1] - ]; - this.clrs = [ - [1], - [3], - [5], - [7], - [9], - [11], - [13], - [15] - ]; - this.N = 2; - this.ymin = -15; - this.ymax = 15; - this.per = 30; + CLKOUT_f.prototype.internal = function() { var model = scicos_model(); - model.sim = list(new ScilabString(["cfscope"]), new ScilabDouble([4])); - model.evtin = new ScilabDouble([1]); - model.rpar = new ScilabDouble([0], [this.ymin], [this.ymax], [this.per]); - model.ipar = new ScilabDouble([this.win], [1], [this.N], ...this.clrs, ...this.wpos, ...this.wdim, [1], [1]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - var exprs = new ScilabString([this.clrs.toString().replace(/,/g, " ")], [this.win], [sci2exp([])], [sci2exp(this.wdim)], [this.ymin], [this.ymax], [this.per], [this.N], [1]); - var gr_i = list(new ScilabString(["xstringb(orig(1),orig(2),\"CFSCOPE\",sz(1),sz(2));"]), new ScilabDouble([8])); - this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 2 -> 80 - this.x.graphics.style = new ScilabString(["CFSCOPE"]); - return new BasicBlock(this.x); - } - CFSCOPE.prototype.details = function() { - return this.x; - } -} - -function CMSCOPE() { - CMSCOPE.prototype.define = function() { - this.win = -1; - this.in1 = [ - [1], - [1] - ]; - this.wdim = [ - [-1], - [-1] - ]; - this.wpos = [ - [-1], - [-1] - ]; - this.clrs = [ - [1], - [3], - [5], - [7], - [9], - [11], - [13], - [15] - ]; - this.N = 20; - this.ymin = [ - [-1], - [-5] - ]; - this.ymax = [ - [1], - [5] - ]; - this.per = [ - [30], - [30] - ]; - this.yy = [...transpose(this.ymin), ...transpose(this.ymax)]; - this.period = transpose(this.per); + var port = 1; + model.sim = new ScilabString(["output"]); + model.outtyp = new ScilabDouble(); + model.evtin = new ScilabDouble([-1]); // 1, 1 -> -1, -1 + model.ipar = new ScilabDouble([port]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([false, false]); - var model = scicos_model(); - model.sim = list(new ScilabString(["cmscope"]), new ScilabDouble([4])); - model.in = new ScilabDouble(...this.in1); - model.in2 = new ScilabDouble([1], [1]); - model.intyp = new ScilabDouble([1], [1]); - model.evtin = new ScilabDouble([1]); - model.rpar = new ScilabDouble([0], ...colon_operator(this.period), ...colon_operator(this.yy)); - model.ipar = new ScilabDouble([this.win], [this.in1.length], [this.N], ...this.wpos, ...this.wdim, ...this.in1, this.clrs[0], this.clrs[1]); - - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - var exprs = new ScilabString([this.in1.toString().replace(/,/g, " ")], [this.clrs.toString().replace(/,/g, " ")], [this.win], [sci2exp([])], [sci2exp([])], [this.ymin.toString().replace(/,/g, " ")], [this.ymax.toString().replace(/,/g, " ")], [this.per.toString().replace(/,/g, " ")], [this.N], [0], [""]); - var gr_i = list(new ScilabString(["xstringb(orig(1),orig(2),\"CMSCOPE\",sz(1),sz(2));"]), new ScilabDouble([8])); - this.x = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 2 -> 80 - this.x.graphics.style = new ScilabString(["CMSCOPE"]); - return new BasicBlock(this.x); - } - CMSCOPE.prototype.details = function() { - return this.x; - } -} + var exprs = ScilabString(["" + port]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKOUT_f\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 1 -> 80 -function CLOCK_c() { - CLOCK_c.prototype.define = function() { - var evtdly = EVTDLY_c("define"); - evtdly.graphics.orig = new ScilabDouble([320, 232]); - evtdly.graphics.sz = new ScilabDouble([40, 40]); - evtdly.graphics.flip = new ScilabBoolean([true]); - evtdly.graphics.exprs = new ScilabString(["0.1"], ["0.1"]); - evtdly.graphics.pein = new ScilabDouble([6]); - evtdly.graphics.peout = new ScilabDouble([3]); - evtdly.model.rpar = new ScilabDouble([0.1], [0.1]); - evtdly.model.firing = new ScilabDouble([0.1]); - - evtdly.model.uid = new ScilabString([count]); // changed - evtdly.doc = list(new ScilabString([count++])); - evtdly.model.evtin = new ScilabDouble([-1]); - evtdly.model.evtout = new ScilabDouble([-1]); - evtdly.graphics.peout = new ScilabDouble([4]); - - var output_port = CLKOUT_f("define"); - output_port.graphics.orig = new ScilabDouble([399, 162]); - output_port.graphics.sz = new ScilabDouble([20, 20]); - output_port.graphics.flip = new ScilabBoolean([true]); - output_port.graphics.exprs = new ScilabString(["1"]); - output_port.graphics.pein = new ScilabDouble([5]); - output_port.model.ipar = new ScilabDouble([1]); - - output_port.model.uid = new ScilabString([count]); // changed - output_port.doc = list(new ScilabString([count++])); - - var split = CLKSPLIT_f("define"); - split.graphics.orig = new ScilabDouble([380.71066, 172]); - split.graphics.pein = new ScilabDouble([3]); - split.graphics.peout = new ScilabDouble([5], [6]); - split.model.uid = new ScilabString([count]); - split.doc = list(new ScilabString([count++])); - split.graphics.pein = new ScilabDouble([4]); // changed - - var diagram = scicos_diagram(); - diagram.objs.push(output_port); - diagram.objs.push(evtdly); - diagram.objs.push(split); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([340], [340], [380.71]), - yy: new ScilabDouble([226.29], [172], [172]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([2, 1, 0]), - to: new ScilabDouble([3, 1, 1]) - })); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([380.71], [399]), - yy: new ScilabDouble([172], [172]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([3, 1, 0]), - to: new ScilabDouble([1, 1, 1]) - })); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([380.71], [380.71], [340], [340]), - yy: new ScilabDouble([172], [302], [302], [277.71]), - ct: new ScilabDouble([5, -1]), - from: new ScilabDouble([3, 2, 0]), - to: new ScilabDouble([2, 1, 1]) - })); - this.x = scicos_block(); - this.x.gui = new ScilabString(["CLOCK_c"]); - this.x.graphics.sz = new ScilabDouble([2, 2]); - this.x.graphics.gr_i = new ScilabString([]); - this.x.graphics.peout = new ScilabDouble([0]); - this.x.model.sim = new ScilabString(["csuper"]); - this.x.model.evtout = new ScilabDouble([1]); - this.x.model.blocktype = new ScilabString(["h"]); - this.x.model.firing = new ScilabBoolean([false]); - this.x.model.dep_ut = new ScilabBoolean([false, false]); - this.x.model.rpar = diagram; - return new BasicBlock(this.x); - } - CLOCK_c.prototype.details = function() { - return this.x; + block.graphics.style = new ScilabString(["CLKOUT_f"]); + return block; } } -function EVTDLY_c() { - var dt = 0.1; - var ff = 0.0; - var model = scicos_model(); - model.sim = list(new ScilabString(["evtdly4"]), new ScilabDouble([4])); - model.evtin = new ScilabDouble([1]); - model.evtout = new ScilabDouble([1]); - model.rpar = new ScilabDouble([dt], [ff]); - model.blocktype = new ScilabString(["d"]); - model.firing = new ScilabDouble([ff]); - model.dep_ut = new ScilabBoolean([false, false]); - // changed - model.outtyp = new ScilabDouble(); - var exprs = new ScilabString([dt], [ff]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_c\",sz(1),sz(2));"]); - var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 3,2 -> 80 - block.graphics.style = new ScilabString(["EVTDLY_c"]); - return block; -} +function CLKSPLIT_f() { -function CLKIN_f() { - var model = scicos_model(); - var port = 1; - - model.sim = new ScilabString(["input"]); - model.outtyp = new ScilabDouble(); //changed - model.evtout = new ScilabDouble([-1]); // 1, 1 -> -1, -1 - model.ipar = new ScilabDouble([port]); - model.blocktype = new ScilabString(["d"]); - model.firing = new ScilabDouble([-1]); - model.dep_ut = new ScilabBoolean([false, false]); - - var exprs = new ScilabString([port]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKIN_f\",sz(1),sz(2));"]); - var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 1 -> 80 - - block.graphics.style = new ScilabString(["CLKIN_f"]); - return block; -} + CLKSPLIT_f.prototype.internal = function() { + var model = scicos_model(); + model.sim = new ScilabString(["split"]); + model.evtin = new ScilabDouble([-1]); + model.outtyp = new ScilabDouble(); // changed + model.evtout = new ScilabDouble([-1], [-1]) // 1, 1 -> -1, -1 inverse + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1], [-1]); // inverse + model.dep_ut = new ScilabBoolean([false, false]); -function CLKOUT_f() { - var model = scicos_model(); - var port = 1; - - model.sim = new ScilabString(["output"]); - model.outtyp = new ScilabDouble(); - model.evtin = new ScilabDouble([-1]); // 1, 1 -> -1, -1 - model.ipar = new ScilabDouble([port]); - model.blocktype = new ScilabString(["d"]); - model.firing = new ScilabDouble(); - model.dep_ut = new ScilabBoolean([false, false]); - - var exprs = ScilabString(["" + port]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKOUT_f\",sz(1),sz(2));"]); - var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 1 -> 80 - - block.graphics.style = new ScilabString(["CLKOUT_f"]); - return block; -} + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKSPLIT_f\",sz(1),sz(2));"]); -function CLKSPLIT_f() { - var model = scicos_model(); - model.sim = new ScilabString(["split"]); - model.evtin = new ScilabDouble([-1]); - model.outtyp = new ScilabDouble(); // changed - model.evtout = new ScilabDouble([-1], [-1]) // 1, 1 -> -1, -1 inverse - model.blocktype = new ScilabString(["d"]); - model.firing = new ScilabDouble([-1], [-1]); // inverse - model.dep_ut = new ScilabBoolean([false, false]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKSPLIT_f\",sz(1),sz(2));"]); - - var block = new standard_define(new ScilabDouble([80, 80]), model, new ScilabDouble(), gr_i); // 1 -> 80 - block.graphics.style = new ScilabString(["CLKSPLIT_f"]); - return block; + var block = new standard_define(new ScilabDouble([80, 80]), model, new ScilabDouble(), gr_i); // 1 -> 80 + block.graphics.style = new ScilabString(["CLKSPLIT_f"]); + return block; + } } -function IFTHEL_f() { - var model = scicos_model(); - model.sim = list(new ScilabString(["ifthel"]), new ScilabDouble([-1])); - model.in = new ScilabDouble([1]); - model.in2 = new ScilabDouble([1]); - model.intyp = new ScilabDouble([-1]); - model.evtin = new ScilabDouble([-1]); - model.outtyp = new ScilabDouble(); // changed - model.evtout = new ScilabDouble([-1], [-1]) // 1, 1 -> -1, -1 inverse - model.blocktype = new ScilabString(["l"]); - model.firing = new ScilabDouble([-1], [-1]); // inverse - model.dep_ut = new ScilabBoolean([true, false]); - model.nmode = new ScilabDouble([1]); - model.nzcross = new ScilabDouble([1]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IFTHEL_f\",sz(1),sz(2));"]); - var exprs = new ScilabString(["1"], ["1"]); // value model.in, model.nmode inverse - - var block = new standard_define(new ScilabDouble([80, 80]), model, exprs, gr_i); // 3 -> 80 - block.graphics.in_implicit = new ScilabString(["E"]); - // changed - block.graphics.in_label = new ScilabString([""]); - block.graphics.in_style = new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]); - block.graphics.style = new ScilabString(["IFTHEL_f"]); - return block; -} function BasicBlock() { @@ -883,17 +469,15 @@ function BasicBlock() { this.realParameters = options.model.rpar; this.integerParameters = options.model.ipar; this.objectsParameters = options.model.opar; - this.nbZerosCrossing = new ScilabDouble([0]); - this.nmode = new ScilabDouble([0]); - this.oDState = list(); - this.equations = list(); // Not Known + this.nbZerosCrossing = options.model.nzcross; + this.nmode = options.model.nmode; + this.oDState = options.model.odstate; + this.equations = options.model.equations; this.blockName = "BasicBlock"; this.blockElementName = arguments.callee.caller.name; } } - - function sci2exp(c) { if (c.length == 0) return "[]"; @@ -935,7 +519,7 @@ function colon_operator() { } // Returns ScilabDouble which contains a list with size = n and all values = 0 -function zeros(n) { +/*function zeros(n) { var arg = new Array(n + 1).join("0").split("").map(parseFloat); var port = new ScilabDouble(); var i = 0; @@ -944,4 +528,4 @@ function zeros(n) { port.list.push(arg[0][i]); return port; -} +}*/ diff --git a/finalmodsheet.xsl b/finalmodsheet.xsl index 8d935dc..7c94af2 100644 --- a/finalmodsheet.xsl +++ b/finalmodsheet.xsl @@ -8,7 +8,6 @@ Authors: Maverick & Karma NOTES: Look for TAG:Break1!!! TAG:Break2!!! - TAG:Break3!!! --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="no" /> @@ -117,9 +116,6 @@ Look for TAG:Break1!!! <xsl:when test="@style"> <!-- Style present --> <xsl:choose> - <xsl:when test="@style='BIGSOM_f'"> - <xsl:call-template name="BigSom" /> - </xsl:when> <xsl:when test="@style='ExplicitInputPort'"> <xsl:call-template name="ExplicitInputPort" /> </xsl:when> @@ -152,8 +148,6 @@ Look for TAG:Break1!!! </xsl:otherwise> </xsl:choose> </xsl:when> - - <xsl:when test="@name"> <xsl:choose> <xsl:when test="@name='ExplicitLink'"> @@ -175,7 +169,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="Object" match="Object"> <xsl:element name="Array"> - <xsl:if test="name(..)='BasicBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -203,7 +197,7 @@ Look for TAG:Break1!!! --> <xsl:template name="Array" match="Array"> <xsl:element name="Array"> - <xsl:if test="name(..)='BasicBlock' or @as='context'"> + <xsl:if test="name(..)='BasicBlock' or @as='context' or name(..)='AfficheBlock' or name(..)='BigSom'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -1588,7 +1582,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="ScilabDouble" match="ScilabDouble"> <xsl:element name="ScilabDouble"> - <xsl:if test="name(..)='BasicBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -1620,7 +1614,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="ScilabString" match="ScilabString"> <xsl:element name="ScilabString"> - <xsl:if test="name(..)='BasicBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -2194,6 +2188,6 @@ Look for TAG:Break1!!! <xsl:apply-templates /> </xsl:element> </xsl:template> - <!-- To remove the instance variable in generated Xcos--> + <!-- To remove the instance variable in generated Xcos--> <xsl:template match="mxCell/instance"/> -</xsl:stylesheet> +</xsl:stylesheet>
\ No newline at end of file |