/* autogenerated from "macros/Linear/DELAYV_f.sci" */ function DELAYV_f() { DELAYV_f.prototype.define = function DELAYV_f() { this.nin = 1; z0 = zeros(11,1); this.zz0 = z0.slice(1-1,$-1); this.T = 1; model = scicos_model(); model.sim = list("delayv",1); model.in1 = [[this.nin],[1]]; model.out = this.nin; model.evtin = 1; model.evtout = [[1],[1]]; model.dstate = z0; model.rpar = this.T/(size(this.zz0,"*")); model.blocktype = "d"; model.firing = [0,-1]; model.dep_ut = [true,false]; exprs = [[string(this.nin)],[strcat(string(z0.slice(1-1,$-1)),";")],[string(this.T)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); } DELAYV_f.prototype.details = function DELAYV_f() { return this.x; } DELAYV_f.prototype.get = function DELAYV_f() { } DELAYV_f.prototype.set = function DELAYV_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; this.nin = model.in1[1-1]; z0 = model.dstate; this.zz0 = z0.slice(1-1,$-1); told = z0[$-1]; while (true) { [ok,this.nin,this.zz0,this.T,exprs] = scicos_getvalue("Set delay parameters",["Number of inputs","Register initial condition","Max delay"],list("vec",1,"vec",-1,"vec",1),exprs); if (!ok) { break; } if (size(this.zz0,"*")<2) { message("Register length must be at least 2"); ok = false; } if (this.T<=0) { message("Delay must be positive"); ok = false; } if (ok) { [model,graphics,ok] = check_io(model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]); } if (ok) { graphics.exprs = exprs; model.dstate = [[this.zz0.slice()],[told]]; model.rpar = this.T/(size(this.zz0,"*")); this.x.graphics = graphics; this.x.model = model; break; } } return new BasicBlock(this.x); } }