summaryrefslogtreecommitdiff
path: root/js/Linear/REGISTER_f.js
blob: da798aa37be8122bc7c5a0037a8b8debb193ffb8 (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
/* autogenerated from "macros/Linear/REGISTER_f.sci" */
function REGISTER_f() {
    REGISTER_f.prototype.define = function REGISTER_f() {
        this.z0 = zeros(10,1);
        this.model = scicos_model();
        this.model.sim = new ScilabString(["delay"]);
        this.model.in1 = new ScilabDouble([1]);
        this.model.out = new ScilabDouble([1]);
        this.model.evtin = new ScilabDouble([1]);
        this.model.dstate = new ScilabDouble([this.z0]);
        this.model.blocktype = new ScilabString(["d"]);
        this.model.dep_ut = new ScilabDouble([false,false]);
        var exprs = strcat(string(this.z0),";");
        var gr_i = [];
        this.x = standard_define([2.5,2.5],this.model,exprs,gr_i);
        return new BasicBlock(this.x);
    }
    REGISTER_f.prototype.details = function REGISTER_f() {
        return this.x;
    }
    REGISTER_f.prototype.get = function REGISTER_f() {
        var options = {
        }
        return options;
    }
    REGISTER_f.prototype.set = function REGISTER_f() {
        this.z0 = parseFloat(arguments[0]["z0"])
        this.x = arg1;
        var graphics = arg1.graphics;
        var exprs = graphics.exprs;
        this.model = arg1.model;
        while (true) {
            [ok,this.z0,exprs] = scicos_getvalue("Set delay parameters","Register initial condition",list("vec",-1),exprs);
            if (!ok) {
                break;
            }
            if (prod(size(this.z0))<1) {
                message("Register length must be at least 1");
                var ok = false;
            }
            if (ok) {
                graphics.exprs = exprs;
                this.model.dstate = new ScilabDouble([this.z0]);
                this.x.graphics = graphics;
                this.x.model = this.model;
                break;
            }
        }
        return new BasicBlock(this.x);
    }
}