summaryrefslogtreecommitdiff
path: root/js/Branching/SCALAR2VECTOR.js
blob: 2ca90c29aaa48f4125fd72a77a327ae511fb2acb (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
/* autogenerated from "macros/Branching/SCALAR2VECTOR.sci" */
function SCALAR2VECTOR() {
    SCALAR2VECTOR.prototype.define = function SCALAR2VECTOR() {
        this.nout = -1;
        model = scicos_model();
        model.sim = list("scalar2vector",4);
        model.out = this.nout;
        model.in1 = 1;
        model.blocktype = "c";
        model.dep_ut = [true,false];
        exprs = [string([this.nout])];
        gr_i = [];
        this.x = standard_define([3,2],model,exprs,gr_i);
        return new BasicBlock(this.x);
    }
    SCALAR2VECTOR.prototype.details = function SCALAR2VECTOR() {
        return this.x;
    }
    SCALAR2VECTOR.prototype.get = function SCALAR2VECTOR() {
    }
    SCALAR2VECTOR.prototype.set = function SCALAR2VECTOR() {
        this.x = arg1;
        graphics = arg1.graphics;
        exprs = graphics.exprs;
        model = arg1.model;
        while (true) {
            [ok,this.nout,exprs] = scicos_getvalue("Set block parameters",["size of output (-1: if don\'t know)"],list("vec",1),exprs);
            if (!ok) {
                break;
            }
            this.nout = int(this.nout);
            if ((this.nout!=-1&&(this.nout<=0))) {
                message("size of output must be -1 or >0");
                ok = false;
            }
            if (ok) {
                [model,graphics,ok] = check_io(model,graphics,[1],this.nout,[],[]);
            }
            if (ok) {
                graphics.exprs = exprs;
                this.x.graphics = graphics;
                this.x.model = model;
                break;
            }
        }
        return new BasicBlock(this.x);
    }
}