/* autogenerated from "macros/Linear/VARIABLE_DELAY.sci" */ function VARIABLE_DELAY() { VARIABLE_DELAY.prototype.define = function VARIABLE_DELAY() { var nin = 1; this.T = 1; this.init = 0; this.N = 1024; this.model = scicos_model(); this.model.sim = list(new ScilabString(["variable_delay"]), new ScilabDouble([4])); this.model.in = new ScilabDouble([nin],[1]); this.model.out = new ScilabDouble([nin]); this.model.rpar = new ScilabDouble([this.T,this.init]); this.model.ipar = new ScilabDouble([this.N]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = new ScilabBoolean([false,false]); var exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VARIABLE_DELAY\",sz(1),sz(2));"]); this.x = new standard_define(new ScilabDouble([3,2]),this.model,new ScilabDouble(exprs),gr_i); return new BasicBlock(this.x); } VARIABLE_DELAY.prototype.details = function VARIABLE_DELAY() { return this.x; } VARIABLE_DELAY.prototype.get = function VARIABLE_DELAY() { var options = { T:["Max delay",this.T], init:["initial input",this.init], N:["Buffer size",this.N], } return options; } VARIABLE_DELAY.prototype.set = function VARIABLE_DELAY() { var exprs = this.graphics.exprs; var nin = this.model.in[1-1]; while (true) { var ok = true; this.T = parseFloat(arguments[0]["T"]); this.init = parseFloat(arguments[0]["init"]); this.N = parseFloat(arguments[0]["N"]); var exprs = [arguments[0]["T"], arguments[0]["init"], arguments[0]["N"]]; if (!ok) { break; } if (this.N<2) { message("Buffer must be larger than 2"); throw "user error"; var ok = false; } if (this.T<=0) { message("Delay must be positive"); throw "user error"; var ok = false; } if (ok) { var tmpvar0 = check_io(this.model,this.graphics,[[-1],[1]],-1,[],[]); this.model = tmpvar0[0]; this.graphics = tmpvar0[1]; var ok = tmpvar0[2]; } if (ok) { this.graphics.exprs = new ScilabDouble([exprs]); this.model.rpar = new ScilabDouble([this.T],[this.init]); this.model.ipar = new ScilabDouble([this.N]); this.x.graphics = this.graphics; this.x.model = this.model; break; } } return new BasicBlock(this.x); } VARIABLE_DELAY.prototype.get_popup_title = function VARIABLE_DELAY() { var set_param_popup_title = "Set delay parameters"; return set_param_popup_title; } }