/* autogenerated from "macros/Sinks/WFILE_f.sci" */ function WFILE_f() { WFILE_f.prototype.define = function WFILE_f() { this.in1 = 1; nin = sum(this.in1); frmt = "(7(e10.3,1x))"; fname = "foo"; lunit = 0; this.N = 2; model = scicos_model(); model.sim = "writef"; model.in1 = this.in1; model.evtin = 1; model.dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; model.ipar = [[length(fname)],[length(frmt)],[0],[this.N],[this._str2code[fname-1]],[this._str2code[frmt-1]]]; model.blocktype = "d"; model.dep_ut = [true,false]; exprs = [[sci2exp(this.in1)],[fname],[frmt],[string(this.N)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); } WFILE_f.prototype.details = function WFILE_f() { return this.x; } WFILE_f.prototype.get = function WFILE_f() { } WFILE_f.prototype.set = function WFILE_f() { warnobsolete("WRITEC_f","6.0.0"); warnMessage = msprintf(_("Feature %s is obsolete."),"WFILE_f"); warnAdvise = msprintf(_("Please use %s instead."),"WRITEC_f"); warnXcosMessage = msprintf("%s %s",warnMessage,warnAdvise); warnBlockByUID(arg1.model.label,warnXcosMessage); this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; dstate = model.dstate; lunit = dstate[2-1]; fname = exprs[2-1]; frmt = exprs[3-1]; while (true) { [ok,this.in1,this.fname1,this.frmt1,this.N,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WFILE_f")],[" "],[gettext("Write to output file")],[" "],[gettext("Write is done on:")],[gettext("  - A binary file if no format given")],[gettext("  - A formatted text file if a format (Fortran type) is given")]],[[gettext("Input Size")],[gettext("Output File Name")],[gettext("Output Format")],[gettext("Buffer Size")]],list("vec",1,"str",1,"str",1,"vec",1),exprs); if (!ok) { break; } this.in1 = int(this.in1); nin = this.in1; this.fname1 = pathconvert(stripblanks(this.fname1),false,true); this.frmt1 = stripblanks(this.frmt1); if (lunit>0&&min(length(frmt),1)!=min(length(this.frmt1),1)) { block_parameter_error(gettext("Simulation running !!! You cannot switch
between formatted and unformatted when running"),gettext("End current simulation first.")); ok = false; } else if (lunit>0&&this.fname1!=fname) { block_parameter_error(gettext("You cannot modify \'Output File Name\' when running."),gettext("End current simulation first.")); ok = false; } else if (this.fname1=="") { block_parameter_error(gettext("Wrong value for \'Output File Name\' parameter"),gettext("You must provide a filename.")); ok = false; } else if (fileparts(this.fname1)!="") { [pa,fn,ex] = fileparts(this.fname1); if (!this.isdir[pa-1]) { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Output File Name")),msprintf(gettext("Directory \'%s\' does not exist"),pa)); ok = false; } } else if (this.frmt1!=""&&(part(this.frmt1,1)!="("||part(this.frmt1,length(this.frmt1))!=")")) { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Input Format"),this.frmt1),gettext("You must enclose the format\'s string between parentheses.")); ok = false; } else if (this.N<2) { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),this.N),gettext("Must be greater than 1.")); ok = false; } else if (this.in1<=0) { block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Input Size"),this.in1),gettext("Strictly positive integer expected.")); ok = false; } if (ok) { ipar = [[length(this.fname1)],[length(this.frmt1)],[0],[this.N],[this._str2code[this.fname1-1]],[this._str2code[this.frmt1-1]]]; if (prod(size(dstate))!=(nin+1)*this.N+2) { dstate = [[-1],[lunit],[zeros((nin+1)*this.N,1)]]; } model.in1 = nin; model.dstate = dstate; model.ipar = ipar; model.dep_ut = [true,false]; graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = model; break; } } return new BasicBlock(this.x); } }