summaryrefslogtreecommitdiff
path: root/js/Branching/SELF_SWITCH.js
blob: eca2147d0769591ca82d75da1bcf278949225dbf (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
/* autogenerated from "macros/Branching/SELF_SWITCH.sci" */
function SELF_SWITCH() {
    SELF_SWITCH.prototype.define = function SELF_SWITCH() {
        this.stateOpen = true;
        this.x = scicos_block();
        this.x.gui = "SELF_SWITCH";
        this.x.graphics.sz = [2,2];
        this.x.graphics.gr_i = [];
        this.x.graphics.pin = 0;
        this.x.graphics.pout = 0;
        this.x.model.sim = "csuper";
        this.x.model.in1 = 1;
        this.x.model.out = 1;
        this.x.model.blocktype = "h";
        this.x.model.dep_ut = [false,false];
        this.x.model.rpar = genSwitchInnerDiagram(this.stateOpen);
        this.x.model.opar = list(this.stateOpen);
        this.x.graphics.in_implicit = ["E"];
        this.x.graphics.in_style = "";
        this.x.graphics.out_implicit = ["E"];
        this.x.graphics.out_style = "";
        this.x.graphics.style = "SELF_SWITCH_OFF";
        return new BasicBlock(this.x);
    }
    SELF_SWITCH.prototype.details = function SELF_SWITCH() {
        return this.x;
    }
    SELF_SWITCH.prototype.get = function SELF_SWITCH() {
        var options = {
        }
        return options;
    }
    SELF_SWITCH.prototype.set = function SELF_SWITCH() {
        this.x = arg1;
        this.stateOpen = this.x.model.opar[1-1];
        this.x.model.rpar = genSwitchInnerDiagram(!this.stateOpen);
        this.x.model.opar = list(!this.stateOpen);
        var y = 0;
        var typ = list();
        if (this.stateOpen==false) {
            this.x.graphics.style = "SELF_SWITCH_OFF";
        } else {
            this.x.graphics.style = "SELF_SWITCH_ON";
        }
        return new BasicBlock(this.x);
    }
}