summaryrefslogtreecommitdiff
path: root/js/Linear/GAIN_f.js
diff options
context:
space:
mode:
authorSunil Shetye2018-06-25 12:08:56 +0530
committerSunil Shetye2018-06-25 12:45:27 +0530
commit7c70459c10aed0d74ee03896abaf47fefdbf7c8f (patch)
tree6f6acc6a5087295c6e59f0f94bfda5025049d5fa /js/Linear/GAIN_f.js
parent870479a2e4b932426a904b2ebae7e4ee72037326 (diff)
downloadsci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.gz
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.bz2
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.zip
separate out code for getvalue
Diffstat (limited to 'js/Linear/GAIN_f.js')
-rw-r--r--js/Linear/GAIN_f.js58
1 files changed, 29 insertions, 29 deletions
diff --git a/js/Linear/GAIN_f.js b/js/Linear/GAIN_f.js
index fcca61a8..836dee96 100644
--- a/js/Linear/GAIN_f.js
+++ b/js/Linear/GAIN_f.js
@@ -1,44 +1,44 @@
/* autogenerated from "macros/Linear/GAIN_f.sci" */
function GAIN_f() {
GAIN_f.prototype.define = function GAIN_f() {
-gain=1;
-in1=1;
-out=1;
-model=scicos_model();
-model.sim="gain";
-model.in1=1;
-model.out=1;
-model.rpar=gain;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[strcat(sci2exp(gain))],[strcat(sci2exp(in1))],[strcat(sci2exp(out))]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ gain = 1;
+ in1 = 1;
+ out = 1;
+ model = scicos_model();
+ model.sim = "gain";
+ model.in1 = 1;
+ model.out = 1;
+ model.rpar = gain;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[strcat(sci2exp(gain))],[strcat(sci2exp(in1))],[strcat(sci2exp(out))]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
GAIN_f.prototype.details = function GAIN_f() {
}
GAIN_f.prototype.get = function GAIN_f() {
}
GAIN_f.prototype.set = function GAIN_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,gain,exprs]=scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]);
+ if (!ok) {
break;
}
-if (gain==[]) {
+ if (gain==[]) {
message("Gain must have at least one element");
-} else {
-[out,in1]=size(gain);
-[model,graphics,ok]=check_io(model,graphics,in1,out,[],[]);
-if (ok) {
-graphics.exprs=exprs;
-model.rpar=gain.slice();
-x.graphics=graphics;
-x.model=model;
+ } else {
+ [out,in1] = size(gain);
+ [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]);
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = gain.slice();
+ x.graphics = graphics;
+ x.model = model;
break;
}
}