summaryrefslogtreecommitdiff
path: root/js/Events/MFCLCK_f.js
blob: e3b493529ae2db575dd06c79d8fe96cad82b71fc (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/Events/MFCLCK_f.sci" */
function MFCLCK_f() {
    MFCLCK_f.prototype.define = function MFCLCK_f() {
        this.nn = 2;
        this.dt = 0.1;
        model = scicos_model();
        model.sim = "mfclck";
        model.evtin = 1;
        model.evtout = [[1],[1]];
        model.dstate = 0;
        model.rpar = this.dt;
        model.ipar = this.nn;
        model.blocktype = "d";
        model.firing = [-1,0];
        model.dep_ut = [false,false];
        exprs = [[string(this.dt)],[string(this.nn)]];
        gr_i = [];
        this.x = standard_define([3,2],model,exprs,gr_i);
        return new BasicBlock(this.x);
    }
    MFCLCK_f.prototype.details = function MFCLCK_f() {
        return this.x;
    }
    MFCLCK_f.prototype.get = function MFCLCK_f() {
        var options = {
        dt:["basic period (1/f)",this.dt],
        nn:["multiply by (n)",this.nn],
        }
        return options;
    }
    MFCLCK_f.prototype.set = function MFCLCK_f() {
        this.dt = parseFloat(arguments[0]["dt"])
        this.nn = parseFloat(arguments[0]["nn"])
        this.x = arg1;
        graphics = arg1.graphics;
        exprs = graphics.exprs;
        model = arg1.model;
        [ok,this.dt,this.nn,exprs] = scicos_getvalue("Set Multifrequency clock parameters",["basic period (1/f)","multiply by (n)"],list("vec",1,"vec",1),exprs);
        if (ok) {
            model.ipar = this.nn;
            model.rpar = this.dt;
            hh = model.firing;
            hh[2-1] = 0;
            model.firing = hh;
            graphics.exprs = exprs;
            this.x.graphics = graphics;
            this.x.model = model;
        }
        return new BasicBlock(this.x);
    }
}