diff options
author | AMIT KUMAR YADAV | 2016-06-28 16:06:33 +0530 |
---|---|---|
committer | AMIT KUMAR YADAV | 2016-06-28 16:06:33 +0530 |
commit | df30e0f67b2b3e71e187719815357c2285330735 (patch) | |
tree | 71cc14543c7326f3ff70c2f13da7ff590c540e8e /data_structures_correct | |
parent | 07a9675b5e9ca9c61b17183486cbd3a257afa829 (diff) | |
download | xcos-on-web-df30e0f67b2b3e71e187719815357c2285330735.tar.gz xcos-on-web-df30e0f67b2b3e71e187719815357c2285330735.tar.bz2 xcos-on-web-df30e0f67b2b3e71e187719815357c2285330735.zip |
Implement CUMSUM block
Diffstat (limited to 'data_structures_correct')
-rw-r--r-- | data_structures_correct/CUMSUM.js | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/data_structures_correct/CUMSUM.js b/data_structures_correct/CUMSUM.js index 5bde26a..b39b028 100644 --- a/data_structures_correct/CUMSUM.js +++ b/data_structures_correct/CUMSUM.js @@ -1,31 +1,35 @@ -function CUMSUM () { +function CUMSUM() { + CUMSUM.prototype.define = function CUMSUM() { + var model = scicos_model(); - var model = scicos_model(); + 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]); + model.intyp = new ScilabDouble([1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.outtyp = new ScilabDouble([1]); + model.evtin = new ScilabDouble(); + model.evtout = new ScilabDouble(); + model.state = new ScilabDouble(); + model.dstate = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); - this.function_name = "cumsum_m"; - this.funtyp = 4; - - model.sim=list(new ScilabString(this.function_name),new ScilabDouble(this.funtyp)); - model.in1 = new ScilabDouble([-1]); - model.in2 = new ScilabDouble([-2]); - model.intyp = new ScilabDouble([1]); - model.out = new ScilabDouble([-1]); - model.out2 = new ScilabDouble([-2]); - model.outtyp = new ScilabDouble([1]); - model.evtin = new ScilabDouble(); - model.evtout = new ScilabDouble(); - model.state = new ScilabDouble(); - model.dstate = new ScilabDouble(); - model.rpar = new ScilabDouble(); - model.ipar = new ScilabDouble(); - model.blocktype = new ScilabString(["c"]); - model.firing = new ScilabDouble(); - model.dep_ut = new ScilabBoolean([true,false]); + var label = new ScilabString([sci2exp(1)], [sci2exp(0)]); - var label = new ScilabString([sci2exp(1)],[sci2exp(0)]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CUMSUM\",sz(1),sz(2));"]); - this.x=new standard_define(new ScilabDouble([3,2]),model,label,gr_i); - return new BasicBlock(this.x); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CUMSUM\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + CUMSUM.prototype.details = function CUMSUM() { + return this.x; + } } |