/* autogenerated from "macros/Misc/fortran_block.sci" */ function fortran_block() { fortran_block.prototype.define = function fortran_block() { this.model = scicos_model(); this.model.sim = list(new ScilabString([" "]), new ScilabDouble([1001])); this.model.in = new ScilabDouble([1]); this.model.out = new ScilabDouble([1]); this.model.evtin = new ScilabDouble([]); this.model.evtout = new ScilabDouble([]); this.model.state = new ScilabDouble([]); this.model.dstate = new ScilabDouble([]); this.model.rpar = new ScilabDouble([]); this.model.ipar = new ScilabDouble([0]); this.model.blocktype = new ScilabString(["c"]); this.model.firing = new ScilabDouble([]); this.model.dep_ut = new ScilabBoolean([true,false]); this.funam = "forty"; var label = list([[sci2exp(this.model.in)],[sci2exp(this.model.out)],[strcat(sci2exp(this.model.rpar))],[this.funam]],list([])); var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"fortran_block\",sz(1),sz(2));"]); this.x = new standard_define(new ScilabDouble([4,2]),this.model,label,gr_i); return new BasicBlock(this.x); } fortran_block.prototype.details = function fortran_block() { return this.x; } fortran_block.prototype.get = function fortran_block() { var options = { i:["input ports sizes",this.i], o:["output port sizes",this.o], rpar:["System parameters vector",this.rpar], funam:["function name",this.funam], } return options; } fortran_block.prototype.set = function fortran_block() { var label = this.graphics.exprs; while (true) { var ok = true; this.i = parseFloat(arguments[0]["i"]); this.o = parseFloat(arguments[0]["o"]); this.rpar = inverse(arguments[0]["rpar"]); this.funam = arguments[0]["funam"]; if (!ok) { break; } if (this.funam==" ") { break; } label[1-1] = lab; this.rpar = this.rpar.slice(); this.i = int(this.i.slice()); var ni = size(this.i,1); this.o = int(this.o.slice()); var no = size(this.o,1); var tt = label[2-1]; if (this.model.sim[1-1]!=this.funam||size(this.model.in,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { var tt = []; } var tmpvar0 = FORTR(this.funam,tt,this.i,this.o); var ok = tmpvar0[0]; var tt = tmpvar0[1]; if (!ok) { break; } var tmpvar1 = check_io(this.model,this.graphics,this.i,this.o,[],[]); this.model = tmpvar1[0]; this.graphics = tmpvar1[1]; var ok = tmpvar1[2]; if (ok) { this.model.sim[1-1] = new ScilabString([this.funam]); this.model.rpar = new ScilabDouble(this.rpar); label[2-1] = tt; this.x.model = this.model; this.graphics.exprs = new ScilabDouble([label]); this.x.graphics = this.graphics; break; } } return new BasicBlock(this.x); } fortran_block.prototype.get_popup_title = function fortran_block() { var set_param_popup_title = "Set fortran_block parameters"; return set_param_popup_title; } }