diff options
author | Sunil Shetye | 2018-07-09 11:43:39 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-09 12:16:25 +0530 |
commit | 62b1d7dd9183ed75733b44104890586b03818214 (patch) | |
tree | 9859e9ca295df98df945bd5fcccc3a264e8bede1 /js/Electrical | |
parent | 5c011853630a1b466ef4789d5b600dd530d0a3ec (diff) | |
download | sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.gz sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.bz2 sci2js-62b1d7dd9183ed75733b44104890586b03818214.zip |
support ScilabBoolean, ScilabDouble, ScilabString
Diffstat (limited to 'js/Electrical')
48 files changed, 512 insertions, 464 deletions
diff --git a/js/Electrical/CCS.js b/js/Electrical/CCS.js index 6754b973..2278d75e 100644 --- a/js/Electrical/CCS.js +++ b/js/Electrical/CCS.js @@ -4,7 +4,7 @@ function CCS() { ModelName = "CCS"; PrametersValue = []; ParametersName = []; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function CCS() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = []; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2.1,3],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2.1,3],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -61,7 +61,7 @@ function CCS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); } diff --git a/js/Electrical/CCS.pickle b/js/Electrical/CCS.pickle index e3c95720..e284307b 100644 --- a/js/Electrical/CCS.pickle +++ b/js/Electrical/CCS.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/Electrical/CVS.js b/js/Electrical/CVS.js index 59ffbd03..612038a5 100644 --- a/js/Electrical/CVS.js +++ b/js/Electrical/CVS.js @@ -4,7 +4,7 @@ function CVS() { ModelName = "CVS"; PrametersValue = []; ParametersName = []; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function CVS() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = []; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2.1,3],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2.1,3],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -61,7 +61,7 @@ function CVS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); } diff --git a/js/Electrical/CVS.pickle b/js/Electrical/CVS.pickle index e3c95720..e284307b 100644 --- a/js/Electrical/CVS.pickle +++ b/js/Electrical/CVS.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'arg1' p1 diff --git a/js/Electrical/Capacitor.js b/js/Electrical/Capacitor.js index c2d112a7..50314eeb 100644 --- a/js/Electrical/Capacitor.js +++ b/js/Electrical/Capacitor.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Electrical/Capacitor.sci" */ function Capacitor() { Capacitor.prototype.define = function Capacitor() { - model = scicos_model(); + this.model = scicos_model(); this.C = 0.01; this.v = 0; - model.rpar = [[this.C],[this.v]]; - model.sim = "Capacitor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.C],[this.v]]; + this.model.sim = new ScilabString("Capacitor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Capacitor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list(["C","v"],list(this.C,this.v),[0,1]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = string([[this.C],[this.v]]); gr_i = []; - this.x = standard_define([2,1.1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1.1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -39,17 +39,17 @@ function Capacitor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.C,this.v,exprs] = scicos_getvalue("Set Capacitor block parameter",["C (F)","Initial Voltage"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = this.C; - model.equations.parameters[2-1] = list(this.C,this.v); + this.model.rpar = new ScilabDouble(this.C); + this.model.equations.parameters[('2', 'double')] = list(this.C,this.v); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Capacitor.pickle b/js/Electrical/Capacitor.pickle index f4f7f5eb..2b240ad5 100644 --- a/js/Electrical/Capacitor.pickle +++ b/js/Electrical/Capacitor.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'C' +aS'model' p3 -aS'v' +aS'C' p4 -atp5 -Rp6 +aS'v' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 @@ -31,9 +33,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -74,15 +76,15 @@ g5 sS'mo' p25 g2 -sS'model.dep_ut' +sS'x.graphics' p26 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p27 g13 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p28 -g5 +g13 sS'gr_i' p29 g13 diff --git a/js/Electrical/ConstantVoltage.js b/js/Electrical/ConstantVoltage.js index afb791b1..cd1c4d24 100644 --- a/js/Electrical/ConstantVoltage.js +++ b/js/Electrical/ConstantVoltage.js @@ -2,22 +2,22 @@ function ConstantVoltage() { ConstantVoltage.prototype.define = function ConstantVoltage() { this.V = 0.01; - model = scicos_model(); - model.rpar = this.V; - model.in1 = 1; - model.out = 1; - model.sim = "ConstantVoltage"; - model.blocktype = "c"; - model.dep_ut = [false,false]; + this.model = scicos_model(); + this.model.rpar = new ScilabDouble(this.V); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.sim = new ScilabString("ConstantVoltage"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,false]; mo = modelica(); mo.model = "ConstantVoltage"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("V",list(this.V)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string(this.V); gr_i = []; - this.x = standard_define([1.5,1.1],model,exprs,list(gr_i,0)); + this.x = standard_define([1.5,1.1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -35,17 +35,17 @@ function ConstantVoltage() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.V,exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.V; - model.equations.parameters[2-1] = list(this.V); + this.model.rpar = new ScilabDouble(this.V); + this.model.equations.parameters[('2', 'double')] = list(this.V); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/ConstantVoltage.pickle b/js/Electrical/ConstantVoltage.pickle index 3f44287b..47de459a 100644 --- a/js/Electrical/ConstantVoltage.pickle +++ b/js/Electrical/ConstantVoltage.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'V' +aS'model' p3 -atp4 -Rp5 +aS'V' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 @@ -28,9 +30,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -71,15 +73,15 @@ g5 sS'mo' p24 g8 -sS'model.dep_ut' +sS'x.graphics' p25 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p26 g13 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p27 -g5 +g13 sS'gr_i' p28 g13 diff --git a/js/Electrical/CurrentSensor.js b/js/Electrical/CurrentSensor.js index e5beda39..2736b21f 100644 --- a/js/Electrical/CurrentSensor.js +++ b/js/Electrical/CurrentSensor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/CurrentSensor.sci" */ function CurrentSensor() { CurrentSensor.prototype.define = function CurrentSensor() { - model = scicos_model(); - model.in1 = 1; - model.out = [[1],[1]]; - model.sim = "CurrentSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.sim = new ScilabString("CurrentSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "CurrentSensor"; mo.inputs = "p"; mo.outputs = [["n"],["i"]]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new BasicBlock(this.x); diff --git a/js/Electrical/CurrentSensor.pickle b/js/Electrical/CurrentSensor.pickle index a76e4523..13759532 100644 --- a/js/Electrical/CurrentSensor.pickle +++ b/js/Electrical/CurrentSensor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Diode.js b/js/Electrical/Diode.js index 07c96fcc..318a1d5e 100644 --- a/js/Electrical/Diode.js +++ b/js/Electrical/Diode.js @@ -5,22 +5,22 @@ function Diode() { this.Vt = 0.04; this.Maxexp = 15; this.R = 1.e8; - model = scicos_model(); - model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; - model.in1 = 1; - model.out = 1; - model.sim = "Diode"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.sim = new ScilabString("Diode"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Diode"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string([[this.Ids],[this.Vt],[this.Maxexp],[this.R]]); gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -45,17 +45,17 @@ function Diode() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Ids,this.Vt,this.Maxexp,this.R,exprs] = scicos_getvalue("Set Diode block parameter",["Saturation cuurent (A)","Voltage equivalent to temperature (Volt)","Max exponent for linear continuation","R (ohm)"],list("vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; - model.equations.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); + this.model.rpar = [[this.Ids],[this.Vt],[this.Maxexp],[this.R]]; + this.model.equations.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Diode.pickle b/js/Electrical/Diode.pickle index 87390e96..f4ea0109 100644 --- a/js/Electrical/Diode.pickle +++ b/js/Electrical/Diode.pickle @@ -2,18 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'Ids' p2 -aS'R' +aS'Maxexp' p3 -aS'Vt' +aS'R' p4 -aS'Ids' +aS'Vt' p5 -aS'Maxexp' +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Electrical/Ground.js b/js/Electrical/Ground.js index 4818f2da..3703cb30 100644 --- a/js/Electrical/Ground.js +++ b/js/Electrical/Ground.js @@ -1,19 +1,19 @@ /* autogenerated from "macros/Electrical/Ground.sci" */ function Ground() { Ground.prototype.define = function Ground() { - model = scicos_model(); - model.in1 = [1]; - model.out = []; - model.sim = "Ground"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = []; + this.model.sim = new ScilabString("Ground"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Ground"; mo.inputs = "p"; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = ""; gr_i = []; - this.x = standard_define([1,1],model,exprs,list(gr_i,0)); + this.x = standard_define([1,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new GroundBlock(this.x); diff --git a/js/Electrical/Ground.pickle b/js/Electrical/Ground.pickle index c84cf52a..4ffcd0a3 100644 --- a/js/Electrical/Ground.pickle +++ b/js/Electrical/Ground.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Gyrator.js b/js/Electrical/Gyrator.js index 988d2f0c..54f316eb 100644 --- a/js/Electrical/Gyrator.js +++ b/js/Electrical/Gyrator.js @@ -4,7 +4,7 @@ function Gyrator() { ModelName = "Gyrator"; PrametersValue = [[1],[1]]; ParametersName = [["G1"],["G2"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function Gyrator() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["1"],["1"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -65,7 +65,7 @@ function Gyrator() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/Gyrator.pickle b/js/Electrical/Gyrator.pickle index 8a6c5e65..eb017481 100644 --- a/js/Electrical/Gyrator.pickle +++ b/js/Electrical/Gyrator.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'G2' +aS'model' p3 -aS'G1' +aS'G2' p4 -atp5 -Rp6 +aS'G1' +p5 +atp6 +Rp7 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/IdealTransformer.js b/js/Electrical/IdealTransformer.js index 0eb36484..3279b603 100644 --- a/js/Electrical/IdealTransformer.js +++ b/js/Electrical/IdealTransformer.js @@ -4,7 +4,7 @@ function IdealTransformer() { ModelName = "IdealTransformer"; PrametersValue = [1]; ParametersName = ["N"]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function IdealTransformer() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = ["1"]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -63,7 +63,7 @@ function IdealTransformer() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/IdealTransformer.pickle b/js/Electrical/IdealTransformer.pickle index 80b6afcb..9afd07bb 100644 --- a/js/Electrical/IdealTransformer.pickle +++ b/js/Electrical/IdealTransformer.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'N' +aS'model' p3 -atp4 -Rp5 +aS'N' +p4 +atp5 +Rp6 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/Inductor.js b/js/Electrical/Inductor.js index f7452810..545ff3b0 100644 --- a/js/Electrical/Inductor.js +++ b/js/Electrical/Inductor.js @@ -1,23 +1,23 @@ /* autogenerated from "macros/Electrical/Inductor.sci" */ function Inductor() { Inductor.prototype.define = function Inductor() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.L = 1.e-5; - model.rpar = this.L; - model.sim = "Inductor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(this.L); + this.model.sim = new ScilabString("Inductor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Inductor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("L",list(this.L)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = string(this.L); gr_i = []; - this.x = standard_define([2,0.9],model,exprs,list(gr_i,0)); + this.x = standard_define([2,0.9],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -35,17 +35,17 @@ function Inductor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.L,exprs] = scicos_getvalue("Set Inductor block parameter","L (H)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.L; - model.equations.parameters[2-1] = list(this.L); + this.model.rpar = new ScilabDouble(this.L); + this.model.equations.parameters[('2', 'double')] = list(this.L); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Inductor.pickle b/js/Electrical/Inductor.pickle index 7877e5f2..b199a360 100644 --- a/js/Electrical/Inductor.pickle +++ b/js/Electrical/Inductor.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'L' +aS'model' p3 -atp4 -Rp5 +aS'L' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 @@ -29,9 +31,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -71,15 +73,15 @@ g5 sS'mo' p24 g16 -sS'model.dep_ut' +sS'x.graphics' p25 -g8 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p26 g8 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p27 -g5 +g8 sS'gr_i' p28 g8 diff --git a/js/Electrical/MOTOR.js b/js/Electrical/MOTOR.js index c5b1a2c3..967936fb 100644 --- a/js/Electrical/MOTOR.js +++ b/js/Electrical/MOTOR.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Electrical/MOTOR.sci" */ function MOTOR() { MOTOR.prototype.define = function MOTOR() { - model = scicos_model(); - model.out = [[1],[1]]; - model.in1 = [1]; - model.sim = "motor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.out = [[1],[1]]; + this.model.in1 = [1]; + this.model.sim = new ScilabString("motor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; gr_i = []; exprs = ""; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.out_implicit = [["I"],["I"]]; this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); diff --git a/js/Electrical/MOTOR.pickle b/js/Electrical/MOTOR.pickle index 9a3a7caa..a1c0ad46 100644 --- a/js/Electrical/MOTOR.pickle +++ b/js/Electrical/MOTOR.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/NMOS.js b/js/Electrical/NMOS.js index 06efb39c..a85923f3 100644 --- a/js/Electrical/NMOS.js +++ b/js/Electrical/NMOS.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Electrical/NMOS.sci" */ function NMOS() { NMOS.prototype.define = function NMOS() { - model = scicos_model(); + this.model = scicos_model(); this.W = 20.e-6; this.L = 6.e-6; this.Beta = 0.041e-3; @@ -11,20 +11,20 @@ function NMOS() { this.dW = -2.5e-6; this.dL = -1.5e-6; this.RDS = 1.e+7; - model.sim = "NMOS"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("NMOS"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "NMOS"; mo.outputs = [["D"],["B"],["S"]]; mo.inputs = "G"; mo.parameters = list([["W"],["L"],["Beta"],["Vt"],["K2"],["K5"],["dW"],["dL"],["RDS"]],[[this.W],[this.L],[this.Beta],[this.Vt],[this.K2],[this.K5],[this.dW],[this.dL],[this.RDS]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -59,16 +59,16 @@ function NMOS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set NMOS Transistor block parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); + this.model.equations.parameters[('2', 'double')] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/NMOS.pickle b/js/Electrical/NMOS.pickle index 3c7082ed..f0d4356c 100644 --- a/js/Electrical/NMOS.pickle +++ b/js/Electrical/NMOS.pickle @@ -22,8 +22,10 @@ aS'dW' p10 aS'x' p11 -atp12 -Rp13 +aS'model' +p12 +atp13 +Rp14 .(dp0 S'arg1' p1 @@ -51,38 +53,38 @@ g7 sS'model.in1' p11 g7 -sS'x.graphics' +sS'exprs' p12 -g2 -sS'mo.inputs' +S'matrix' p13 +sS'mo.inputs' +p14 g5 sS'Beta' -p14 +p15 g7 sS'x.graphics.in_implicit' -p15 -S'vector' p16 -sS'mo.parameters' +S'vector' p17 -g16 -sS'model.sim' +sS'mo.parameters' p18 +g17 +sS'model.sim' +p19 g5 sS'model.equations' -p19 +p20 g7 sS'RDS' -p20 +p21 g7 sS'mo.outputs' -p21 -S'matrix' p22 +g13 sS'x.graphics.out_implicit' p23 -g22 +g13 sS'L' p24 g7 @@ -93,7 +95,7 @@ sS'graphics.exprs' p26 NsS'typ' p27 -g16 +g17 sS'dW' p28 g7 @@ -106,24 +108,24 @@ g5 sS'mo' p31 g2 -sS'model.dep_ut' +sS'x.graphics' p32 -g16 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p33 -g16 -sS'exprs' +g17 +sS"model.equations.parameters[('2', 'double')]" p34 -g22 +g17 sS'gr_i' p35 -g16 +g17 sS'Vt' p36 g7 sS'y' p37 -g16 +g17 sS'x' p38 g7 diff --git a/js/Electrical/NPN.js b/js/Electrical/NPN.js index e8f8d167..9f7544db 100644 --- a/js/Electrical/NPN.js +++ b/js/Electrical/NPN.js @@ -4,7 +4,7 @@ function NPN() { ModelName = "NPN"; PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function NPN() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -95,7 +95,7 @@ function NPN() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/NPN.pickle b/js/Electrical/NPN.pickle index 16e61485..9363c864 100644 --- a/js/Electrical/NPN.pickle +++ b/js/Electrical/NPN.pickle @@ -38,8 +38,10 @@ aS'EMinMax' p18 aS'x' p19 -atp20 -Rp21 +aS'model' +p20 +atp21 +Rp22 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/OpAmp.js b/js/Electrical/OpAmp.js index df6e5e00..00935c08 100644 --- a/js/Electrical/OpAmp.js +++ b/js/Electrical/OpAmp.js @@ -3,22 +3,22 @@ function OpAmp() { OpAmp.prototype.define = function OpAmp() { S = []; Z = []; - model = scicos_model(); - model.sim = "OpAmp"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("OpAmp"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); - mo.model = model.sim; + mo.model = this.model.sim; mo.inputs = [["in_p"],["in_n"]]; mo.outputs = ["out"]; mo.parameters = list(S,Z); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - model.rpar = Z; + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.model.rpar = Z; exprs = string(Z); gr_i = []; - this.x = standard_define([3,5],model,exprs,gr_i); + this.x = standard_define([3,5],this.model,exprs,gr_i); this.x.graphics.in_implicit = [["I"],["I"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -41,16 +41,16 @@ function OpAmp() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (false) { [ok,this.OLGain,this.SatH,this.SatL,exprs] = scicos_getvalue("Set the Operational Amplifier parameters",["Open Loop Gain","Positive saturation voltage","Negative saturation voltage"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.OLGain,this.SatH,this.SatL); + this.model.equations.parameters[('2', 'double')] = list(this.OLGain,this.SatH,this.SatL); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/OpAmp.pickle b/js/Electrical/OpAmp.pickle index c1058a70..6f195636 100644 --- a/js/Electrical/OpAmp.pickle +++ b/js/Electrical/OpAmp.pickle @@ -6,12 +6,14 @@ S'SatH' p2 aS'x' p3 -aS'OLGain' +aS'model' p4 aS'SatL' p5 -atp6 -Rp7 +aS'OLGain' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 @@ -33,9 +35,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 S'matrix' @@ -79,15 +81,15 @@ g5 sS'mo' p26 g2 -sS'model.dep_ut' +sS'x.graphics' p27 -g15 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p28 g15 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p29 -g5 +g15 sS'gr_i' p30 g15 diff --git a/js/Electrical/PMOS.js b/js/Electrical/PMOS.js index 4d2a2d7f..077514cd 100644 --- a/js/Electrical/PMOS.js +++ b/js/Electrical/PMOS.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Electrical/PMOS.sci" */ function PMOS() { PMOS.prototype.define = function PMOS() { - model = scicos_model(); + this.model = scicos_model(); this.W = 50.0e-6; this.L = 6.0e-6; this.Beta = 0.0105e-3; @@ -11,20 +11,20 @@ function PMOS() { this.dW = -2.5e-6; this.dL = -2.1e-6; this.RDS = 1.e+7; - model.sim = "PMOS"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("PMOS"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PMOS"; mo.outputs = [["D"],["B"],["S"]]; mo.inputs = "G"; mo.parameters = list([["W"],["L"],["Beta"],["Vt"],["K2"],["K5"],["dW"],["dL"],["RDS"]],[[this.W],[this.L],[this.Beta],[this.Vt],[this.K2],[this.K5],[this.dW],[this.dL],[this.RDS]]); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -59,16 +59,16 @@ function PMOS() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set PMOS Transistor parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); + this.model.equations.parameters[('2', 'double')] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/PMOS.pickle b/js/Electrical/PMOS.pickle index 3c7082ed..f0d4356c 100644 --- a/js/Electrical/PMOS.pickle +++ b/js/Electrical/PMOS.pickle @@ -22,8 +22,10 @@ aS'dW' p10 aS'x' p11 -atp12 -Rp13 +aS'model' +p12 +atp13 +Rp14 .(dp0 S'arg1' p1 @@ -51,38 +53,38 @@ g7 sS'model.in1' p11 g7 -sS'x.graphics' +sS'exprs' p12 -g2 -sS'mo.inputs' +S'matrix' p13 +sS'mo.inputs' +p14 g5 sS'Beta' -p14 +p15 g7 sS'x.graphics.in_implicit' -p15 -S'vector' p16 -sS'mo.parameters' +S'vector' p17 -g16 -sS'model.sim' +sS'mo.parameters' p18 +g17 +sS'model.sim' +p19 g5 sS'model.equations' -p19 +p20 g7 sS'RDS' -p20 +p21 g7 sS'mo.outputs' -p21 -S'matrix' p22 +g13 sS'x.graphics.out_implicit' p23 -g22 +g13 sS'L' p24 g7 @@ -93,7 +95,7 @@ sS'graphics.exprs' p26 NsS'typ' p27 -g16 +g17 sS'dW' p28 g7 @@ -106,24 +108,24 @@ g5 sS'mo' p31 g2 -sS'model.dep_ut' +sS'x.graphics' p32 -g16 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p33 -g16 -sS'exprs' +g17 +sS"model.equations.parameters[('2', 'double')]" p34 -g22 +g17 sS'gr_i' p35 -g16 +g17 sS'Vt' p36 g7 sS'y' p37 -g16 +g17 sS'x' p38 g7 diff --git a/js/Electrical/PNP.js b/js/Electrical/PNP.js index ecb4cc99..836bf673 100644 --- a/js/Electrical/PNP.js +++ b/js/Electrical/PNP.js @@ -4,7 +4,7 @@ function PNP() { ModelName = "PNP"; PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; - model = scicos_model(); + this.model = scicos_model(); Typein = []; Typeout = []; MI = []; @@ -29,22 +29,22 @@ function PNP() { MO = [[MO],[PortName[i-1]]]; } } - model = scicos_model(); + this.model = scicos_model(); mo = modelica(); - model.sim = ModelName; + this.model.sim = new ScilabString(ModelName); mo.inputs = MI; mo.outputs = MO; - model.rpar = PrametersValue; + this.model.rpar = PrametersValue; mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; gr_i = []; - model.blocktype = "c"; - model.dep_ut = [false,true]; + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [false,true]; mo.model = ModelName; - model.equations = mo; - model.in1 = ones(size(MI,"*"),1); - model.out = ones(size(MO,"*"),1); - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(MI,"*"),1)); + this.model.out = new ScilabDouble(ones(size(MO,"*"),1)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -95,7 +95,7 @@ function PNP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; this.x = arg1; exprs = this.x.graphics.exprs; while (true) { diff --git a/js/Electrical/PNP.pickle b/js/Electrical/PNP.pickle index 16e61485..9363c864 100644 --- a/js/Electrical/PNP.pickle +++ b/js/Electrical/PNP.pickle @@ -38,8 +38,10 @@ aS'EMinMax' p18 aS'x' p19 -atp20 -Rp21 +aS'model' +p20 +atp21 +Rp22 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/PotentialSensor.js b/js/Electrical/PotentialSensor.js index 9ef7202b..98959cd1 100644 --- a/js/Electrical/PotentialSensor.js +++ b/js/Electrical/PotentialSensor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/PotentialSensor.sci" */ function PotentialSensor() { PotentialSensor.prototype.define = function PotentialSensor() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; - model.rpar = []; - model.sim = "PotentialSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; + this.model.rpar = []; + this.model.sim = new ScilabString("PotentialSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "PotentialSensor"; mo.inputs = "p"; mo.outputs = ["v"]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); gr_i = []; - this.x = standard_define([2,2],model,"",list(gr_i,0)); + this.x = standard_define([2,2],this.model,"",list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["E"]; return new BasicBlock(this.x); diff --git a/js/Electrical/PotentialSensor.pickle b/js/Electrical/PotentialSensor.pickle index f97bffc2..5e42e801 100644 --- a/js/Electrical/PotentialSensor.pickle +++ b/js/Electrical/PotentialSensor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Resistor.js b/js/Electrical/Resistor.js index be2d95bf..b1e2354c 100644 --- a/js/Electrical/Resistor.js +++ b/js/Electrical/Resistor.js @@ -1,23 +1,23 @@ /* autogenerated from "macros/Electrical/Resistor.sci" */ function Resistor() { Resistor.prototype.define = function Resistor() { - model = scicos_model(); + this.model = scicos_model(); this.R = 0.01; - model.rpar = this.R; - model.sim = "resistor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = new ScilabDouble(this.R); + this.model.sim = new ScilabString("resistor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "Resistor"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list("R",list(this.R)); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = string(this.R); gr_i = []; - this.x = standard_define([2,1],model,exprs,list(gr_i,0)); + this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -35,17 +35,17 @@ function Resistor() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.R,exprs] = scicos_getvalue("Set Resistor block parameter","R (ohm)",list("vec",1),exprs); if (!ok) { break; } - model.rpar = this.R; - model.equations.parameters[2-1] = list(this.R); + this.model.rpar = new ScilabDouble(this.R); + this.model.equations.parameters[('2', 'double')] = list(this.R); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Resistor.pickle b/js/Electrical/Resistor.pickle index fa394c32..ee2c3eeb 100644 --- a/js/Electrical/Resistor.pickle +++ b/js/Electrical/Resistor.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'R' +aS'model' p3 -atp4 -Rp5 +aS'R' +p4 +atp5 +Rp6 .(dp0 S'arg1' p1 @@ -29,9 +31,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 g5 @@ -71,15 +73,15 @@ g5 sS'mo' p24 g2 -sS'model.dep_ut' +sS'x.graphics' p25 -g13 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p26 g13 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p27 -g5 +g13 sS'gr_i' p28 g13 diff --git a/js/Electrical/SineVoltage.js b/js/Electrical/SineVoltage.js index cd36b471..4b6f5c2b 100644 --- a/js/Electrical/SineVoltage.js +++ b/js/Electrical/SineVoltage.js @@ -1,27 +1,27 @@ /* autogenerated from "macros/Electrical/SineVoltage.sci" */ function SineVoltage() { SineVoltage.prototype.define = function SineVoltage() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.V = 1; this.ph = 0; this.frq = 1; this.offset = 0; this.start = 0; - model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; - model.sim = "SineVoltage"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; + this.model.sim = new ScilabString("SineVoltage"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "SineVoltage"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list([["V"],["phase"],["freqHz"],["offset"],["startTime"]],list(this.V,this.ph,this.frq,this.offset,this.start)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [[string(this.V)],[string(this.ph)],[string(this.frq)],[string(this.offset)],[string(this.start)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -48,17 +48,17 @@ function SineVoltage() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.V,this.ph,this.frq,this.offset,this.start,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","phase (rad)","Frequency (Hz)","Voltageoffset (V)","Timeoffset (s)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; - model.equations.parameters[2-1] = list(this.V,this.ph,this.frq,this.offset,this.start); + this.model.rpar = [[this.V],[this.ph],[this.frq],[this.offset],[this.start]]; + this.model.equations.parameters[('2', 'double')] = list(this.V,this.ph,this.frq,this.offset,this.start); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/SineVoltage.pickle b/js/Electrical/SineVoltage.pickle index 8e37a926..0a6e8a72 100644 --- a/js/Electrical/SineVoltage.pickle +++ b/js/Electrical/SineVoltage.pickle @@ -12,10 +12,12 @@ aS'offset' p5 aS'x' p6 -aS'ph' +aS'model' p7 -atp8 -Rp9 +aS'ph' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 @@ -38,46 +40,46 @@ p9 sS'model.in1' p10 g9 -sS'x.graphics' +sS'exprs' p11 -g2 -sS'mo.inputs' +S'matrix' p12 +sS'mo.inputs' +p13 g6 sS'start' -p13 +p14 g4 sS'frq' -p14 +p15 g4 sS'x.graphics.in_implicit' -p15 +p16 g9 sS'ph' -p16 +p17 g4 sS'mo.parameters' -p17 +p18 g9 sS'model.sim' -p18 +p19 g6 sS'V' -p19 +p20 g4 sS'model.equations' -p20 +p21 g4 sS'mo.outputs' -p21 +p22 g6 sS'x.graphics.out_implicit' -p22 +p23 g9 sS'model.rpar' -p23 -S'matrix' p24 +g12 sS'graphics.exprs' p25 NsS'typ' @@ -89,15 +91,15 @@ g6 sS'graphics' p28 g2 -sS'model.dep_ut' +sS'x.graphics' p29 -g9 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p30 g9 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p31 -g24 +g9 sS'gr_i' p32 g9 diff --git a/js/Electrical/Switch.js b/js/Electrical/Switch.js index eff6b74e..3eafb101 100644 --- a/js/Electrical/Switch.js +++ b/js/Electrical/Switch.js @@ -1,26 +1,26 @@ /* autogenerated from "macros/Electrical/Switch.sci" */ function Switch() { Switch.prototype.define = function Switch() { - model = scicos_model(); + this.model = scicos_model(); this.Ron = 0.01; this.Roff = 1e5; S = [["Ron"],["Roff"]]; Z = eval(S); - model.sim = "Switch"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.sim = new ScilabString("Switch"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); - mo.model = model.sim; + mo.model = this.model.sim; mo.inputs = [["p"],["inp"]]; mo.outputs = "n"; mo.parameters = list(S,Z); - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); - model.rpar = Z; + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); + this.model.rpar = new ScilabDouble(Z); exprs = string(Z); gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = [["I"],["E"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -41,16 +41,16 @@ function Switch() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.Ron,this.Roff,exprs] = scicos_getvalue("Set non-ideal electrical switch parameters",["Resistance in On state (Ohm)","Resistance in Off state (Ohm)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - model.equations.parameters[2-1] = list(this.Ron,this.Roff); + this.model.equations.parameters[('2', 'double')] = list(this.Ron,this.Roff); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Switch.pickle b/js/Electrical/Switch.pickle index aa8da9b7..7c389ff0 100644 --- a/js/Electrical/Switch.pickle +++ b/js/Electrical/Switch.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'Roff' +aS'model' p3 -aS'Ron' +aS'Roff' p4 -atp5 -Rp6 +aS'Ron' +p5 +atp6 +Rp7 .(dp0 S'arg1' p1 @@ -31,9 +33,9 @@ p8 sS'model.in1' p9 g8 -sS'x.graphics' +sS'exprs' p10 -g2 +g5 sS'mo.inputs' p11 S'matrix' @@ -83,15 +85,15 @@ g8 sS'mo' p28 g2 -sS'model.dep_ut' +sS'x.graphics' p29 -g15 -sS'model.equations.parameters[2-1]' +g2 +sS'model.dep_ut' p30 g15 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p31 -g5 +g15 sS'gr_i' p32 g15 diff --git a/js/Electrical/VVsourceAC.js b/js/Electrical/VVsourceAC.js index 228d84ac..d693c9e1 100644 --- a/js/Electrical/VVsourceAC.js +++ b/js/Electrical/VVsourceAC.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Electrical/VVsourceAC.sci" */ function VVsourceAC() { VVsourceAC.prototype.define = function VVsourceAC() { - model = scicos_model(); - model.in1 = [[1],[1]]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [[1],[1]]; + this.model.out = [1]; VA = 220; this.FR = 50; - model.rpar = [this.FR]; - model.sim = "VVsourceAC"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [this.FR]; + this.model.sim = new ScilabString("VVsourceAC"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VVsourceAC"; mo.inputs = ["p","VA"]; mo.outputs = "n"; mo.parameters = list(["f"],list(this.FR)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [string(this.FR)]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -37,17 +37,17 @@ function VVsourceAC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Frequency (Hz)"],list("vec",-1),exprs); if (!ok) { break; } - model.rpar = [this.FR]; - model.equations.parameters[2-1] = list(this.FR); + this.model.rpar = [this.FR]; + this.model.equations.parameters[('2', 'double')] = list(this.FR); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/VVsourceAC.pickle b/js/Electrical/VVsourceAC.pickle index 09f887d5..92fec777 100644 --- a/js/Electrical/VVsourceAC.pickle +++ b/js/Electrical/VVsourceAC.pickle @@ -4,10 +4,12 @@ p0 ((lp1 S'x' p2 -aS'FR' +aS'model' p3 -atp4 -Rp5 +aS'FR' +p4 +atp5 +Rp6 .(dp0 S'FR' p1 @@ -37,9 +39,9 @@ sS'model.in1' p12 S'matrix' p13 -sS'x.graphics' +sS'exprs' p14 -g6 +g11 sS'mo.inputs' p15 g11 @@ -75,13 +77,13 @@ g4 sS'mo' p26 g2 -sS'model.dep_ut' +sS'x.graphics' p27 -g11 -sS'model.equations.parameters[2-1]' +g6 +sS'model.dep_ut' p28 g11 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p29 g11 sS'gr_i' diff --git a/js/Electrical/VariableResistor.js b/js/Electrical/VariableResistor.js index 2244df08..f9aaff39 100644 --- a/js/Electrical/VariableResistor.js +++ b/js/Electrical/VariableResistor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/VariableResistor.sci" */ function VariableResistor() { VariableResistor.prototype.define = function VariableResistor() { - model = scicos_model(); - model.sim = "VariableResistor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("VariableResistor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VariableResistor"; mo.inputs = ["p","R"]; mo.outputs = "n"; - model.equations = mo; - model.in1 = ones(size(mo.inputs,"*"),1); - model.out = ones(size(mo.outputs,"*"),1); + this.model.equations = new ScilabDouble(mo); + this.model.in1 = new ScilabDouble(ones(size(mo.inputs,"*"),1)); + this.model.out = new ScilabDouble(ones(size(mo.outputs,"*"),1)); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); diff --git a/js/Electrical/VariableResistor.pickle b/js/Electrical/VariableResistor.pickle index a8d46cd4..850419e5 100644 --- a/js/Electrical/VariableResistor.pickle +++ b/js/Electrical/VariableResistor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/VoltageSensor.js b/js/Electrical/VoltageSensor.js index 74af23d8..b32c3766 100644 --- a/js/Electrical/VoltageSensor.js +++ b/js/Electrical/VoltageSensor.js @@ -1,20 +1,20 @@ /* autogenerated from "macros/Electrical/VoltageSensor.sci" */ function VoltageSensor() { VoltageSensor.prototype.define = function VoltageSensor() { - model = scicos_model(); - model.in1 = 1; - model.out = [[1],[1]]; - model.sim = "VoltageSensor"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.in1 = new ScilabDouble(1); + this.model.out = [[1],[1]]; + this.model.sim = new ScilabString("VoltageSensor"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VoltageSensor"; mo.inputs = "p"; mo.outputs = [["n"],["v"]]; - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = []; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new VoltageSensorBlock(this.x); diff --git a/js/Electrical/VoltageSensor.pickle b/js/Electrical/VoltageSensor.pickle index a76e4523..13759532 100644 --- a/js/Electrical/VoltageSensor.pickle +++ b/js/Electrical/VoltageSensor.pickle @@ -4,8 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'model' +p3 +atp4 +Rp5 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/VsourceAC.js b/js/Electrical/VsourceAC.js index 9dd180d9..c1cf8acc 100644 --- a/js/Electrical/VsourceAC.js +++ b/js/Electrical/VsourceAC.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/Electrical/VsourceAC.sci" */ function VsourceAC() { VsourceAC.prototype.define = function VsourceAC() { - model = scicos_model(); - model.in1 = [1]; - model.out = [1]; + this.model = scicos_model(); + this.model.in1 = [1]; + this.model.out = [1]; this.VA = 220; this.FR = 50; - model.rpar = [[this.VA],[this.FR]]; - model.sim = "VsourceAC"; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model.rpar = [[this.VA],[this.FR]]; + this.model.sim = new ScilabString("VsourceAC"); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; mo = modelica(); mo.model = "VsourceAC"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list([["VA"],["f"]],list(this.VA,this.FR)); - model.equations = mo; + this.model.equations = new ScilabDouble(mo); exprs = [[string(this.VA)],[string(this.FR)]]; gr_i = []; - this.x = standard_define([2,2],model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -39,17 +39,17 @@ function VsourceAC() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.VA,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","Frequency (Hz)"],list("vec",-1,"vec",-1),exprs); if (!ok) { break; } - model.rpar = [[this.VA],[this.FR]]; - model.equations.parameters[2-1] = list(this.VA,this.FR); + this.model.rpar = [[this.VA],[this.FR]]; + this.model.equations.parameters[('2', 'double')] = list(this.VA,this.FR); graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/VsourceAC.pickle b/js/Electrical/VsourceAC.pickle index b545ba61..2922295d 100644 --- a/js/Electrical/VsourceAC.pickle +++ b/js/Electrical/VsourceAC.pickle @@ -4,12 +4,14 @@ p0 ((lp1 S'x' p2 -aS'FR' +aS'model' p3 -aS'VA' +aS'FR' p4 -atp5 -Rp6 +aS'VA' +p5 +atp6 +Rp7 .(dp0 S'FR' p1 @@ -38,34 +40,34 @@ p11 sS'model.in1' p12 g11 -sS'x.graphics' +sS'exprs' p13 -g6 -sS'mo.inputs' +S'matrix' p14 +sS'mo.inputs' +p15 g4 sS'x.graphics.in_implicit' -p15 +p16 g11 sS'mo.parameters' -p16 +p17 g11 sS'VA' -p17 +p18 g2 sS'model.equations' -p18 +p19 g2 sS'mo.outputs' -p19 +p20 g4 sS'x.graphics.out_implicit' -p20 +p21 g11 sS'model.rpar' -p21 -S'matrix' p22 +g14 sS'graphics.exprs' p23 NsS'typ' @@ -77,15 +79,15 @@ g4 sS'mo' p26 g2 -sS'model.dep_ut' +sS'x.graphics' p27 -g11 -sS'model.equations.parameters[2-1]' +g6 +sS'model.dep_ut' p28 g11 -sS'exprs' +sS"model.equations.parameters[('2', 'double')]" p29 -g22 +g11 sS'gr_i' p30 g11 |