summaryrefslogtreecommitdiff
path: root/js/Electrical/VVsourceAC.js
blob: 779cdd915aba8ae23c25099b2d240d28230aca43 (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
/* autogenerated from "macros/Electrical/VVsourceAC.sci" */
function VVsourceAC() {
    VVsourceAC.prototype.define = function VVsourceAC() {
        model = scicos_model();
        model.in1 = [[1],[1]];
        model.out = [1];
        VA = 220;
        this.FR = 50;
        model.rpar = [this.FR];
        model.sim = "VVsourceAC";
        model.blocktype = "c";
        model.dep_ut = [true,false];
        mo = modelica();
        mo.model = "VVsourceAC";
        mo.inputs = ["p","VA"];
        mo.outputs = "n";
        mo.parameters = list(["f"],list(this.FR));
        model.equations = mo;
        exprs = [string(this.FR)];
        gr_i = [];
        this.x = standard_define([2,2],model,exprs,list(gr_i,0));
        this.x.graphics.in_implicit = ["I","E"];
        this.x.graphics.out_implicit = ["I"];
        return new BasicBlock(this.x);
    }
    VVsourceAC.prototype.details = function VVsourceAC() {
        return this.x;
    }
    VVsourceAC.prototype.get = function VVsourceAC() {
    }
    VVsourceAC.prototype.set = function VVsourceAC() {
        this.x = arg1;
        graphics = arg1.graphics;
        exprs = graphics.exprs;
        model = arg1.model;
        while (true) {
            [ok,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Frequency (Hz)"],list("vec",-1),exprs);
            if (!ok) {
                break;
            }
            model.rpar = [this.FR];
            model.equations.parameters[2-1] = list(this.FR);
            graphics.exprs = exprs;
            this.x.graphics = graphics;
            this.x.model = model;
            break;
        }
        return new BasicBlock(this.x);
    }
}