summaryrefslogtreecommitdiff
path: root/js/Electrical/ConstantVoltage.js
diff options
context:
space:
mode:
authorSunil Shetye2018-06-26 14:59:47 +0530
committerSunil Shetye2018-06-26 14:59:47 +0530
commiteb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00 (patch)
tree6378935263fe5cafd389b6893ac3b37a1dd4b1a7 /js/Electrical/ConstantVoltage.js
parentafed64f1a0eab0b2d742088186d7bc340a2c895b (diff)
downloadsci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.tar.gz
sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.tar.bz2
sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.zip
add return value from scicos_getvalue to global vars
Diffstat (limited to 'js/Electrical/ConstantVoltage.js')
-rw-r--r--js/Electrical/ConstantVoltage.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/js/Electrical/ConstantVoltage.js b/js/Electrical/ConstantVoltage.js
index 43a2c0b6..c0e752f1 100644
--- a/js/Electrical/ConstantVoltage.js
+++ b/js/Electrical/ConstantVoltage.js
@@ -1,9 +1,9 @@
/* autogenerated from "macros/Electrical/ConstantVoltage.sci" */
function ConstantVoltage() {
ConstantVoltage.prototype.define = function ConstantVoltage() {
- V = 0.01;
+ this.V = 0.01;
model = scicos_model();
- model.rpar = V;
+ model.rpar = this.V;
model.in1 = 1;
model.out = 1;
model.sim = "ConstantVoltage";
@@ -13,9 +13,9 @@ function ConstantVoltage() {
mo.model = "ConstantVoltage";
mo.inputs = "p";
mo.outputs = "n";
- mo.parameters = list("V",list(V));
+ mo.parameters = list("V",list(this.V));
model.equations = mo;
- exprs = string(V);
+ exprs = string(this.V);
gr_i = [];
this.x = standard_define([1.5,1.1],model,exprs,list(gr_i,0));
this.x.graphics.in_implicit = ["I"];
@@ -33,12 +33,12 @@ function ConstantVoltage() {
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,V,exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs);
+ [ok,this.V,exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs);
if (!ok) {
break;
}
- model.rpar = V;
- model.equations.parameters[2-1] = list(V);
+ model.rpar = this.V;
+ model.equations.parameters[2-1] = list(this.V);
graphics.exprs = exprs;
this.x.graphics = graphics;
this.x.model = model;