/* autogenerated from "macros/Sinks/CEVENTSCOPE.sci" */ function CEVENTSCOPE() { CEVENTSCOPE.prototype.define = function CEVENTSCOPE() { this.nclock = 1; this.win = -1; this.clrs = [[1],[3],[5],[7],[9],[11],[13],[15]]; this.wdim = [[600],[400]]; this.wpos = [[-1],[-1]]; this.per = 30; model = scicos_model(); model.sim = list("cevscpe",4); model.evtin = 1; model.rpar = this.per; model.ipar = [[this.win],[1],[this.clrs[this.nclock-1]],[this.wpos.slice()],[this.wdim.slice()]]; model.blocktype = "d"; model.dep_ut = [false,false]; exprs = [[sci2exp(this.nclock)],[strcat(sci2exp(this.clrs[this.nclock-1])," ")],[string(this.win)],[sci2exp([])],[sci2exp(this.wdim)],[string(this.per)]]; gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); } CEVENTSCOPE.prototype.details = function CEVENTSCOPE() { return this.x; } CEVENTSCOPE.prototype.get = function CEVENTSCOPE() { var options = { nclock:["Number of event inputs",this.nclock], clrs:["colors c (>0) or mark (<0)",this.clrs], win:["Output window number (-1 for automatic)",this.win], wpos:["Output window position",this.wpos], wdim:["Output window sizes",this.wdim], per:["Refresh period",this.per], } return options; } CEVENTSCOPE.prototype.set = function CEVENTSCOPE() { this.nclock = parseFloat((arguments[0]["nclock"])) this.clrs = parseFloat((arguments[0]["clrs"])) this.win = parseFloat((arguments[0]["win"])) this.wpos = parseFloat((arguments[0]["wpos"])) this.wdim = parseFloat((arguments[0]["wdim"])) this.per = parseFloat((arguments[0]["per"])) this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; while (true) { [ok,this.nclock,this.clrs,this.win,this.wpos,this.wdim,this.per,exprs] = scicos_getvalue("Set Scope parameters",["Number of event inputs","colors c (>0) or mark (<0)","Output window number (-1 for automatic)","Output window position","Output window sizes","Refresh period"],list("vec",1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",1),exprs); this.nclock = int(this.nclock); this.clrs = int(this.clrs); this.win = int(this.win); if (!ok) { break; } mess = []; if (size(this.wpos,"*")!=0&&size(this.wpos,"*")!=2) { mess = [[mess],["Window position must be [] or a 2 vector"],[" "]]; ok = false; } if (size(this.wdim,"*")!=0&&size(this.wdim,"*")!=2) { mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]]; ok = false; } if (this.nclock<=0) { mess = [[mess],["Block must have at least one input event"],[" "]]; ok = false; } if (size(this.clrs,"*")!=this.nclock) { mess = [[mess],["Inputs color c size must be equal to Number of inputs"],[" "]]; ok = false; } if (this.win<-1) { mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; ok = false; } if (this.per<=0) { mess = [[mess],["Refresh period must be positive"],[" "]]; ok = false; } if (ok) { [model,graphics,ok] = set_io(model,graphics,list(),list(),ones(this.nclock,1),[]); } else { message([["Some specified values are inconsistent:"],[" "],[mess]]); } if (ok) { if (this.wpos==[]) { this.wpos = [[-1],[-1]]; } if (this.wdim==[]) { this.wdim = [[-1],[-1]]; } rpar = this.per; ipar = [[this.win],[1],[this.clrs.slice()],[this.wpos.slice()],[this.wdim.slice()]]; model.rpar = rpar; model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = model; break; } } return new BasicBlock(this.x); } }