/* autogenerated from "macros/IntegerOp/CONVERT.sci" */ function CONVERT() { CONVERT.prototype.define = function CONVERT() { sgn = 2; model = scicos_model(); model.sim = list("convert",4); model.in1 = -1; model.out = -1; model.in2 = -2; model.out2 = -2; model.intyp = 1; model.outtyp = 3; model.rpar = []; model.ipar = sgn; model.blocktype = "c"; model.dep_ut = [true,false]; exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); } CONVERT.prototype.details = function CONVERT() { return this.x; } CONVERT.prototype.get = function CONVERT() { var options = { it:["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)",this.it], ot:["Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)",this.ot], np:["Do on Overflow (0:Nothing, 1:Saturate, 2:Error)",this.np], } return options; } CONVERT.prototype.set = function CONVERT() { this.it = parseFloat((arguments[0]["it"])) this.ot = parseFloat((arguments[0]["ot"])) this.np = parseFloat((arguments[0]["np"])) this.x = arg1; graphics = arg1.graphics; model = arg1.model; exprs = graphics.exprs; while (true) { [ok,this.it,this.ot,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONVERT")],[" "],["Type conversion"],[" "]],["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } if (this.it==2) { this.it = 1; } if (this.ot==2) { this.ot = 1; } if ((this.np!=0&&this.np!=1&&this.np!=2)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Do on Overflow",this.np),msprintf("Must be in the interval %s.","[0, 2]")); ok = false; } else if ((this.it>8||this.it<1)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Input Type",this.it),msprintf("Must be in the interval %s.","[1, 8]")); ok = false; } else if ((this.ot>8||this.ot<1)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Output Type",this.ot),msprintf("Must be in the interval %s.","[1, 8]")); ok = false; } model.sim = list("convert",4); if ((this.it==this.ot)) { model.ipar = 1; } else { if ((this.np==0)) { if ((this.it==1)) { if ((this.ot==3)) { model.ipar = 2; } else if ((this.ot==4)) { model.ipar = 3; } else if ((this.ot==5)) { model.ipar = 4; } else if ((this.ot==6)) { model.ipar = 5; } else if ((this.ot==7)) { model.ipar = 6; } else if ((this.ot==8)) { model.ipar = 7; } } else if ((this.it==3)) { if ((this.ot==1)) { model.ipar = 8; } else if ((this.ot==4)) { model.ipar = 9; } else if ((this.ot==5)) { model.ipar = 10; } else if ((this.ot==6)) { model.ipar = 1; } else if ((this.ot==7)) { model.ipar = 11; } else if ((this.ot==8)) { model.ipar = 12; } } else if ((this.it==4)) { if ((this.ot==1)) { model.ipar = 13; } else if ((this.ot==3)) { model.ipar = 14; } else if ((this.ot==5)) { model.ipar = 15; } else if ((this.ot==6)) { model.ipar = 16; } else if ((this.ot==7)) { model.ipar = 1; } else if ((this.ot==8)) { model.ipar = 17; } } else if ((this.it==5)) { if ((this.ot==1)) { model.ipar = 18; } else if ((this.ot==3)) { model.ipar = 19; } else if ((this.ot==4)) { model.ipar = 20; } else if ((this.ot==6)) { model.ipar = 21; } else if ((this.ot==7)) { model.ipar = 22; } else if ((this.ot==8)) { model.ipar = 1; } } else if ((this.it==6)) { if ((this.ot==1)) { model.ipar = 23; } else if ((this.ot==3)) { model.ipar = 1; } else if ((this.ot==4)) { model.ipar = 24; } else if ((this.ot==5)) { model.ipar = 25; } else if ((this.ot==7)) { model.ipar = 26; } else if ((this.ot==8)) { model.ipar = 27; } } else if ((this.it==7)) { if ((this.ot==1)) { model.ipar = 28; } else if ((this.ot==3)) { model.ipar = 29; } else if ((this.ot==4)) { model.ipar = 1; } else if ((this.ot==5)) { model.ipar = 30; } else if ((this.ot==6)) { model.ipar = 31; } else if ((this.ot==8)) { model.ipar = 32; } } else if ((this.it==8)) { if ((this.ot==1)) { model.ipar = 33; } else if ((this.ot==3)) { model.ipar = 34; } else if ((this.ot==4)) { model.ipar = 35; } else if ((this.ot==5)) { model.ipar = 1; } else if ((this.ot==6)) { model.ipar = 36; } else if ((this.ot==7)) { model.ipar = 37; } } } else if ((this.np==1)) { if ((this.it==1)) { if ((this.ot==3)) { model.ipar = 38; } else if ((this.ot==4)) { model.ipar = 39; } else if ((this.ot==5)) { model.ipar = 40; } else if ((this.ot==6)) { model.ipar = 41; } else if ((this.ot==7)) { model.ipar = 42; } else if ((this.ot==8)) { model.ipar = 43; } } else if ((this.it==3)) { if ((this.ot==1)) { model.ipar = 8; } else if ((this.ot==4)) { model.ipar = 44; } else if ((this.ot==5)) { model.ipar = 45; } else if ((this.ot==6)) { model.ipar = 46; } else if ((this.ot==7)) { model.ipar = 47; } else if ((this.ot==8)) { model.ipar = 48; } } else if ((this.it==4)) { if ((this.ot==1)) { model.ipar = 13; } else if ((this.ot==3)) { model.ipar = 14; } else if ((this.ot==5)) { model.ipar = 49; } else if ((this.ot==6)) { model.ipar = 50; } else if ((this.ot==7)) { model.ipar = 51; } else if ((this.ot==8)) { model.ipar = 52; } } else if ((this.it==5)) { if ((this.ot==1)) { model.ipar = 18; } else if ((this.ot==3)) { model.ipar = 19; } else if ((this.ot==4)) { model.ipar = 20; } else if ((this.ot==6)) { model.ipar = 53; } else if ((this.ot==7)) { model.ipar = 54; } else if ((this.ot==8)) { model.ipar = 55; } } else if ((this.it==6)) { if ((this.ot==1)) { model.ipar = 23; } else if ((this.ot==3)) { model.ipar = 56; } else if ((this.ot==4)) { model.ipar = 57; } else if ((this.ot==5)) { model.ipar = 58; } else if ((this.ot==7)) { model.ipar = 59; } else if ((this.ot==8)) { model.ipar = 60; } } else if ((this.it==7)) { if ((this.ot==1)) { model.ipar = 28; } else if ((this.ot==3)) { model.ipar = 29; } else if ((this.ot==4)) { model.ipar = 61; } else if ((this.ot==5)) { model.ipar = 62; } else if ((this.ot==6)) { model.ipar = 31; } else if ((this.ot==8)) { model.ipar = 63; } } else if ((this.it==8)) { if ((this.ot==1)) { model.ipar = 33; } else if ((this.ot==3)) { model.ipar = 34; } else if ((this.ot==4)) { model.ipar = 35; } else if ((this.ot==5)) { model.ipar = 64; } else if ((this.ot==6)) { model.ipar = 36; } else if ((this.ot==7)) { model.ipar = 37; } } } else if ((this.np==2)) { if ((this.it==1)) { if ((this.ot==3)) { model.ipar = 65; } else if ((this.ot==4)) { model.ipar = 66; } else if ((this.ot==5)) { model.ipar = 67; } else if ((this.ot==6)) { model.ipar = 68; } else if ((this.ot==7)) { model.ipar = 69; } else if ((this.ot==8)) { model.ipar = 70; } } else if ((this.it==3)) { if ((this.ot==1)) { model.ipar = 8; } else if ((this.ot==4)) { model.ipar = 71; } else if ((this.ot==5)) { model.ipar = 72; } else if ((this.ot==6)) { model.ipar = 73; } else if ((this.ot==7)) { model.ipar = 74; } else if ((this.ot==8)) { model.ipar = 75; } } else if ((this.it==4)) { if ((this.ot==1)) { model.ipar = 13; } else if ((this.ot==3)) { model.ipar = 14; } else if ((this.ot==5)) { model.ipar = 76; } else if ((this.ot==6)) { model.ipar = 77; } else if ((this.ot==7)) { model.ipar = 78; } else if ((this.ot==8)) { model.ipar = 79; } } else if ((this.it==5)) { if ((this.ot==1)) { model.ipar = 18; } else if ((this.ot==3)) { model.ipar = 19; } else if ((this.ot==4)) { model.ipar = 20; } else if ((this.ot==6)) { model.ipar = 80; } else if ((this.ot==7)) { model.ipar = 81; } else if ((this.ot==8)) { model.ipar = 82; } } else if ((this.it==6)) { if ((this.ot==1)) { model.ipar = 23; } else if ((this.ot==3)) { model.ipar = 83; } else if ((this.ot==4)) { model.ipar = 84; } else if ((this.ot==5)) { model.ipar = 85; } else if ((this.ot==7)) { model.ipar = 86; } else if ((this.ot==8)) { model.ipar = 87; } } else if ((this.it==7)) { if ((this.ot==1)) { model.ipar = 28; } else if ((this.ot==3)) { model.ipar = 29; } else if ((this.ot==4)) { model.ipar = 88; } else if ((this.ot==5)) { model.ipar = 89; } else if ((this.ot==6)) { model.ipar = 31; } else if ((this.ot==8)) { model.ipar = 90; } } else if ((this.it==8)) { if ((this.ot==1)) { model.ipar = 33; } else if ((this.ot==3)) { model.ipar = 34; } else if ((this.ot==4)) { model.ipar = 35; } else if ((this.ot==5)) { model.ipar = 91; } else if ((this.ot==6)) { model.ipar = 36; } else if ((this.ot==7)) { model.ipar = 37; } } } } in1 = [model.in1,model.in2]; out = [model.out,model.out2]; if (ok) { [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(out,this.ot),[],[]); } if (ok) { graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = model; break; } } return new BasicBlock(this.x); } }