def __init__(self): super(Handler, self).__init__() self.setupUi(self) self.I = interface.Interface() #self.funcgen= agilent('192.168.1.3') self.I.configure_trigger(0, 0) self.looptimer = QTimer() self.plot1 = Exp.add2DPlot() self.plot2 = Exp.add2DPlot() self.curve1 = Exp.addCurve(self.plot1, 'INPUT', (255, 255, 255)) self.curve2 = Exp.addCurve(self.plot1, 'OUTPUT', (0, 255, 255)) self.p2 = Exp.enableRightAxis(self.plot2) self.plot2.getAxis('right').setLabel('Phase', color='#00ffff') self.plot2.getAxis('left').setLabel('Amplitude', color='#ffffff') for a in [self.plot1, self.plot2]: a.getAxis('bottom').setLabel('Frequency', color='#ffffff') self.p2.setYRange(-360, 360) self.curvePhase = Exp.addCurve(self.p2) #pg.PlotCurveItem() #self.p2.addItem(self.curvePhase) self.curvePhase.setPen(color=(0, 255, 255), width=1) self.curveAmp = self.plot2.plot() self.curveAmp.setPen(color=(255, 255, 255), width=1) self.freqs = [] self.amps = [] self.dP = [] self.STARTFRQ = self.startFreq.value() self.ENDFRQ = self.stopFreq.value() self.frq = self.STARTFRQ self.STEPFRQ = self.stepFreq.value() self.loop = None self.plot2.setXRange(self.STARTFRQ, self.ENDFRQ) self.plot2.setYRange(0, 1.) self.active = False
def __init__(self, exp): super(Handler, self).__init__() self.Exp = exp self.setupUi(self) self.I = interface.Interface() self.splitter.setSizes([1, 0]) self.base_current = 0 self.base_voltage = 0 self.seriesR = 1000. self.timegap = 0 self.MAXV = 2.0 self.MINV = 0.0 self.transistor_type = 'NPN' self.looptimer = QTimer() self.X = [] self.Y = [] self.curves = [] self.legends = [] self.curveData = {} self.plot = Exp.add2DPlot() self.plot.setLabel('bottom', 'Voltage -->>', units='V') self.plot.setLabel('left', 'Current -->>', units='A') self.plot.showGrid(True, True) self.newcol = self.random_color() self.current_curve = Exp.addCurve(self.plot, self.IbeLabel.text(), self.newcol) self.setBaseCurrent(0) self.I.set_pvs1(0) self.Exp.setRange(self.plot, -5, -20e-3, 10, 40e-3)
def __init__(self, Exp): super(Handler, self).__init__() self.setupUi(self) self.I = interface.Interface() self.timegap = 0 self.looptimer = QTimer() self.plot = Exp.add2DPlot() self.plot3d = Exp.add3DPlot() self.trace = Exp.addCurve(self.plot, 'IV', (255, 0, 255)) Exp.setRange(self.plot, 0, 0, 1.0, 1.5e-3) self.plot.setLabel('bottom', 'Voltage -->>', units='V') self.plot.setLabel('left', 'Current -->>', units='A')
def __init__(self, exp=None): super(Handler, self).__init__() self.Exp = exp self.setupUi(self) self.I = interface.Interface() self.delay = 100 self.plot = self.Exp.add3DPlot() self.looptimer = QTimer() self.Xchan = 1 self.Ychan = 2 self.Zchan = 3 self.samples = 800 self.scaleX = 20 / 16.5 self.offX = 0 self.scaleY = 20 / 16.5 self.offY = 0 self.scaleZ = 20 / 16.5 self.offZ = 0 self.setSine1(100) self.setSine2(100) self.tg = 1 self.launchacquire = self.delayedTask(self.delay, self.acquire)
import Labtools.interface as interface from Labtools.experiment import * import numpy as np from Labtools.MPU6050 import * import pyqtgraph as pg if __name__ == "__main__": I = interface.Interface() Exp = Experiment(parent=None, graph3D=True, showresult=False, I=I) plot = Exp.add3DPlot() surf = Exp.new3dSurface(plot, shader='heightColor', smooth=False, computeNormals=True) color = .9 surf.shader()['colorMap'] = np.array( [color, color + .1, 0.4, 0.5, 0.7, color - .2, 0.9, 1.0]) surf.scale(20. / 50, 20. / 500, 20. / 16.5) surf.translate(-10, -10, 0) surfdata = [] for x in range(50): surfdata.append(np.sin(np.linspace(0, 5 * np.pi, 500))) Exp.setSurfaceData(surf, surfdata) gyro = MPU6050(I) noise1 = [] noise2 = [] noise3 = [] for a in range(500):
def __init__(self, ADDRESS=0x1E): self.ADDRESS = ADDRESS self.I = interface.Interface()
def test_voltage_read(self): import Labtools.interface as i I = i.Interface() print self.I.get_average_voltage('CH1')