def __init__(self, parent): QWidget.__init__(self, parent) self.item = None self.data = None self.picking = None self.picked_points = [] loadUi(self, 'dataops.ui') self.pickedLbl.hide()
def __init__(self, parent): QWidget.__init__(self, parent) self.logger = logger.getChild('model') self.gauss_picking = 0 self.gauss_peak_pos = 0, 0 self.pick_model = None self.data = None self.last_model = None self.createUI()
def __init__(self, parent, standalone=False, fit_kws={}): QWidget.__init__(self, parent) self.item = getattr(parent, 'item', None) self.logger = logger.getChild('fitter') self.picking = None self.last_result = None self.model = None self.data = None self.param_controls = {} self.fit_kws = fit_kws self.standalone = standalone self.createUI(standalone)
def resizeEvent(self, event): # reimplemented to add tight_layout() w = event.size().width() h = event.size().height() dpival = float(self.figure.dpi) winch = w / dpival hinch = h / dpival self.figure.set_size_inches(winch, hinch) try: self.figure.tight_layout(pad=2) except Exception: pass self.plotter.save_layout() self.draw() self.update() QWidget.resizeEvent(self, event)
def on_addboxBtn_clicked(self): x1, x2 = map(int, self.canvas.axes.get_xlim()) y1, y2 = map(int, self.canvas.axes.get_ylim()) box = QWidget(self) loadUi(box, 'box.ui') # there's always a stretcher at the bottom self.boxLayout.insertWidget(self.boxLayout.count() - 1, box) self.boxes.append(box) box.nameBox.setText('Box %d' % len(self.boxes)) box.x1Box.setValue(x1) box.x2Box.setValue(x2) box.y1Box.setValue(y1) box.y2Box.setValue(y2) def boxchange(v): self.plot(False) def boxremove(box=box): index = self.boxes.index(box) del self.boxes[index] item = self.boxLayout.takeAt(index) item.widget().deleteLater() self.plot(False) box.x1Box.valueChanged.connect(boxchange) box.x2Box.valueChanged.connect(boxchange) box.y1Box.valueChanged.connect(boxchange) box.y2Box.valueChanged.connect(boxchange) box.delBtn.clicked.connect(boxremove) self.plot(False)
def __init__(self, parent, plotter, standalone=False): QWidget.__init__(self, parent) self.logger = logger.getChild('loader') self.plotter = plotter self.last_data = [] self.loader = Loader() self.createUI(standalone) self.sgroup = SettingGroup('main') # These will not do anything in standalone mode, but do not hurt. session.propsRequested.connect(self.on_session_propsRequested) session.propsUpdated.connect(self.on_session_propsUpdated) session.itemsUpdated.connect(self.on_session_itemsUpdated) session.groupAdded.connect(self.on_session_itemsUpdated) with self.sgroup as settings: data_template_path = settings.value('last_data_template', '') if data_template_path: self.templateEdit.setText(data_template_path) self.set_template(data_template_path, 0, silent=True)
def __init__(self, parent, canvas): QWidget.__init__(self, parent) self.canvas = canvas self.replotRequest.connect(self.plot) loadUi(self, 'multiops.ui')
def __init__(self, parent, canvas): QWidget.__init__(self, parent) self.canvas = canvas self.boxes = [] loadUi(self, 'imageops.ui')