summaryrefslogtreecommitdiff
path: root/js/Misc/DSUPER.js
blob: 3f1bcc1b582d95d5d1a072cd01345ac9ef1fa140 (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
/* autogenerated from "macros/Misc/DSUPER.sci" */
function DSUPER() {
    DSUPER.prototype.define = function DSUPER() {
        return new BasicBlock(this.x);
    }
    DSUPER.prototype.details = function DSUPER() {
        return this.x;
    }
    DSUPER.prototype.get = function DSUPER() {
    }
    DSUPER.prototype.set = function DSUPER() {
        y = this.needcompile;
        typ = list();
        graphics = arg1.graphics;
        if ((length(graphics.exprs)==0)) {
            warnBlockByUID(arg1.model.label,"Invalid masked block.");
            this.x = arg1;
            return;
        }
        exprs = graphics.exprs[1-1];
        exprs0 = graphics.exprs[2-1][1-1];
        btitre = graphics.exprs[2-1][2-1][1-1];
        bitems = graphics.exprs[2-1][2-1].slice(2-1,$);
        if (exprs0==[]) {
            this.x = arg1;
            return;
        }
        context = [arg1.model.rpar.props.context];
        [PREVAR_scicos_context,ierr] = script2var(context,PREVAR_scicos_context);
        if (ierr!=0) {
            this.x = arg1;
            return;
        }
        tt = "scicos_context."+exprs0[1-1];
        for (i=2;i<=size(exprs0,1);i+=1) {
            tt = tt+",scicos_context."+exprs0[i-1];
        }
        ss = graphics.exprs[2-1][3-1];
        scicos_context = PREVAR_scicos_context;
        execstr("[ok,"+tt+",exprs]=scicos_getvalue(btitre,bitems,ss,exprs)");
        if (this.ok) {
            this.x = arg1;
            PREVAR_scicos_context = scicos_context;
            sblock = this.x.model.rpar;
            [sblock,%w,needcompile2,this.ok] = do_eval(sblock,list(),scicos_context);
            y = max(2,this.needcompile,needcompile2);
            this.x.graphics.exprs[1-1] = exprs;
            this.x.model.rpar = sblock;
        } else {
            this.x = arg1;
        }
        return new BasicBlock(this.x);
    }
}