From ce0ad4379d21420c90f1c342ece4966e31e3a554 Mon Sep 17 00:00:00 2001 From: Chhavi2208 Date: Thu, 18 Aug 2016 23:18:28 +0530 Subject: JKFLIPFLOP --- data_structures_correct/EDGETRIGGER.js | 20 + data_structures_correct/EDGE_TRIGGER.js | 94 +++ data_structures_correct/ENDBLK.js | 106 +++ data_structures_correct/Gyrator.js | 56 ++ data_structures_correct/INIMPL_f.js | 27 + data_structures_correct/MCLOCK_f.js | 128 +++ data_structures_correct/freq_div.js | 123 +++ .../webapp/data_structures_correct/JKFLIPFLOP.js | 897 +++++++++++++++++++++ 8 files changed, 1451 insertions(+) create mode 100644 data_structures_correct/EDGETRIGGER.js create mode 100644 data_structures_correct/EDGE_TRIGGER.js create mode 100644 data_structures_correct/ENDBLK.js create mode 100644 data_structures_correct/Gyrator.js create mode 100644 data_structures_correct/INIMPL_f.js create mode 100644 data_structures_correct/MCLOCK_f.js create mode 100644 data_structures_correct/freq_div.js create mode 100644 src/main/webapp/data_structures_correct/JKFLIPFLOP.js diff --git a/data_structures_correct/EDGETRIGGER.js b/data_structures_correct/EDGETRIGGER.js new file mode 100644 index 0000000..11fba5b --- /dev/null +++ b/data_structures_correct/EDGETRIGGER.js @@ -0,0 +1,20 @@ +function EDGETRIGGER () { + + EDGETRIGGER.prototype.internal = function EDGETRIGGER() { + this.edge=1; + var model=scicos_model(); + model.sim=list(new ScilabString(["edgetrig"]),new ScilabDouble([4])); + model.in=new ScilabDouble([1]); + model.out=new ScilabDouble([1]); + model.dstate=new ScilabDouble([0]); + model.nzcross=new ScilabDouble([1]); + model.ipar=new ScilabDouble([this.edge]); + model.blocktype=new ScilabString(["c"]); + model.dep_ut=new ScilabBoolean([true, false]); + + exprs=new ScilabString([this.edge]); + gr_i=new ScilabString(["xstringb(orig(1),orig(2),"EDGETRIGGER",sz(1),sz(2));"]); + var block=standard_define([3 2],model,exprs,gr_i); + return block; + } +} \ No newline at end of file diff --git a/data_structures_correct/EDGE_TRIGGER.js b/data_structures_correct/EDGE_TRIGGER.js new file mode 100644 index 0000000..5d6ee43 --- /dev/null +++ b/data_structures_correct/EDGE_TRIGGER.js @@ -0,0 +1,94 @@ +function EDGE_TRIGGER () { + + EDGE_TRIGGER.prototype.define = function EDGE_TRIGGER() { + var scs_m_1 = scicos_diagram(); + scs_m_1.objs.push(new EDGETRIGGER().internal()); + scs_m_1.objs.push(new IFTHEL_f().internal()); + scs_m_1.objs.push(new IN_f().internal()); + scs_m_1.objs.push(new CLKOUTV_f().internal()); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + + var blk = scs_m_1.objs[0]; + var graphics = blk.graphics; + var model = blk.model; + graphics.orig = new ScilabDouble([60,0]); + graphics.sz = new ScilabDouble([60,40]); + graphics.exprs = new ScilabString(["0"]); + model.ipar = new ScilabDouble([0]); + graphics.pin = new ScilabDouble([5]); + graphics.pout = new ScilabDouble([6]); + blk.graphics=graphics; + blk.model=model; + scs_m_1.objs[0] = blk; + + blk=scs_m_1.objs[1]; + graphics=blk.graphics; + model=blk.model; + graphics.orig = new ScilabDouble([160,0]); + graphics.sz = new ScilabDouble([60,40]); + graphics.exprs = new ScilabString(["0"],["0"]); + model.evtin = new ScilabDouble(); + model.nzcross = new ScilabDouble([0]); + model.nmode = new ScilabDouble([0]); + graphics.pin = new ScilabDouble([6]); + graphics.peout = new ScilabDouble([7],[0]); + blk.graphics=graphics; + blk.model=model; + + scs_m_1.objs[1] = blk; + blk=scs_m_1.objs[2]; + graphics=blk.graphics; + model=blk.model; + graphics.orig = new ScilabDouble([0,10]); + graphics.sz = new ScilabDouble([20,20]); + graphics.exprs = new ScilabString(["1"]); + model.ipar = new ScilabDouble([1]); + graphics.pout = new ScilabDouble([5]); + blk.graphics=graphics; + blk.model=model; + scs_m_1.objs.push(blk); + + blk=scs_m_1.objs[3]; + graphics=blk.graphics; + model=blk.model; + graphics.orig = new ScilabDouble([170,-60]); + graphics.sz = new ScilabDouble([20,20]); + graphics.exprs = new ScilabString(["1"]); + model.ipar = new ScilabDouble([1]); + graphics.pein = new ScilabDouble([7]); + blk.graphics=graphics; + blk.model=model; + scs_m_1.objs[3] = blk; + + var lnk = scs_m_1.objs[4]; + lnk.from = new ScilabDouble([3,1,0]); + lnk.to = new ScilabDouble([1,1,1]); + scs_m_1.objs[4] = lnk; + + lnk=scs_m_1.objs[5]; + lnk.from = new ScilabDouble([1,1,0]); + lnk.to = new ScilabDouble([2,1,1]); + scs_m_1.objs[5] = lnk; + + lnk=scs_m_1.objs[6]; + lnk.ct = new ScilabDouble([5,-1]); + lnk.from = new ScilabDouble([2,1,0]); + lnk.to = new ScilabDouble([4,1,1]); + scs_m_1.objs[6] = lnk; + + model=scicos_model(); + model.sim = new ScilabString(["csuper"]); + model.in1 = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar=scs_m_1; + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"EDGE_TRIGGER",sz(1),sz(2));"]); + this.x=new standard_define(new ScilabDouble([3,2]),model,new ScilabDouble(),gr_i); + return new BasicBlock(this.x); + } + EDGE_TRIGGER.prototype.details = function EDGE_TRIGGER() { + return this.x; + } +} diff --git a/data_structures_correct/ENDBLK.js b/data_structures_correct/ENDBLK.js new file mode 100644 index 0000000..6e56c5a --- /dev/null +++ b/data_structures_correct/ENDBLK.js @@ -0,0 +1,106 @@ +function ENDBLK () { + + ENDBLK.prototype.define = function ENDBLK() { + var scs_m_1 = scicos_diagram({ + version : new ScilabString(["scicos4.2"]), + props : scicos_params({ + wpar: new ScilabDouble([600, 450, 0, 0, 600, 450]), + Title : new ScilabString(["ENDBLK"]), + 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(["END_c"]), + graphics : scicos_graphics({ + orig : new ScilabDouble([272.104,249.11733]), + sz : new ScilabDouble([40,40]), + flip : new ScilabBoolean([true]), + theta :new ScilabDouble([0]) + exprs : new ScilabString(["1.000E+08"]), + pin : new ScilabDouble(), + pout : new ScilabDouble(), + pein :new ScilabDouble([2]) + peout :new ScilabDouble([2]) + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"END_c",sz(1),sz(2));"]), new ScilabDouble([8])), + id : new ScilabString([""]), + in_implicit : new ScilabDouble(), + out_implicit : new ScilabDouble(), + style: new ScilabString(["END_c"]) + }), + model : scicos_model({ + sim : list(new ScilabString(["scicosexit"]),new ScilabDouble([4])), + in : new ScilabDouble(), + in2 : new ScilabDouble(), + intyp :new ScilabDouble([1]) + out : new ScilabDouble(), + out2 : new ScilabDouble(), + 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(), + opar : list(), + blocktype : new ScilabString(["d"]), + firing : new ScilabDouble([1.000E+08]), + 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([292.104],[292.104],[261.83733],[261.83733],[292.104],[292.104]), + yy: new ScilabDouble([243.40305],[234.45067],[234.45067],[305.584],[305.584],[294.83162]), + 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]) + })); + + var model = scicos_model({ + sim : new ScilabString(["csuper"]), + in : new ScilabDouble(), + in2 : new ScilabDouble(), + intyp :new ScilabDouble([1]) + out : new ScilabDouble(), + out2 : new ScilabDouble(), + 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),"ENDBLK",sz(1),sz(2));"]); + this.x=new standard_define(new ScilabDouble([2,2]),model,new ScilabDouble(),gr_i); + return new BasicBlock(this.x); + } + ENDBLK.prototype.details = function ENDBLK() { + return this.x; + } +} diff --git a/data_structures_correct/Gyrator.js b/data_structures_correct/Gyrator.js new file mode 100644 index 0000000..46ac1b5 --- /dev/null +++ b/data_structures_correct/Gyrator.js @@ -0,0 +1,56 @@ +function Gyrator () { + + Gyrator.prototype.define = function Gyrator() { + this.ModelName = "Gyrator"; + this.PrametersValue = [[1],[1]]; + this.ParametersName = [["G1"],["G2"]]; + this.model = scicos_model(); + this.Typein = []; + this.Typeout = []; + this.MI = []; + this.MO = []; + this.P = [[2.5,90,2,0],[2.5,10,2,0],[97.5,90,-2,0],[97.5,10,-2,0]]; + this.PortName = [["p1"],["n1"],["p2"],["n2"]]; + + for (var i=0; i