summaryrefslogtreecommitdiff
path: root/js/Linear/GAINBLK_f.js
blob: 8cfbd59e18525bec7bd126ad0235a2d4fd5c19fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* autogenerated from "macros/Linear/GAINBLK_f.sci" */
function GAINBLK_f() {
    GAINBLK_f.prototype.define = function GAINBLK_f() {
        this.gain = 1;
        in1 = 1;
        out = 1;
        this.model = scicos_model();
        this.model.sim = new ScilabString(["gain"]);
        this.model.in1 = new ScilabDouble([in1]);
        this.model.out = new ScilabDouble([out]);
        this.model.rpar = new ScilabDouble([this.gain]);
        this.model.blocktype = new ScilabString(["c"]);
        this.model.dep_ut = [true,false];
        exprs = [strcat(sci2exp(this.gain))];
        gr_i = [];
        this.x = standard_define([2,2],this.model,exprs,gr_i);
        return new BasicBlock(this.x);
    }
    GAINBLK_f.prototype.details = function GAINBLK_f() {
        return this.x;
    }
    GAINBLK_f.prototype.get = function GAINBLK_f() {
        var options = {
            gain:["Gain",this.gain],
        }
        return options;
    }
    GAINBLK_f.prototype.set = function GAINBLK_f() {
        this.gain = parseFloat(arguments[0]["gain"])
        this.x = arg1;
        graphics = arg1.graphics;
        exprs = graphics.exprs;
        this.model = arg1.model;
        while (true) {
            [ok,this.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]);
            if (!ok) {
                break;
            }
            if (this.gain==[]) {
                message("Gain must have at least one element");
            } else {
                [out,in1] = size(this.gain);
                [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]);
                if (ok) {
                    graphics.exprs = exprs;
                    this.model.rpar = this.gain.slice();
                    this.x.graphics = graphics;
                    this.x.model = this.model;
                    break;
                }
            }
        }
        return new BasicBlock(this.x);
    }
}