diff options
author | Adhitya Kamakshidasan | 2016-07-09 12:58:47 +0530 |
---|---|---|
committer | GitHub | 2016-07-09 12:58:47 +0530 |
commit | 26e1ad4749ed9e00be7c9d0d7ae0bef935a1fab1 (patch) | |
tree | c88f56fa957153858b71ef0cf17fe7bec2830354 | |
parent | d0d6a3fa9a7ccd92179fbafea830b9d446e69d77 (diff) | |
parent | 9bd5e32dab6215e70d8eefa730650fb420896238 (diff) | |
download | xcos-on-web-26e1ad4749ed9e00be7c9d0d7ae0bef935a1fab1.tar.gz xcos-on-web-26e1ad4749ed9e00be7c9d0d7ae0bef935a1fab1.tar.bz2 xcos-on-web-26e1ad4749ed9e00be7c9d0d7ae0bef935a1fab1.zip |
Merge pull request #154 from ASP1234/master
Fix IFTHEL_f Block
-rw-r--r-- | data_structures_correct/CLKSOMV_f.js | 14 | ||||
-rw-r--r-- | data_structures_correct/FROMWSB.js | 164 | ||||
-rw-r--r-- | data_structures_correct/IFTHEL_f.js | 2 | ||||
-rw-r--r-- | data_structures_correct/OUT_f.js | 6 | ||||
-rw-r--r-- | dependencies.js | 160 | ||||
-rw-r--r-- | finalmodsheet.xsl | 8 |
6 files changed, 346 insertions, 8 deletions
diff --git a/data_structures_correct/CLKSOMV_f.js b/data_structures_correct/CLKSOMV_f.js index 346241f..fd46d38 100644 --- a/data_structures_correct/CLKSOMV_f.js +++ b/data_structures_correct/CLKSOMV_f.js @@ -1,4 +1,18 @@ function CLKSOMV_f() { + + CLKSOMV_f.prototype.internal = function CLKSOMV_f() { + var model = scicos_model(); + model.sim = new ScilabString(["sum"]); + model.evtin = new ScilabDouble([1], [1], [1]); + model.evtout = new ScilabDouble([1]); + 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),\"CLKSOMV_f\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([2, 2]), model, new ScilabDouble(), gr_i); + return block; + } CLKSOMV_f.prototype.define = function CLKSOMV_f() { var model = scicos_model(); diff --git a/data_structures_correct/FROMWSB.js b/data_structures_correct/FROMWSB.js new file mode 100644 index 0000000..1743a23 --- /dev/null +++ b/data_structures_correct/FROMWSB.js @@ -0,0 +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"]), + 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(), + 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(), + 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(), + 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(), + 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; + } +} diff --git a/data_structures_correct/IFTHEL_f.js b/data_structures_correct/IFTHEL_f.js index ebe8c6e..95971dc 100644 --- a/data_structures_correct/IFTHEL_f.js +++ b/data_structures_correct/IFTHEL_f.js @@ -49,7 +49,7 @@ function IFTHEL_f() { 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.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); } diff --git a/data_structures_correct/OUT_f.js b/data_structures_correct/OUT_f.js index d632563..6b65d13 100644 --- a/data_structures_correct/OUT_f.js +++ b/data_structures_correct/OUT_f.js @@ -29,7 +29,7 @@ function OUT_f () { var model = scicos_model(); model.sim = new ScilabString(["output"]); - model.in1 = new ScilabDouble([-1]); + model.in = new ScilabDouble([-1]); model.in2 = new ScilabDouble([-2]); model.intyp = new ScilabDouble([-1]); model.ipar=new ScilabDouble([this.prt]); @@ -39,8 +39,8 @@ function OUT_f () { var exprs = new ScilabString([sci2exp(this.prt)]); var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"OUT_f\",sz(1),sz(2));"]); - var block=new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i); - block.graphics.style = new ScilabString(["OUT_f"]); + this.x = new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i); + this.x.graphics.style = new ScilabString(["OUT_f"]); return new ExplicitOutBlock(this.x); } diff --git a/dependencies.js b/dependencies.js index c392c9d..e00887d 100644 --- a/dependencies.js +++ b/dependencies.js @@ -761,6 +761,166 @@ function ImplicitInBlock() { } } +function ExplicitInBlock() { + 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 + 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.value = options.value; // Not Known + this.vertex = options.vertex; // Not Known + this.visible = options.visible; // Not Known + this.exprs = options.graphics.exprs; + this.integerParameters = options.model.ipar; + this.objectsParameters = options.model.opar; + if(!isEmpty(options.model.state)) { + this.state = options.model.state; + } + if(!isEmpty(options.model.dstate)) { + this.dState = options.model.dstate; + } + this.equations = options.model.equations; + this.blockName = "ExplicitInBlock"; + this.blockElementName = arguments.callee.caller.name; + } +} + +function ExplicitOutBlock() { + 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 + 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.value = options.value; // Not Known + this.vertex = options.vertex; // Not Known + this.visible = options.visible; // Not Known + this.exprs = options.graphics.exprs; + this.integerParameters = options.model.ipar; + this.objectsParameters = options.model.opar; + if(!isEmpty(options.model.state)) { + this.state = options.model.state; + } + if(!isEmpty(options.model.dstate)) { + this.dState = options.model.dstate; + } + this.equations = options.model.equations; + this.blockName = "ExplicitOutBlock"; + this.blockElementName = arguments.callee.caller.name; + } +} + function zeros() { if (arguments.length == 0) { return [0]; diff --git a/finalmodsheet.xsl b/finalmodsheet.xsl index d7ff4f5..a6bdec2 100644 --- a/finalmodsheet.xsl +++ b/finalmodsheet.xsl @@ -172,7 +172,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="Object" match="Object"> <xsl:element name="Array"> - <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='ImplicitInBlock' or name(..)='Product' or name(..)='ImplicitOutBlock' or name(..)='SuperBlock' or name(..)='ExplicitInBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -200,7 +200,7 @@ Look for TAG:Break1!!! --> <xsl:template name="Array" match="Array"> <xsl:element name="Array"> - <xsl:if test="name(..)='BasicBlock' or @as='context' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> + <xsl:if test="name(..)='BasicBlock' or @as='context' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='ImplicitInBlock' or name(..)='Product' or name(..)='ImplicitOutBlock' or name(..)='SuperBlock' or name(..)='ExplicitInBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -1581,7 +1581,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="ScilabDouble" match="ScilabDouble"> <xsl:element name="ScilabDouble"> - <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='ImplicitInBlock' or name(..)='Product' or name(..)='ImplicitOutBlock' or name(..)='SuperBlock' or name(..)='ExplicitInBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -1613,7 +1613,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="ScilabString" match="ScilabString"> <xsl:element name="ScilabString"> - <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='ImplicitInBlock' or name(..)='Product' or name(..)='ImplicitOutBlock' or name(..)='SuperBlock' or name(..)='ExplicitInBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> |