summaryrefslogtreecommitdiff
path: root/dependencies.js
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-09 17:23:12 +0530
committerGitHub2016-07-09 17:23:12 +0530
commite16612ff3bc311f330f291593cf9a207e0d24264 (patch)
tree558a81e6018ba61cb53df33c2d04e3c134ab38b4 /dependencies.js
parentee636d7791a80bf2e5d7032714e661499e7c6e33 (diff)
parent8be6e0ba4ef4803550047cacc035792897aacdd4 (diff)
downloadxcos-on-web-e16612ff3bc311f330f291593cf9a207e0d24264.tar.gz
xcos-on-web-e16612ff3bc311f330f291593cf9a207e0d24264.tar.bz2
xcos-on-web-e16612ff3bc311f330f291593cf9a207e0d24264.zip
Merge pull request #157 from ASP1234/master
Implement Blocks and dependency fn
Diffstat (limited to 'dependencies.js')
-rw-r--r--dependencies.js80
1 files changed, 80 insertions, 0 deletions
diff --git a/dependencies.js b/dependencies.js
index e00887d..e19c4ab 100644
--- a/dependencies.js
+++ b/dependencies.js
@@ -921,6 +921,86 @@ function ExplicitOutBlock() {
}
}
+function Summation() {
+ 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";
+ 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.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 = "Summation";
+ this.blockElementName = arguments.callee.caller.name;
+ }
+}
+
function zeros() {
if (arguments.length == 0) {
return [0];