/* autogenerated from "macros/Linear/DOLLAR_m.sci" */ function DOLLAR_m() { DOLLAR_m.prototype.define = function DOLLAR_m() { z = 0; this.inh = 0; in1 = 1; exprs = string([[z],[this.inh]]); this.model = scicos_model(); this.model.sim = list("dollar4",4); this.model.in1 = new ScilabDouble(in1); this.model.out = new ScilabDouble(in1); this.model.evtin = new ScilabDouble(1-this.inh); this.model.dstate = new ScilabDouble(z); this.model.blocktype = new ScilabString("d"); this.model.dep_ut = [false,false]; gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } DOLLAR_m.prototype.details = function DOLLAR_m() { return this.x; } DOLLAR_m.prototype.get = function DOLLAR_m() { var options = { a:["initial condition",this.a], inh:["Inherit (no:0, yes:1)",this.inh], } return options; } DOLLAR_m.prototype.set = function DOLLAR_m() { this.a = arguments[0]["a"] this.inh = parseFloat(arguments[0]["inh"]) this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,"*")<2) { exprs[2-1] = "0"; } while (true) { [ok,this.a,this.inh,exprs] = scicos_getvalue("Set 1/z block parameters",["initial condition","Inherit (no:0, yes:1)"],list("mat",[-1,-2],"vec",-1),exprs); if (!ok) { break; } out = [size(this.a,1),size(this.a,2)]; if (out==0) { out = []; } in1 = out; this.model.sim = list("dollar4_m",4); this.model.odstate = list(this.a); this.model.dstate = []; if ((this.type[this.a-1]==1)) { if (isreal(this.a)) { it = 1; ot = 1; if ((size(this.a,1)==1||size(this.a,2)==1)) { this.model.sim = list("dollar4",4); this.model.dstate = this.a.slice(); this.model.odstate = list(); } } else { it = 2; ot = 2; } } else if ((typeof(this.a)=="int32")) { it = 3; ot = 3; } else if ((typeof(this.a)=="int16")) { it = 4; ot = 4; } else if ((typeof(this.a)=="int8")) { it = 5; ot = 5; } else if ((typeof(this.a)=="uint32")) { it = 6; ot = 6; } else if ((typeof(this.a)=="uint16")) { it = 7; ot = 7; } else if ((typeof(this.a)=="uint8")) { it = 8; ot = 8; } else { message("type is not recognized"); ok = false; } if (ok) { [model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = this.model; break; } } return new BasicBlock(this.x); } }