summaryrefslogtreecommitdiff
path: root/js/Misc/DEBUG.js
blob: ac82e09247be28502ddf68a4bc2fb6fc240667c5 (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
/* autogenerated from "macros/Misc/DEBUG.sci" */
function DEBUG() {
    DEBUG.prototype.define = function DEBUG() {
        this.model = scicos_model();
        this.model.sim = list(new ScilabString(["%debug_scicos"]), new ScilabDouble([99]));
        this.model.blocktype = new ScilabString(["d"]);
        this.exprs = list("","xcos_debug_gui(flag,block);");
        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DEBUG\",sz(1),sz(2));"]);
        this.x = standard_define([8,2],this.model,this.exprs,this.gr_i);
        return new BasicBlock(this.x);
    }
    DEBUG.prototype.details = function DEBUG() {
        return this.x;
    }
    DEBUG.prototype.get = function DEBUG() {
        var options = {
        }
        return options;
    }
    DEBUG.prototype.set = function DEBUG() {
        this.exprs = this.graphics.exprs;
        var textmp = this.exprs[2-1];
        var ok = true;
        while (1==1) {
            var tmpvar0 = dialog([["Enter scilab instructions for debugging."],[" Inputs are block and flag, output is block"]],textmp);
            var txt = tmpvar0[0];
            if (txt!=[]) {
                var tt = ["block=debug_scicos(block,flag)"];
                if (execstr("deff(tt,txt)","errcatch")==0) {
                    var warnMode = warning("query");
                    warning("off");
                    save(this.TMPDIR+"/debug_scicos",this.debug_scicos);
                    warning(warnMode);
                    this.exprs[2-1] = txt;
                    if ((scicos_debug()!=2&&scicos_debug()!=3)) {
                        scicos_debug(2);
                    }
                    break;
                } else {
                    message([["Error in the instructions"],[lasterror()]]);
                }
            } else {
                var ok = false;
                break;
            }
        }
        if (ok) {
            this.graphics.exprs = new ScilabDouble([this.exprs]);
            this.x.graphics = this.graphics;
        }
        return new BasicBlock(this.x);
    }
}