diff options
author | Adhitya Kamakshidasan | 2016-07-12 15:28:26 +0530 |
---|---|---|
committer | GitHub | 2016-07-12 15:28:26 +0530 |
commit | a0a37b2eb0f8912f5f62166c57b760d35d5760f0 (patch) | |
tree | 0176cf3f058a23b6ffc075dd71b35fe4e8c85c9b /data_structures_correct/VsourceAC.js | |
parent | 3e26a30a0319cadf4e76685911007be1f4e17998 (diff) | |
parent | 4e2adfaa2c68899b72f70d3cb82d9960a647644a (diff) | |
download | xcos-on-web-a0a37b2eb0f8912f5f62166c57b760d35d5760f0.tar.gz xcos-on-web-a0a37b2eb0f8912f5f62166c57b760d35d5760f0.tar.bz2 xcos-on-web-a0a37b2eb0f8912f5f62166c57b760d35d5760f0.zip |
Merge pull request #169 from avi-psvm-dutta/master
Implement ZCROSS_f Block
Diffstat (limited to 'data_structures_correct/VsourceAC.js')
-rw-r--r-- | data_structures_correct/VsourceAC.js | 37 |
1 files changed, 37 insertions, 0 deletions
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; + } +} |