diff options
Diffstat (limited to 'js/Electrical/Capacitor.js')
-rw-r--r-- | js/Electrical/Capacitor.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/Electrical/Capacitor.js b/js/Electrical/Capacitor.js index 574a584f..2344fab7 100644 --- a/js/Electrical/Capacitor.js +++ b/js/Electrical/Capacitor.js @@ -16,9 +16,9 @@ function Capacitor() { this.model.equations = new ScilabDouble([mo]); this.model.in = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); - this.exprs = string([[this.C],[this.v]]); - this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Capacitor\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([2,1.1]),this.model,new ScilabString([this.exprs]),list(this.gr_i,0)); + var exprs = string([[this.C],[this.v]]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Capacitor\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2,1.1]),this.model,new ScilabString([exprs]),list(gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -34,7 +34,7 @@ function Capacitor() { return options; } Capacitor.prototype.set = function Capacitor() { - this.exprs = this.graphics.exprs; + var exprs = this.graphics.exprs; while (true) { var ok = true; this.C = parseFloat(arguments[0]["C"]); @@ -44,7 +44,7 @@ function Capacitor() { } this.model.rpar = new ScilabDouble([this.C]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.C]), new ScilabDouble([this.v])); - this.graphics.exprs = new ScilabDouble([this.exprs]); + this.graphics.exprs = new ScilabDouble([exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; |