summaryrefslogtreecommitdiff
path: root/js/Electrical/Resistor.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Electrical/Resistor.js')
-rw-r--r--js/Electrical/Resistor.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/js/Electrical/Resistor.js b/js/Electrical/Resistor.js
index fa493c6d..ab3ddf84 100644
--- a/js/Electrical/Resistor.js
+++ b/js/Electrical/Resistor.js
@@ -15,9 +15,9 @@ function Resistor() {
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)]);
- var exprs = string(this.R);
- var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Resistor\",sz(1),sz(2));"]);
- this.x = standard_define([2,1],this.model,exprs,list(gr_i,0));
+ this.exprs = string(this.R);
+ this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Resistor\",sz(1),sz(2));"]);
+ this.x = standard_define([2,1],this.model,this.exprs,list(this.gr_i,0));
this.x.graphics.in_implicit = ["I"];
this.x.graphics.out_implicit = ["I"];
return new BasicBlock(this.x);
@@ -32,18 +32,19 @@ function Resistor() {
}
Resistor.prototype.set = function Resistor() {
this.R = parseFloat(arguments[0]["R"])
+ this.exprs = arguments[0]["exprs"]
this.x = arg1;
this.graphics = arg1.graphics;
- var exprs = this.graphics.exprs;
+ this.exprs = this.graphics.exprs;
this.model = arg1.model;
while (true) {
- [ok,this.R,exprs] = scicos_getvalue("Set Resistor block parameter","R (ohm)",list("vec",1),exprs);
+ [ok,this.R,this.exprs] = scicos_getvalue("Set Resistor block parameter","R (ohm)",list("vec",1),this.exprs);
if (!ok) {
break;
}
this.model.rpar = new ScilabDouble([this.R]);
this.model.equations.parameters[2-1] = list(new ScilabDouble([this.R]));
- this.graphics.exprs = new ScilabDouble([exprs]);
+ this.graphics.exprs = new ScilabDouble([this.exprs]);
this.x.graphics = this.graphics;
this.x.model = this.model;
break;