def configure(self, params): if params.get('value') is not None: new_text = params.get('value') if new_text != self.value: self.value = new_text self.set_text() if params.get('clickchange') is not None: self.clickchange = params['clickchange'] if params.get('default') is not None: self.default = params['default'] newsize = None if params.get('style') is not None: newstyle = params.get('style') if newstyle.get('canvas-size') is not None: newsize = newstyle.get('canvas-size') params['width'] = newsize[0] params['height'] = newsize[1] if params.get('border') is not None: self.border = params.get('border') PatchElement.configure(self, params) if newsize: self.set_size(*newsize) self.update()
def configure(self, params): if "plot_type" in params and self.xyplot is None: if params["plot_type"] == "scatter": self.xyplot = ScatterPlot(self.INIT_WIDTH, self.INIT_HEIGHT) elif params["plot_type"] == "scope": self.xyplot = ScopePlot(self.INIT_WIDTH, self.INIT_HEIGHT, MFPApp().samplerate) self.xyplot.draw_complete_cb = self.draw_complete_cb if self.xyplot: self.add_actor(self.xyplot) self.xyplot.set_position(3, self.LABEL_SPACE) if self.obj_args is None: self.label.set_text("%s" % (self.obj_type, )) else: self.label.set_text("%s %s" % (self.obj_type, self.obj_args)) x_min = params.get('x_min', self.x_min) x_max = params.get('x_max', self.x_max) y_min = params.get('y_min', self.y_min) y_max = params.get('y_max', self.y_max) self.set_bounds(x_min, y_min, x_max, y_max) if self.xyplot is not None: self.xyplot.configure(params) PatchElement.configure(self, params)
def configure(self, params): if "plot_type" in params and self.xyplot is None: if params["plot_type"] == "scatter": self.xyplot = ScatterPlot(self, self.INIT_WIDTH, self.INIT_HEIGHT) elif params["plot_type"] == "scope": self.xyplot = ScopePlot(self, self.INIT_WIDTH, self.INIT_HEIGHT, MFPApp().samplerate) self.xyplot.draw_complete_cb = self.draw_complete_cb if self.xyplot: self.add_actor(self.xyplot) self.xyplot.set_position(3, self.LABEL_SPACE) if self.obj_args is None: self.label.set_text("%s" % (self.obj_type,)) else: self.label.set_text("%s %s" % (self.obj_type, self.obj_args)) x_min = params.get('x_min', self.x_min) x_max = params.get('x_max', self.x_max) y_min = params.get('y_min', self.y_min) y_max = params.get('y_max', self.y_max) self.set_bounds(x_min, y_min, x_max, y_max) if self.xyplot is not None: self.xyplot.configure(params) PatchElement.configure(self, params)
def configure(self, params): if params.get('value') is not None: new_text = params.get('value') if new_text != self.value: self.value = new_text self.label.set_markup(self.value) PatchElement.configure(self, params) self.update()