summaryrefslogtreecommitdiff
path: root/js/Linear/DOLLAR_f.js
blob: 0207d7032580b305a57b2e61d8fe01de8a63c75a (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
56
57
58
59
60
61
62
63
64
65
/* autogenerated from "macros/Linear/DOLLAR_f.sci" */
function DOLLAR_f() {
    DOLLAR_f.prototype.define = function DOLLAR_f() {
        z = 0;
        this.inh = 0;
        in1 = 1;
        exprs = string([[z],[this.inh]]);
        this.model = scicos_model();
        this.model.sim = new ScilabString(["dollar"]);
        this.model.in1 = new ScilabDouble([in1]);
        this.model.out = new ScilabDouble([in1]);
        this.model.evtin = new ScilabDouble([1-this.inh]);
        this.model.dstate = new ScilabDouble([z]);
        this.model.blocktype = new ScilabString(["d"]);
        this.model.dep_ut = [false,false];
        gr_i = [];
        this.x = standard_define([2,2],this.model,exprs,gr_i);
        return new BasicBlock(this.x);
    }
    DOLLAR_f.prototype.details = function DOLLAR_f() {
        return this.x;
    }
    DOLLAR_f.prototype.get = function DOLLAR_f() {
        var options = {
            a:["initial condition",this.a],
            inh:["Inherit (no:0, yes:1)",this.inh],
        }
        return options;
    }
    DOLLAR_f.prototype.set = function DOLLAR_f() {
        this.a = arguments[0]["a"]
        this.inh = parseFloat(arguments[0]["inh"])
        this.x = arg1;
        graphics = arg1.graphics;
        exprs = graphics.exprs;
        this.model = arg1.model;
        if (size(exprs,"*")<2) {
            exprs[2-1] = "0";
        }
        while (true) {
            [ok,this.a,this.inh,exprs] = scicos_getvalue("Set 1/z block parameters",["initial condition","Inherit (no:0, yes:1)"],list("vec",-1,"vec",-1),exprs);
            if (!ok) {
                break;
            }
            out = size(this.a,"*");
            if (out==0) {
                out = [];
            }
            in1 = out;
            if (ok) {
                [model,graphics,ok] = check_io(this.model,graphics,-1,-1,ones(1-this.inh,1),[]);
            }
            if (ok) {
                graphics.exprs = exprs;
                this.model.dstate = new ScilabDouble([this.a]);
                this.model.in1 = in1;
                this.model.out = out;
                this.x.graphics = graphics;
                this.x.model = this.model;
                break;
            }
        }
        return new BasicBlock(this.x);
    }
}