From 73e59c5466c8b4bd216044b2c9b509fec8bffd0d Mon Sep 17 00:00:00 2001 From: Adhitya Kamakshidasan Date: Mon, 11 Jul 2016 21:44:24 +0530 Subject: Fixed style bug for 'Explicit' Blocks --- data_structures_correct/IN_f.js | 6 +++--- data_structures_correct/OUT_f.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'data_structures_correct') diff --git a/data_structures_correct/IN_f.js b/data_structures_correct/IN_f.js index 7527ab6..1a2545a 100644 --- a/data_structures_correct/IN_f.js +++ b/data_structures_correct/IN_f.js @@ -15,7 +15,7 @@ function IN_f () { var exprs = new ScilabString([sci2exp(this.prt)]); var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IN_f\",sz(1),sz(2));"]); - var block=new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i); + var block = new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i); block.graphics.style = new ScilabString(["IN_f"]); // changed block.graphics.out_implicit = new ScilabString(["E"]); block.graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]); @@ -31,14 +31,14 @@ function IN_f () { model.out = new ScilabDouble([-1]); model.out2 = new ScilabDouble([-2]); model.outtyp = new ScilabDouble([-1]); - model.ipar=new ScilabDouble([this.prt]); + model.ipar = new ScilabDouble([this.prt]); model.blocktype = new ScilabString(["c"]); model.dep_ut = new ScilabBoolean([false,false]); var exprs = new ScilabString([sci2exp(this.prt)]); var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IN_f\",sz(1),sz(2));"]); - this.x=new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i); + this.x = new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i); return new ExplicitInBlock(this.x); } diff --git a/data_structures_correct/OUT_f.js b/data_structures_correct/OUT_f.js index 6b65d13..277148c 100644 --- a/data_structures_correct/OUT_f.js +++ b/data_structures_correct/OUT_f.js @@ -9,7 +9,7 @@ function OUT_f () { model.in = new ScilabDouble([-1]); model.in2 = new ScilabDouble([-2]); model.intyp = new ScilabDouble([-1]); - model.ipar=new ScilabDouble([this.prt]); + model.ipar = new ScilabDouble([this.prt]); model.blocktype = new ScilabString(["c"]); model.dep_ut = new ScilabBoolean([false,false]); var exprs = new ScilabString([sci2exp(this.prt)]); -- cgit From bb67fcceece1f3f093d07987f8d950fbe0a2848e Mon Sep 17 00:00:00 2001 From: Adhitya Kamakshidasan Date: Mon, 11 Jul 2016 22:12:46 +0530 Subject: Update ANDLOG_f.js --- data_structures_correct/ANDLOG_f.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data_structures_correct') diff --git a/data_structures_correct/ANDLOG_f.js b/data_structures_correct/ANDLOG_f.js index 0fe3b2f..a1b0c67 100644 --- a/data_structures_correct/ANDLOG_f.js +++ b/data_structures_correct/ANDLOG_f.js @@ -22,7 +22,7 @@ function ANDLOG_f() { return block; } - ANDLOG_f.prototype.define = function ANDLOG() { + ANDLOG_f.prototype.define = function ANDLOG_f() { var model = scicos_model(); model.sim = new ScilabString(["andlog"]); model.out = new ScilabDouble([1]); -- cgit From f3f0a1950215b7ba5131a5ff4b850b833699b2e1 Mon Sep 17 00:00:00 2001 From: Adhitya Kamakshidasan Date: Tue, 12 Jul 2016 00:37:14 +0530 Subject: A bit of beauty --- data_structures_correct/BOUNCEXY.js | 2 +- data_structures_correct/CANIMXY3D.js | 12 +- data_structures_correct/CFSCOPE.js | 2 +- data_structures_correct/CLKFROM.js | 28 ++-- data_structures_correct/CLKGOTO.js | 2 +- data_structures_correct/CLKSOMV_f.js | 2 +- data_structures_correct/CLSS.js | 2 +- data_structures_correct/COSBLK_f.js | 28 ++-- data_structures_correct/CUMSUM.js | 2 +- data_structures_correct/DELAY_f.js | 205 ++++++++++++------------ data_structures_correct/EVTDLY_f.js | 44 ++--- data_structures_correct/FROMWSB.js | 300 +++++++++++++++++------------------ data_structures_correct/GENERAL_f.js | 2 +- data_structures_correct/c_block.js | 3 +- 14 files changed, 318 insertions(+), 316 deletions(-) (limited to 'data_structures_correct') diff --git a/data_structures_correct/BOUNCEXY.js b/data_structures_correct/BOUNCEXY.js index 6a3163c..1fa2ff2 100644 --- a/data_structures_correct/BOUNCEXY.js +++ b/data_structures_correct/BOUNCEXY.js @@ -47,4 +47,4 @@ function BOUNCEXY() { return this.x; } -} \ No newline at end of file +} diff --git a/data_structures_correct/CANIMXY3D.js b/data_structures_correct/CANIMXY3D.js index d806266..0a319e6 100644 --- a/data_structures_correct/CANIMXY3D.js +++ b/data_structures_correct/CANIMXY3D.js @@ -1,12 +1,11 @@ function CANIMXY3D() { CANIMXY3D.prototype.define = function CANIMXY3D() { - - this.win = -1; - this.N = 2; - this.clrs = [[1],[2],[3],[4],[5],[6],[7],[13]]; - this.siz = [[1],[1],[1],[1],[1],[1],[1],[1]]; - this.wpos = [[-1],[-1]]; + this.win = -1; + this.N = 2; + this.clrs = [[1],[2],[3],[4],[5],[6],[7],[13]]; + this.siz = [[1],[1],[1],[1],[1],[1],[1],[1]]; + this.wpos = [[-1],[-1]]; this.wdim = [[-1],[-1]]; this.param3ds = [[50],[280]]; this.vec_x = [[-15],[15]]; @@ -34,7 +33,6 @@ function CANIMXY3D() { } CANIMXY3D.prototype.details = function CANIMXY3D() { - return this.x; } diff --git a/data_structures_correct/CFSCOPE.js b/data_structures_correct/CFSCOPE.js index c2c7991..7be1e41 100644 --- a/data_structures_correct/CFSCOPE.js +++ b/data_structures_correct/CFSCOPE.js @@ -9,7 +9,7 @@ function CFSCOPE() { 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]); diff --git a/data_structures_correct/CLKFROM.js b/data_structures_correct/CLKFROM.js index 9209cb5..eeb78b0 100644 --- a/data_structures_correct/CLKFROM.js +++ b/data_structures_correct/CLKFROM.js @@ -1,20 +1,20 @@ -function CLKFROM () { +function CLKFROM() { CLKFROM.prototype.define = function CLKFROM() { - var model = scicos_model(); - model.sim = new ScilabString(["clkfrom"]); - model.evtout = new ScilabDouble([1]); - model.opar=list(new ScilabString(["A"])); - model.blocktype = new ScilabString(["d"]); - model.firing = new ScilabDouble([-1]); - model.dep_ut = new ScilabBoolean([false,false]); - - var exprs = new ScilabString(["A"]); - this.x=new standard_define(new ScilabDouble([2,1]),model,exprs,new ScilabString([" "])); - this.x.graphics.id = new ScilabString(["From"]); - return new BasicBlock(this.x); + var model = scicos_model(); + model.sim = new ScilabString(["clkfrom"]); + model.evtout = new ScilabDouble([1]); + model.opar = list(new ScilabString(["A"])); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString(["A"]); + this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, new ScilabString([" "])); + this.x.graphics.id = new ScilabString(["From"]); + return new BasicBlock(this.x); } CLKFROM.prototype.details = function CLKFROM() { return this.x; } -} +} \ No newline at end of file diff --git a/data_structures_correct/CLKGOTO.js b/data_structures_correct/CLKGOTO.js index 2c15601..a91514f 100644 --- a/data_structures_correct/CLKGOTO.js +++ b/data_structures_correct/CLKGOTO.js @@ -15,7 +15,7 @@ function CLKGOTO() { this.x.graphics.id = new ScilabString(["Goto"]); return new BasicBlock(this.x); } - + CLKGOTO.prototype.details = function CLKGOTO() { return this.x; } diff --git a/data_structures_correct/CLKSOMV_f.js b/data_structures_correct/CLKSOMV_f.js index fd46d38..6729647 100644 --- a/data_structures_correct/CLKSOMV_f.js +++ b/data_structures_correct/CLKSOMV_f.js @@ -1,5 +1,5 @@ function CLKSOMV_f() { - + CLKSOMV_f.prototype.internal = function CLKSOMV_f() { var model = scicos_model(); model.sim = new ScilabString(["sum"]); diff --git a/data_structures_correct/CLSS.js b/data_structures_correct/CLSS.js index 471f302..db5bd1b 100644 --- a/data_structures_correct/CLSS.js +++ b/data_structures_correct/CLSS.js @@ -23,7 +23,7 @@ function CLSS() { this.x = new standard_define(new ScilabDouble([4, 2]), model, exprs, gr_i); return new BasicBlock(this.x); } - + CLSS.prototype.details = function CLSS() { return this.x; } diff --git a/data_structures_correct/COSBLK_f.js b/data_structures_correct/COSBLK_f.js index 4b845f1..4e05648 100644 --- a/data_structures_correct/COSBLK_f.js +++ b/data_structures_correct/COSBLK_f.js @@ -1,20 +1,20 @@ -function COSBLK_f () { +function COSBLK_f() { COSBLK_f.prototype.define = function COSBLK_f() { - this.in1 = 1; - - var model = scicos_model(); - model.sim = new ScilabString(["cosblk"]); - model.in = new ScilabDouble([-1]); - model.out = new ScilabDouble([-1]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true,false]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"COSBLK_f\",sz(1),sz(2));"]); - this.x=new standard_define(new ScilabDouble([2,2]),model,new ScilabDouble(),gr_i); - return new BasicBlock(this.x); + this.in1 = 1; + + var model = scicos_model(); + model.sim = new ScilabString(["cosblk"]); + model.in = new ScilabDouble([-1]); + model.out = new ScilabDouble([-1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"COSBLK_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, new ScilabDouble(), gr_i); + return new BasicBlock(this.x); } COSBLK_f.prototype.details = function COSBLK_f() { return this.x; } -} +} \ No newline at end of file diff --git a/data_structures_correct/CUMSUM.js b/data_structures_correct/CUMSUM.js index b39b028..8e6a1ae 100644 --- a/data_structures_correct/CUMSUM.js +++ b/data_structures_correct/CUMSUM.js @@ -5,7 +5,7 @@ function CUMSUM() { this.function_name = "cumsum_m"; this.funtyp = 4; - + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); model.in = new ScilabDouble([-1]); model.in2 = new ScilabDouble([-2]); diff --git a/data_structures_correct/DELAY_f.js b/data_structures_correct/DELAY_f.js index 14e968c..650ac12 100644 --- a/data_structures_correct/DELAY_f.js +++ b/data_structures_correct/DELAY_f.js @@ -1,116 +1,121 @@ -function DELAY_f () { +function DELAY_f() { - DELAY_f.prototype.define =function DELAY_f() { - var evtdly = new EVTDLY_f().internal(); - evtdly.graphics.orig = new ScilabDouble([243,296]); - evtdly.graphics.sz = new ScilabDouble([40,40]); - evtdly.graphics.flip = new ScilabBoolean([true]); - evtdly.graphics.exprs = new ScilabString(["0.1"],["0"]); - evtdly.graphics.pein = new ScilabDouble([10]); - evtdly.graphics.peout = new ScilabDouble([7]); - evtdly.model.rpar = new ScilabDouble([0.1]); - evtdly.model.firing = new ScilabDouble([0]); - evtdly.model.uid = new ScilabString([count]); // changed + DELAY_f.prototype.define = function DELAY_f() { + var evtdly = new EVTDLY_f().internal(); + evtdly.graphics.orig = new ScilabDouble([243, 296]); + evtdly.graphics.sz = new ScilabDouble([40, 40]); + evtdly.graphics.flip = new ScilabBoolean([true]); + evtdly.graphics.exprs = new ScilabString(["0.1"], ["0"]); + evtdly.graphics.pein = new ScilabDouble([10]); + evtdly.graphics.peout = new ScilabDouble([7]); + evtdly.model.rpar = new ScilabDouble([0.1]); + evtdly.model.firing = new ScilabDouble([0]); + evtdly.model.uid = new ScilabString([count]); // changed evtdly.doc = list(new ScilabString([count++])); evtdly.model.outtyp = new ScilabDouble(); - - var register = new REGISTER_f().internal(); - register.graphics.orig = new ScilabDouble([238,195]); - register.graphics.sz = new ScilabDouble([50,50]); - register.graphics.flip = new ScilabBoolean([true]); - register.graphics.exprs = new ScilabString(["0;0;0;0;0;0;0;0;0;0"]); - register.graphics.pin = new ScilabDouble([6]); - register.graphics.pout = new ScilabDouble([5]); - register.graphics.pein = new ScilabDouble([9]); - register.model.uid = new ScilabString([count]); // changed + + var register = new REGISTER_f().internal(); + register.graphics.orig = new ScilabDouble([238, 195]); + register.graphics.sz = new ScilabDouble([50, 50]); + register.graphics.flip = new ScilabBoolean([true]); + register.graphics.exprs = new ScilabString(["0;0;0;0;0;0;0;0;0;0"]); + register.graphics.pin = new ScilabDouble([6]); + register.graphics.pout = new ScilabDouble([5]); + register.graphics.pein = new ScilabDouble([9]); + register.model.uid = new ScilabString([count]); // changed register.doc = list(new ScilabString([count++])); register.model.in2 = new ScilabDouble([1]); register.model.intyp = new ScilabDouble([1]); register.model.out2 = new ScilabDouble([1]); - - var input_port = new IN_f().internal(); - input_port.graphics.orig = new ScilabDouble([92,210]); - input_port.graphics.sz = new ScilabDouble([20,20]); - input_port.graphics.flip = new ScilabBoolean([true]); - input_port.graphics.exprs = new ScilabString(["1"],["1"]); - input_port.graphics.pout = new ScilabDouble([6]); - input_port.model.ipar = new ScilabDouble([1]); - input_port.model.uid = new ScilabString([count]); // changed + + var input_port = new IN_f().internal(); + input_port.graphics.orig = new ScilabDouble([92, 210]); + input_port.graphics.sz = new ScilabDouble([20, 20]); + input_port.graphics.flip = new ScilabBoolean([true]); + input_port.graphics.exprs = new ScilabString(["1"], ["1"]); + input_port.graphics.pout = new ScilabDouble([6]); + input_port.model.ipar = new ScilabDouble([1]); + input_port.model.uid = new ScilabString([count]); // changed input_port.doc = list(new ScilabString([count++])); input_port.model.outtyp = new ScilabDouble([-1]); - - var output_port = new OUT_f().internal(); - output_port.graphics.orig = new ScilabDouble([440,210]); - output_port.graphics.sz = new ScilabDouble([20,20]); - output_port.graphics.flip = new ScilabBoolean([true]); - output_port.graphics.exprs = new ScilabString(["1"],["1"]); - output_port.graphics.pin = new ScilabDouble([5]); - output_port.model.ipar = new ScilabDouble([1]); - output_port.model.uid = new ScilabString([count]); // changed + + var output_port = new OUT_f().internal(); + output_port.graphics.orig = new ScilabDouble([440, 210]); + output_port.graphics.sz = new ScilabDouble([20, 20]); + output_port.graphics.flip = new ScilabBoolean([true]); + output_port.graphics.exprs = new ScilabString(["1"], ["1"]); + output_port.graphics.pin = 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++])); output_port.model.outtyp = new ScilabDouble(); - - var split = new CLKSPLIT_f().internal(); - split.graphics.orig = new ScilabDouble([263,271.2]); - split.graphics.pein = new ScilabDouble([7]); - split.graphics.peout = new ScilabDouble([9],[10]); - split.model.uid = new ScilabString([count]); // changed + + var split = new CLKSPLIT_f().internal(); + split.graphics.orig = new ScilabDouble([263, 271.2]); + split.graphics.pein = new ScilabDouble([7]); + split.graphics.peout = new ScilabDouble([9], [10]); + split.model.uid = new ScilabString([count]); // changed split.doc = list(new ScilabString([count++])); - - var diagram = scicos_diagram(); - diagram.objs.push(input_port); - diagram.objs.push(output_port); - diagram.objs.push(register); - diagram.objs.push(evtdly); - diagram.objs.push(split); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([296.6],[440]), - yy: new ScilabDouble([220],[220]), - from: new ScilabDouble([3,1,0]), - to: new ScilabDouble([2,1,1])})); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([112],[229.4]), - yy: new ScilabDouble([220],[220]), - from: new ScilabDouble([1,1,0]), - to: new ScilabDouble([3,1,1])})); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([263],[263]), - yy: new ScilabDouble([290.3],[271.2]), - ct: new ScilabDouble([5,-1]), - from: new ScilabDouble([4,1,0]), - to: new ScilabDouble([5,1,1])})); - diagram.objs.push(scicos_link({ - xx: new ScilabDouble([263],[263]), - yy: new ScilabDouble([271.2],[250.7]), - 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([263],[308.6],[308.6],[263],[263]), - yy: new ScilabDouble([271.2],[271.2],[367],[367],[341.7]), - ct: new ScilabDouble([5,-1]), - from: new ScilabDouble([5,2,0]), - to: new ScilabDouble([4,1,1])})); - - this.x=scicos_block(); - this.x.gui = new ScilabString(["DELAY_f"]); - this.x.graphics.sz = new ScilabDouble([2,2]); - this.x.graphics.gr_i = new ScilabDouble(); - this.x.graphics.pin = new ScilabDouble([0]); - this.x.graphics.pout = new ScilabDouble([0]); - this.x.model.sim = new ScilabString(["csuper"]); - this.x.model.in = new ScilabDouble([1]); - this.x.model.out = new ScilabDouble([1]); - this.x.model.blocktype = new ScilabString(["h"]); - this.x.model.dep_ut = new ScilabBoolean([false,false]); - this.x.model.rpar=diagram; - this.x.graphics.in_implicit = new ScilabString(["E"]); - this.x.graphics.in_style = new ScilabString([""]); - this.x.graphics.out_implicit = new ScilabString(["E"]); - this.x.graphics.out_style = new ScilabString([""]); - return new BasicBlock(this.x); + + var diagram = scicos_diagram(); + diagram.objs.push(input_port); + diagram.objs.push(output_port); + diagram.objs.push(register); + diagram.objs.push(evtdly); + diagram.objs.push(split); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([296.6], [440]), + yy: new ScilabDouble([220], [220]), + from: new ScilabDouble([3, 1, 0]), + to: new ScilabDouble([2, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([112], [229.4]), + yy: new ScilabDouble([220], [220]), + from: new ScilabDouble([1, 1, 0]), + to: new ScilabDouble([3, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([263], [263]), + yy: new ScilabDouble([290.3], [271.2]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([4, 1, 0]), + to: new ScilabDouble([5, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([263], [263]), + yy: new ScilabDouble([271.2], [250.7]), + 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([263], [308.6], [308.6], [263], [263]), + yy: new ScilabDouble([271.2], [271.2], [367], [367], [341.7]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([5, 2, 0]), + to: new ScilabDouble([4, 1, 1]) + })); + + this.x = scicos_block(); + this.x.gui = new ScilabString(["DELAY_f"]); + this.x.graphics.sz = new ScilabDouble([2, 2]); + this.x.graphics.gr_i = new ScilabDouble(); + this.x.graphics.pin = new ScilabDouble([0]); + this.x.graphics.pout = new ScilabDouble([0]); + this.x.model.sim = new ScilabString(["csuper"]); + this.x.model.in = new ScilabDouble([1]); + this.x.model.out = new ScilabDouble([1]); + this.x.model.blocktype = new ScilabString(["h"]); + this.x.model.dep_ut = new ScilabBoolean([false, false]); + this.x.model.rpar = diagram; + this.x.graphics.in_implicit = new ScilabString(["E"]); + this.x.graphics.in_style = new ScilabString([""]); + this.x.graphics.out_implicit = new ScilabString(["E"]); + this.x.graphics.out_style = new ScilabString([""]); + return new BasicBlock(this.x); } DELAY_f.prototype.details = function DELAY_f() { return this.x; } -} +} \ No newline at end of file diff --git a/data_structures_correct/EVTDLY_f.js b/data_structures_correct/EVTDLY_f.js index 04e38a0..1bb4e29 100644 --- a/data_structures_correct/EVTDLY_f.js +++ b/data_structures_correct/EVTDLY_f.js @@ -1,23 +1,23 @@ -function EVTDLY_f () { +function EVTDLY_f() { - EVTDLY_f.prototype.internal = function EVTDLY_f() { - this.dt = 0.1; - this.ff = this.dt; - - var model = scicos_model(); - model.sim = new ScilabString(["evtdly"]); - model.evtin = new ScilabDouble([1]); - model.evtout = new ScilabDouble([1]); - model.rpar=new ScilabDouble([this.dt]); - model.blocktype = new ScilabString(["d"]); - model.firing=new ScilabDouble([this.ff]); - model.dep_ut = new ScilabBoolean([false,false]); - - var exprs = new ScilabString([this.dt],[sci2exp(this.ff)]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_f\",sz(1),sz(2));"]); - var block = new standard_define(new ScilabDouble([2,2]),model,exprs,gr_i); - block.graphics.style = new ScilabString(["EVTDLY_f"]); - return block; - } -} + EVTDLY_f.prototype.internal = function EVTDLY_f() { + this.dt = 0.1; + this.ff = this.dt; + + var model = scicos_model(); + model.sim = new ScilabString(["evtdly"]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar = new ScilabDouble([this.dt]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([this.ff]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.dt], [sci2exp(this.ff)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_f\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + block.graphics.style = new ScilabString(["EVTDLY_f"]); + return block; + } +} \ No newline at end of file diff --git a/data_structures_correct/FROMWSB.js b/data_structures_correct/FROMWSB.js index 1743a23..8ccfebf 100644 --- a/data_structures_correct/FROMWSB.js +++ b/data_structures_correct/FROMWSB.js @@ -1,164 +1,164 @@ function FROMWSB() { - FROMWSB.prototype.define = function FROMWSB() { - var scs_m_1 = scicos_diagram({ - version : new ScilabString(["scicos4.2"]), - props : scicos_params({ - wpar : new ScilabDouble([600,450,0,0,450,600]), - Title : new ScilabString(["FROMWSB"]), - tol : new ScilabDouble([0.0001],[0.000001],[Math.pow(10,-10)],[100001],[0],[0],[0]), - tf : new ScilabDouble([100000]), - context : new ScilabString([" "]), - void1 : new ScilabDouble(), - options : tlist(["scsopt","3D","Background","Link","ID","Cmap"],new ScilabString(["scsopt", "3D", "Background", "Link", "ID", "Cmap"]),list(new ScilabBoolean([true]), new ScilabDouble([33])), new ScilabDouble([8,1]), new ScilabDouble([1,5]),list( new ScilabDouble([5,1]), new ScilabDouble([4,1])), new ScilabDouble([0.8,0.8,0.8])), - void2 : new ScilabDouble(), - void3 : new ScilabDouble(), - doc : list() - }) - }); - scs_m_1.objs.push(scicos_block({ - gui : new ScilabString(["FROMWS_c"]), - graphics : scicos_graphics({ - orig : new ScilabDouble([260.37067,261.584]), - sz : new ScilabDouble([70,40]), - flip :new ScilabBoolean([true]), - theta : new ScilabDouble([0]), - exprs : new ScilabString(["V"],["1"],["1"],["0"]), - pin : new ScilabDouble(), - pout : new ScilabDouble([4]), - pein : new ScilabDouble([2]), - peout : new ScilabDouble([2]), - gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"FROMWS_c",sz(1),sz(2));"]), new ScilabDouble([8])), - id : new ScilabString([""]), - in_implicit : new ScilabDouble(), - out_implicit : new ScilabString(["E"]), - out_style: new ScilabString(["ExplicitOutputPort"]), + FROMWSB.prototype.define = function FROMWSB() { + var scs_m_1 = scicos_diagram({ + version: new ScilabString(["scicos4.2"]), + props: scicos_params({ + wpar: new ScilabDouble([600, 450, 0, 0, 450, 600]), + Title: new ScilabString(["FROMWSB"]), + tol: new ScilabDouble([0.0001], [0.000001], [Math.pow(10, -10)], [100001], [0], [0], [0]), + tf: new ScilabDouble([100000]), + context: new ScilabString([" "]), + void1: new ScilabDouble(), + options: tlist(["scsopt", "3D", "Background", "Link", "ID", "Cmap"], new ScilabString(["scsopt", "3D", "Background", "Link", "ID", "Cmap"]), list(new ScilabBoolean([true]), new ScilabDouble([33])), new ScilabDouble([8, 1]), new ScilabDouble([1, 5]), list(new ScilabDouble([5, 1]), new ScilabDouble([4, 1])), new ScilabDouble([0.8, 0.8, 0.8])), + void2: new ScilabDouble(), + void3: new ScilabDouble(), + doc: list() + }) + }); + scs_m_1.objs.push(scicos_block({ + gui: new ScilabString(["FROMWS_c"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([260.37067, 261.584]), + sz: new ScilabDouble([70, 40]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["V"], ["1"], ["1"], ["0"]), + pin: new ScilabDouble(), + pout: new ScilabDouble([4]), + pein: new ScilabDouble([2]), + peout: new ScilabDouble([2]), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"FROMWS_c",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabDouble(), + out_implicit: new ScilabString(["E"]), + out_style: new ScilabString(["ExplicitOutputPort"]), out_label: new ScilabString([""]), style: new ScilabString(["FROMWS_c"]) - }), - model : scicos_model({ - sim : list(new ScilabString(["fromws_c"]),new ScilabDouble([4])), - in : new ScilabDouble(), - in2 : new ScilabDouble(), - intyp : new ScilabDouble(), - out : new ScilabDouble([-1]), - out2 : new ScilabDouble([-2]), - outtyp : new ScilabDouble([-1]), - evtin : new ScilabDouble([1]), - evtout : new ScilabDouble([1]), - state : new ScilabDouble(), - dstate : new ScilabDouble(), - odstate : list(), - rpar : new ScilabDouble(), - ipar : new ScilabDouble([1],[-31],[1],[1],[0]), - opar : list(), - blocktype : new ScilabString(["d"]), - firing : new ScilabDouble([0]), - dep_ut : new ScilabBoolean([false,true]), - label : new ScilabString([""]), - nzcross : new ScilabDouble([0]), - nmode : new ScilabDouble([0]), - equations : list(), + }), + model: scicos_model({ + sim: list(new ScilabString(["fromws_c"]), new ScilabDouble([4])), + in: new ScilabDouble(), + in2: new ScilabDouble(), + intyp: new ScilabDouble(), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([-2]), + outtyp: new ScilabDouble([-1]), + evtin: new ScilabDouble([1]), + evtout: new ScilabDouble([1]), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble([1], [-31], [1], [1], [0]), + opar: list(), + blocktype: new ScilabString(["d"]), + firing: new ScilabDouble([0]), + dep_ut: new ScilabBoolean([false, true]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), uid: new ScilabString([count]) }), doc: list(new ScilabString([count++])) - })); - scs_m_1.objs.push(scicos_block({ - gui : new ScilabString(["OUT_f"]), - graphics : scicos_graphics({ - orig : new ScilabDouble([358.9421,271.584]), - sz : new ScilabDouble([20,20]), - flip :new ScilabBoolean([true]), - theta : new ScilabDouble([0]), - exprs : new ScilabString(["1"]), - pin : new ScilabDouble([4]), - pout : new ScilabDouble(), - pein : new ScilabDouble(), - peout : new ScilabDouble(), + })); + scs_m_1.objs.push(scicos_block({ + gui: new ScilabString(["OUT_f"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([358.9421, 271.584]), + sz: new ScilabDouble([20, 20]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1"]), + pin: new ScilabDouble([4]), + pout: new ScilabDouble(), + pein: new ScilabDouble(), + peout: new ScilabDouble(), gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"OUT_f",sz(1),sz(2));"]), new ScilabDouble([8])), - id : new ScilabString([""]), - in_implicit : new ScilabString(["E"]), - out_implicit : new ScilabDouble(), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabDouble(), in_style: new ScilabString(["ExplicitInputPort"]), in_label: new ScilabString([""]), style: new ScilabString(["OUT_f"]) - - }), - model : scicos_model({ - sim : new ScilabString(["output"]), - in : new ScilabDouble([-1]), - in2 : new ScilabDouble([-2]), - intyp : new ScilabDouble([-1]), - out : new ScilabDouble(), - out2 : new ScilabDouble(), - outtyp : new ScilabDouble(), - evtin : new ScilabDouble(), - evtout : new ScilabDouble(), - state : new ScilabDouble(), - dstate : new ScilabDouble(), - odstate : list(), - rpar : new ScilabDouble(), - ipar : new ScilabDouble([1]), - opar : list(), - blocktype : new ScilabString(["c"]), - firing : new ScilabDouble(), - dep_ut : new ScilabBoolean([false,false]), - label : new ScilabString([""]), - nzcross : new ScilabDouble([0]), - nmode : new ScilabDouble([0]), - equations : list(), + + }), + model: scicos_model({ + sim: new ScilabString(["output"]), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([-2]), + intyp: new ScilabDouble([-1]), + out: new ScilabDouble(), + out2: new ScilabDouble(), + outtyp: new ScilabDouble(), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble([1]), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([false, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), uid: new ScilabString([count]) }), doc: list(new ScilabString([count++])) - })); - scs_m_1.objs.push(scicos_link({ - xx: new ScilabDouble([295.37067],[295.37067],[233.23733],[233.23733],[295.37067],[295.37067]), - yy: new ScilabDouble([255.86971],[223.45067],[223.45067],[337.85067],[337.85067],[307.29829]), - id: new ScilabString(["drawlink"]), - thick: new ScilabDouble([0,0]), - ct: new ScilabDouble([5,-1]), - from: new ScilabDouble([1,1,0]), - to: new ScilabDouble([1,1,1]) - })); - scs_m_1.objs.push(scicos_link({ - xx: new ScilabDouble([338.9421],[358.9421]), - yy: new ScilabDouble([281.584],[281.584]), - id: new ScilabString(["drawlink"]), - thick: new ScilabDouble([0,0]), - ct: new ScilabDouble([1,1]), - from: new ScilabDouble([1,1,0]), - to: new ScilabDouble([3,1,1]) - })); - - var model = scicos_model({ - sim : new ScilabString(["csuper"]), - in : new ScilabDouble(), - in2 : new ScilabDouble(), - intyp : new ScilabDouble([1]), - out : new ScilabDouble([-1]), - out2 : new ScilabDouble([-2]), - outtyp : new ScilabDouble([1]), - evtin : new ScilabDouble(), - evtout : new ScilabDouble(), - state : new ScilabDouble(), - dstate : new ScilabDouble(), - odstate : list(), - rpar : scs_m_1, - ipar : new ScilabDouble(), - opar : list(), - blocktype : new ScilabString(["h"]), - firing : new ScilabDouble(), - dep_ut : new ScilabBoolean([false,false]), - label : new ScilabString([""]), - nzcross : new ScilabDouble([0]), - nmode : new ScilabDouble([0]), - equations : list() - }); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"FROMWSB\",sz(1),sz(2));"]); - this.x=new standard_define(new ScilabDouble([5,2]),model,new ScilabDouble(),gr_i); - return new BasicBlock(this.x); - } - FROMWSB.prototype.details = function FROMWSB() { - return this.x; - } -} + })); + scs_m_1.objs.push(scicos_link({ + xx: new ScilabDouble([295.37067], [295.37067], [233.23733], [233.23733], [295.37067], [295.37067]), + yy: new ScilabDouble([255.86971], [223.45067], [223.45067], [337.85067], [337.85067], [307.29829]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([1, 1, 0]), + to: new ScilabDouble([1, 1, 1]) + })); + scs_m_1.objs.push(scicos_link({ + xx: new ScilabDouble([338.9421], [358.9421]), + yy: new ScilabDouble([281.584], [281.584]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([1, 1, 0]), + to: new ScilabDouble([3, 1, 1]) + })); + + var model = scicos_model({ + sim: new ScilabString(["csuper"]), + in: new ScilabDouble(), + in2: new ScilabDouble(), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([-2]), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: scs_m_1, + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["h"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([false, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list() + }); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"FROMWSB\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([5, 2]), model, new ScilabDouble(), gr_i); + return new BasicBlock(this.x); + } + FROMWSB.prototype.details = function FROMWSB() { + return this.x; + } +} \ No newline at end of file diff --git a/data_structures_correct/GENERAL_f.js b/data_structures_correct/GENERAL_f.js index d70a82e..10081f9 100644 --- a/data_structures_correct/GENERAL_f.js +++ b/data_structures_correct/GENERAL_f.js @@ -22,7 +22,7 @@ function GENERAL_f() { this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); return new BasicBlock(this.x); } - + GENERAL_f.prototype.details = function GENERAL_f() { return this.x; } diff --git a/data_structures_correct/c_block.js b/data_structures_correct/c_block.js index ac826b2..1cb86e7 100644 --- a/data_structures_correct/c_block.js +++ b/data_structures_correct/c_block.js @@ -1,7 +1,7 @@ function c_block() { c_block.prototype.define = function c_block() { - + this.in1 = 1; this.out = 1; this.rpar = []; @@ -28,7 +28,6 @@ function c_block() { return new BasicBlock(this.x); } c_block.prototype.details = function c_block() { - return this.x; } } -- cgit From c8373df0c62fa85a8eb38992604b717d42ac2a54 Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 07:07:38 +0000 Subject: Implement ZCROSS_f Block --- data_structures_correct/ZCROSS_f.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 data_structures_correct/ZCROSS_f.js (limited to 'data_structures_correct') diff --git a/data_structures_correct/ZCROSS_f.js b/data_structures_correct/ZCROSS_f.js new file mode 100644 index 0000000..8d2e66a --- /dev/null +++ b/data_structures_correct/ZCROSS_f.js @@ -0,0 +1,29 @@ +function ZCROSS_f() { + + ZCROSS_f.prototype.define = function ZCROSS_f() { + this.rpar = [[-1], [-1], [0], [0]]; + + this.in = 1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["zcross"]), new ScilabDouble([1])); + model.in = new ScilabDouble([this.in]); + model.nzcross = new ScilabDouble([this.in]); + model.evtout = new ScilabDouble([1]); + model.rpar = new ScilabDouble([-1], [-1], [0], [0]); + model.blocktype = new ScilabString(["z"]); + model.firing = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.in)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ZCROSS_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + + return new BasicBlock(this.x); + } + + ZCROSS_f.prototype.details = function ZCROSS_f() { + return this.x; + } +} -- cgit From 3bd2720042be7ccd4f5ba8c86f9e684acda5234f Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 09:41:50 +0000 Subject: Implement VVsourceAC Block --- data_structures_correct/VVsourceAC.js | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 data_structures_correct/VVsourceAC.js (limited to 'data_structures_correct') diff --git a/data_structures_correct/VVsourceAC.js b/data_structures_correct/VVsourceAC.js new file mode 100644 index 0000000..00a3107 --- /dev/null +++ b/data_structures_correct/VVsourceAC.js @@ -0,0 +1,41 @@ +function VVsourceAC() { + + VVsourceAC.prototype.define = function VVsourceAC() { + var model = scicos_model(); + + model.in = new ScilabDouble([1], [1]); + model.out = new ScilabDouble([1]); + + this.VA = 220; + this.FR = 50; + + model.rpar = new ScilabDouble([this.FR]); + model.sim = new ScilabString(["VVsourceAC"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica_function(); + mo.model = new ScilabString(["VVsourceAC"]); + mo.inputs = new ScilabString(["p", "VA"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["f"]), list(new ScilabDouble([this.FR]))); + model.equations = mo; + + var exprs = new ScilabString([this.FR]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VVsourceAC\",sz(1),sz(2));"]); + + + this.x = standard_define([2, 2], model, exprs, list(gr_i, 0)); + this.x.graphics.in_implicit = new ScilabString(["I", "E"]); + this.x.graphics.out_implicit = new ScilabString(["I"]); + + return new BasicBlock(this.x); + + } + + VVsourceAC.prototype.details = function VVsourceAC() { + return this.x; + + } +} -- cgit From a258d21056e4aad7841a70300588ec2574d77f75 Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 09:50:48 +0000 Subject: Implement VsourceAC Block --- data_structures_correct/VsourceAC.js | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 data_structures_correct/VsourceAC.js (limited to 'data_structures_correct') diff --git a/data_structures_correct/VsourceAC.js b/data_structures_correct/VsourceAC.js new file mode 100644 index 0000000..59cc3b4 --- /dev/null +++ b/data_structures_correct/VsourceAC.js @@ -0,0 +1,37 @@ +function VsourceAC() { + + VsourceAC.prototype.define = function VsourceAC() { + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + + this.VA = 220; + + this.FR = 50; + model.rpar = new ScilabDouble([this.VA], [this.FR]); + model.sim = new ScilabString(["VsourceAC"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica_function(); + mo.model = new ScilabString(["VsourceAC"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["VA"], ["f"]), list(new ScilabDouble([this.VA]), new ScilabDouble([this.FR]))); + model.equations = mo; + + var exprs = new ScilabString([this.VA], [this.FR]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VsourceAC\",sz(1),sz(2));"]); + + this.x = standard_define([2, 2], model, exprs, list(gr_i, 0)); + this.x.graphics.in_implicit = new ScilabString(["I"]); + this.x.graphics.out_implicit = new ScilabString(["I"]); + + return new BasicBlock(this.x); + } + + VsourceAC.prototype.details = function VsourceAC() { + return this.x; + } +} -- cgit From 4e2adfaa2c68899b72f70d3cb82d9960a647644a Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 09:57:39 +0000 Subject: Minor fix --- data_structures_correct/VVsourceAC.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'data_structures_correct') diff --git a/data_structures_correct/VVsourceAC.js b/data_structures_correct/VVsourceAC.js index 00a3107..120b3bb 100644 --- a/data_structures_correct/VVsourceAC.js +++ b/data_structures_correct/VVsourceAC.js @@ -31,11 +31,9 @@ function VVsourceAC() { this.x.graphics.out_implicit = new ScilabString(["I"]); return new BasicBlock(this.x); - } VVsourceAC.prototype.details = function VVsourceAC() { return this.x; - } } -- cgit