diff options
author | Sunil Shetye | 2018-07-11 17:51:05 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-12 23:01:50 +0530 |
commit | 44a3807a94783e831070f0e003340af58dc64d16 (patch) | |
tree | cce50388afa463583d7a7aead34d40f5b02281f7 /js/Electrical/Switch.js | |
parent | 0047c3bea1d86b12a08544f6f0833c63e77f6eac (diff) | |
download | sci2js-44a3807a94783e831070f0e003340af58dc64d16.tar.gz sci2js-44a3807a94783e831070f0e003340af58dc64d16.tar.bz2 sci2js-44a3807a94783e831070f0e003340af58dc64d16.zip |
change graphics to object
Diffstat (limited to 'js/Electrical/Switch.js')
-rw-r--r-- | js/Electrical/Switch.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/Electrical/Switch.js b/js/Electrical/Switch.js index e922c86e..927bd912 100644 --- a/js/Electrical/Switch.js +++ b/js/Electrical/Switch.js @@ -39,17 +39,17 @@ function Switch() { this.Ron = parseFloat(arguments[0]["Ron"]) this.Roff = parseFloat(arguments[0]["Roff"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; 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; } - this.model.equations.parameters[2] = list(new ScilabDouble([this.Ron]), new ScilabDouble([this.Roff])); - graphics.exprs = exprs; - this.x.graphics = graphics; + this.model.equations.parameters[2-1] = list(new ScilabDouble([this.Ron]), new ScilabDouble([this.Roff])); + this.graphics.exprs = new ScilabDouble([exprs]); + this.x.graphics = this.graphics; this.x.model = this.model; break; } |