devs = makeDeviceList(False) self.programDevs(devs) def programDevs(self, devs): B = int(self.leftEdits[2].text()) stopTime = int(self.rightEdits[0].text()) stopConf = float(self.rightEdits[1].text()) stopTol = float(self.rightEdits[2].text()) / 100 A = float(self.leftEdits[0].text()) pw = float(self.leftEdits[1].text()) / 1000000 job = "33" HW.ArC.write_b(job + "\n") self.sendParams() wrapper = ThreadWrapper(devs, A, pw, B, stopTime, stopConf, \ stopTol, self.combo_stopOptions.currentText()) self.execute(wrapper, wrapper.run) def disableProgPanel(self, state): if state == True: self.hboxProg.setEnabled(False) else: self.hboxProg.setEnabled(True) tags = {'top': ModTag(tag, "Volatile Read", None)}
labelStyle = {'color': '#000000', 'font-size': '10pt'} japanPlot = view.addPlot() japanCurve = japanPlot.plot(pen=None, symbolPen=None, symbolBrush=(0, 0, 255), symbol='s', symbolSize=5, pxMode=True) japanPlot.getAxis('left').setLabel('dM/M0', **labelStyle) japanPlot.getAxis('bottom').setLabel('Voltage', units='V', **labelStyle) japanPlot.getAxis('left').setGrid(50) japanPlot.getAxis('bottom').setGrid(50) resLayout = QtWidgets.QHBoxLayout() resLayout.addWidget(view) resLayout.setContentsMargins(0, 0, 0, 0) resultWindow.setLayout(resLayout) japanCurve.setData(np.asarray(ampl), np.asarray(deltaR)) resultWindow.update() return resultWindow tags = {'top': ModTag(tag, "SwitchSeeker", SwitchSeeker.display)}
'color': 'F00', 'width': 1 }), symbolPen=pyqtgraph.mkPen({ 'color': 'F00', 'width': 1 }), symbolBrush=pyqtgraph.mkBrush('F00'), symbol='+', symbolSize=6, pxMode=True) filler = pyqtgraph.FillBetweenItem(lowBoundCurve, upperBoundCurve, brush=pyqtgraph.mkBrush('BBB')) plot.addItem(filler) return dialog tags = { 'top': ModTag(tag, "MultiStateSeeker", None), 'subtags': [ ModTag(tag + "1", "MultiState Polarity Inference", None), ModTag(tag + "2", "MultiState Retention", None), ModTag(tag + "3", "MultiState Calculation", MultiStateSeeker.display) ] }
def programDevs(self, programType): if programType == self.PROGRAM_ONE: devs = [[CB.word, CB.bit]] else: if programType == self.PROGRAM_RANGE: devs = makeDeviceList(True) else: devs = makeDeviceList(False) allData = self.gatherData() wrapper = ThreadWrapper(devs, allData) self.execute(wrapper, wrapper.run) def disableProgPanel(self,state): if state == True: self.hboxProg.setEnabled(False) else: self.hboxProg.setEnabled(True) @staticmethod def display(w, b, data, parent=None): dialog = FitDialog(w, b, data, parent) return dialog tags = { 'top': ModTag(tag, "ParameterFit", ParameterFit.display) }
resultWindow = QtWidgets.QWidget() resultWindow.setGeometry(100, 100, 500, 500) resultWindow.setWindowTitle("STDP: W=" + str(w) + " | B=" + str(b)) resultWindow.setWindowIcon(Graphics.getIcon('appicon')) resultWindow.show() view = pg.GraphicsLayoutWidget() label_style = {'color': '#000000', 'font-size': '10pt'} plot_stdp = view.addPlot() curve_stdp = plot_stdp.plot(pen=None, symbolPen=None, \ symbolBrush=(0,0,255), symbol='s', symbolSize=5, pxMode=True) plot_stdp.getAxis('left').setLabel('dG/G0', **label_style) plot_stdp.getAxis('bottom').setLabel('deltaT', units='s', **label_style) plot_stdp.getAxis('left').setGrid(50) plot_stdp.getAxis('bottom').setGrid(50) curve_stdp.setData(np.asarray(list_dt), np.asarray(dG)) layout = QtWidgets.QHBoxLayout() layout.addWidget(view) layout.setContentsMargins(0, 0, 0, 0) resultWindow.setLayout(layout) return resultWindow tags = {'top': ModTag(tag, "STDP", STDP.display)}
return wlines except: return False def updateCurrentRead(self, value): self.edit_current.setText(str(value * 1000000)) def eventFilter(self, object, event): if event.type() == QtCore.QEvent.Resize: self.vW.setFixedWidth(event.size().width() - object.verticalScrollBar().width()) return False def disableProgPanel(self, state): if state == True: self.hboxProg.setEnabled(False) else: self.hboxProg.setEnabled(True) def throwError(self): reply = QtWidgets.QMessageBox.question( self, "Error", "Formatting of active worlines input box is wrong. " + "Check for double spaces, trailing spaces, " + "and addresses larger than 32 or smaller than 1.", QtWidgets.QMessageBox.Ok) event.ignore() tags = {'top': ModTag(tag, "MultiBias", None)}
time.sleep(0.05) def programDevs(self, devs): idx = self.pulsingModeCombo.currentIndex() job = self.pulsingModeCombo.itemData(idx)["job"] self.sendParams(str(job)) wrapper = ThreadWrapper(devs) self.execute(wrapper, wrapper.run) def programOne(self): self.programDevs([[CB.word, CB.bit]]) def programRange(self): devs = makeDeviceList(True) self.programDevs(devs) def programAll(self): devs = makeDeviceList(False) self.programDevs(devs) def disableProgPanel(self,state): if state==True: self.hboxProg.setEnabled(False) else: self.hboxProg.setEnabled(True) tags = { 'top': ModTag(tag, "FormFinder", None) }
return mainChain_indexes = self.extractModuleChain() if mainChain_indexes == False: self.throw_wrong_loops_dialogue() else: self.thread = QtCore.QThread() self.threadWrapper = ThreadWrapper(mainChain_indexes, devs) self.finalise_thread_initialisation() self.thread.start() def finalise_thread_initialisation(self): self.threadWrapper.moveToThread(self.thread) self.thread.started.connect(self.threadWrapper.run) self.threadWrapper.finished.connect(self.thread.quit) self.threadWrapper.finished.connect(self.threadWrapper.deleteLater) self.thread.finished.connect(self.threadWrapper.deleteLater) self.threadWrapper.updateAddress.connect(functions.addressAntenna.update) self.threadWrapper.globalDisableInterface.connect(functions.interfaceAntenna.toggleGlobalDisable) self.threadWrapper.disableInterface.connect(functions.interfaceAntenna.cast) self.threadWrapper.execute.connect(self.singleExecute) def singleExecute(self, index): #print "###### EXECUTING ", index #time.sleep(0.001) self.mainChain[index].programOne() tags = { 'top': ModTag(tag, "SuperMode", None) }
Vplot.plot(V, pen=None, symbolPen=None, symbolBrush=(0,0,255), symbolSize=5, symbol='s', connect='pairs') Vplot.plot(Vidx, np.dstack((np.zeros(V.shape[0]), V)).flatten(), pen='b', symbolPen=None, symbolBrush=None, connect='pairs') Vplot.plot(Z, pen=pyqtgraph.mkPen(QtGui.QColor(QtCore.Qt.lightGray), width=1)) Vplot.getAxis('left').setLabel('Voltage', units='V') Vplot.getAxis('bottom').setLabel('Pulse') Vplot.setXLink("resistance") containerLayout.addWidget(gv) saveButton = QtWidgets.QPushButton("Export data") saveCb = partial(functions.writeDelimitedData, np.column_stack((V, R))) saveButton.clicked.connect(partial(functions.saveFuncToFilename, saveCb, "Save data to...", parent)) bottomLayout = QtWidgets.QHBoxLayout() bottomLayout.addItem(QtWidgets.QSpacerItem(40, 10, QtWidgets.QSizePolicy.Expanding)) bottomLayout.addWidget(saveButton) containerLayout.addItem(bottomLayout) dialog.setLayout(containerLayout) return dialog tags = { 'top': ModTag(tag, "Endurance", Endurance.display) }
def programOne(self): self.programDevs(self.PROGRAM_ONE) def programRange(self): self.programDevs(self.PROGRAM_RANGE) def programAll(self): self.programDevs(self.PROGRAM_ALL) def programDevs(self, programType): if programType == self.PROGRAM_ONE: devs = [[CB.word, CB.bit]] else: if programType == self.PROGRAM_RANGE: devs = makeDeviceList(True) else: devs = makeDeviceList(False) allData = self.gatherData() wrapper = ThreadWrapper(devs, allData) self.execute(wrapper, wrapper.run) def disableProgPanel(self, state): self.hboxProg.setEnabled(not state) tags = {'top': ModTag(tag, "ConvergeToState", None)}
def programOne(self): self.programDevs(self.PROGRAM_ONE) def programRange(self): self.programDevs(self.PROGRAM_RANGE) def programAll(self): self.programDevs(self.PROGRAM_ALL) def programDevs(self, programType): if programType == self.PROGRAM_ONE: devs = [[CB.word, CB.bit]] else: if programType == self.PROGRAM_RANGE: devs = makeDeviceList(True) else: devs = makeDeviceList(False) allData = self.gatherData() wrapper = ThreadWrapper(devs, allData) self.execute(wrapper, wrapper.run) def disableProgPanel(self, state): self.hboxProg.setEnabled(not state) tags = { 'top': ModTag(tag, "ChronoAmperometry", ChronoAmperometry.display) }
symbolPen=None, symbolBrush=(cycle, totalCycles), symbol='s', symbolSize=5, pxMode=True, name='Cycle ' + str(cycle)) aux2.setData(np.asarray(voltage[cycle - 1]), np.asarray(current[cycle - 1])) aux3 = plot_R.plot(pen=(cycle, totalCycles), symbolPen=None, symbolBrush=(cycle, totalCycles), symbol='s', symbolSize=5, pxMode=True, name='Cycle ' + str(cycle)) aux3.setData(np.asarray(voltage[cycle - 1]), np.asarray(resistance[cycle - 1])) plot_R.setYRange(np.log10(_min_without_inf(resistance, np.inf)), np.log10(_max_without_inf(resistance, np.inf))) plot_abs.setYRange(np.log10(_min_without_inf(abs_current, 0.0)), np.log10(_max_without_inf(abs_current, 0.0))) resultWindow.update() return resultWindow tags = {'top': ModTag(tag, "CurveTracer", CurveTracer.display)}
pxMode=True) retentionPlot.getAxis('left').setLabel('Resistance', units='Ohms', **label_style) retentionPlot.getAxis('bottom').setLabel('Time', units='s', **label_style) retentionPlot.getAxis('left').setGrid(50) retentionPlot.getAxis('bottom').setGrid(50) resLayout = QtWidgets.QHBoxLayout() resLayout.addWidget(view) resLayout.setContentsMargins(0, 0, 0, 0) resultWindow = QtWidgets.QWidget() resultWindow.setGeometry(100, 100, 1000 * APP.scalingFactor, 400) resultWindow.setWindowTitle("Retention: W=" + str(w) + " | B=" + str(b)) resultWindow.setWindowIcon(Graphics.getIcon('appicon')) resultWindow.show() resultWindow.setLayout(resLayout) retentionPlot.setYRange(min(m) / 1.5, max(m) * 1.5) retentionCurve.setData(np.asarray(timePoints), np.asarray(m)) resultWindow.update() return resultWindow tags = {'top': ModTag(tag, "Retention", Retention.display)}