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 /dependencies.js | |
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
Diffstat (limited to 'dependencies.js')
-rw-r--r-- | dependencies.js | 160 |
1 files changed, 160 insertions, 0 deletions
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]; |