/* autogenerated from "macros/Electrical/SineVoltage.sci" */ function SineVoltage() { SineVoltage.prototype.define = function SineVoltage() { this.model = scicos_model(); this.model.in = new ScilabDouble([1]); this.model.out = new ScilabDouble([1]); this.V = 1; this.ph = 0; this.frq = 1; this.offset = 0; this.start = 0; this.model.rpar = new ScilabDouble([this.V],[this.ph],[this.frq],[this.offset],[this.start]); this.model.sim = new ScilabString(["SineVoltage"]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabBoolean([true,false]); var mo = modelica(); mo.model = "SineVoltage"; mo.inputs = "p"; mo.outputs = "n"; mo.parameters = list([["V"],["phase"],["freqHz"],["offset"],["startTime"]],list(this.V,this.ph,this.frq,this.offset,this.start)); this.model.equations = new ScilabDouble([mo]); var exprs = [[string(this.V)],[string(this.ph)],[string(this.frq)],[string(this.offset)],[string(this.start)]]; var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SineVoltage\",sz(1),sz(2));"]); this.x = new standard_define(new ScilabDouble([2,2]),this.model,new ScilabDouble(exprs),gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); } SineVoltage.prototype.details = function SineVoltage() { return this.x; } SineVoltage.prototype.get = function SineVoltage() { var exprs = this.graphics.exprs; this.set_param_popup_title = "Set voltage source parameter"; var options = { V:["Amplitude (Volt)",this.V], ph:["phase (rad)",this.ph], frq:["Frequency (Hz)",this.frq], offset:["Voltageoffset (V)",this.offset], start:["Timeoffset (s)",this.start], } return options; } SineVoltage.prototype.set = function SineVoltage() { var exprs = this.graphics.exprs; while (true) { var ok = true; this.V = parseFloat(arguments[0]["V"]); this.ph = parseFloat(arguments[0]["ph"]); this.frq = parseFloat(arguments[0]["frq"]); this.offset = parseFloat(arguments[0]["offset"]); this.start = parseFloat(arguments[0]["start"]); var exprs = [arguments[0]["V"], arguments[0]["ph"], arguments[0]["frq"], arguments[0]["offset"], arguments[0]["start"]]; if (!ok) { break; } this.model.rpar = new ScilabDouble([this.V],[this.ph],[this.frq],[this.offset],[this.start]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.V]), new ScilabDouble([this.ph]), new ScilabDouble([this.frq]), new ScilabDouble([this.offset]), new ScilabDouble([this.start])); this.graphics.exprs = new ScilabDouble([exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; } return new BasicBlock(this.x); } SineVoltage.prototype.get_popup_title = function SineVoltage() { return this.set_param_popup_title; } }