/* autogenerated from "macros/Branching/MUX_f.sci" */ function MUX_f() { MUX_f.prototype.define = function MUX_f() { in1 = 2; model = scicos_model(); model.sim = list("mux",1); model.in1 = -transpose([1:in1]); model.out = 0; model.ipar = in1; model.blocktype = "c"; model.dep_ut = [true,false]; exprs = string(in1); gr_i = []; x = standard_define([0.5,2],model,exprs,gr_i); } MUX_f.prototype.details = function MUX_f() { } MUX_f.prototype.get = function MUX_f() { } MUX_f.prototype.set = function MUX_f() { x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { [ok,in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("vec",-1),exprs); if (!ok) { break; } if (size(in1,"*")==1) { if (in1<2||in1>8) { message("Block must have at least two input ports and at most eight"); ok = false; } else { [model,graphics,ok] = check_io(model,graphics,-transpose([1:in1]),0,[],[]); } } else { if (size(in1,"*")<2||size(in1,"*")>8||or(in1==0)) { message([["Block must have at least two input ports"],["and at most eight, and size 0 is not allowed. "]]); ok = false; } else { if (min(in1)<0) { nout = 0; } else { nout = sum(in1); } [model,graphics,ok] = check_io(model,graphics,in1.slice(),nout,[],[]); if (ok) { in1 = size(in1,"*"); } } } if (ok) { graphics.exprs = exprs; model.ipar = in1; x.graphics = graphics; x.model = model; break; } } } }