def setDifferentAD7718(self):
     sel = self.deviceBox.currentText()
     if (not ('ACM' in sel or 'USB' in sel)):
         self.displayDialog('No devices Found')
         return
     from SEEL import interface
     self.ISPI = interface.connect(port=sel, load_calibration=False)
     self.A.setADC(self.ISPI)
     self.displayDialog('Connected' +
                        self.I.H.version_string.decode("utf-8"))
    def __init__(self,I=None):
        self.CS=9
        if I:
            self.I = I
        else:
            from SEEL import interface
            self.I = interface.connect()
        self.I.SPI.set_parameters(2,2,1,1,0)
        self.I.map_reference_clock(self.clockScaler,'WAVEGEN')
        print ('clock set to ',self.I.DDS_CLOCK )

        self.waveform_mode = self.DDS_TRIANGLE;
        self.write(1<<self.DDS_RESET)
        self.write((1<<self.DDS_B28) | self.waveform_mode )               #finished loading data
        self.active_channel = 0
        self.frequency  =  1000
	def saveFile(self):
		self.saveToCSV(self.resultsTable)

	def savePlots(self):
		self.saveDataWindow([self.curveCH1,self.curveCH2,self.curveXY])


	def setTimebase(self,T):
		self.tgs = [0.5,1,2,4,6,8,10,25,50,100]
		self.tg = self.tgs[T]
		self.tgLabel.setText(str(5000*self.tg*1e-3)+'mS')
		
	def closeEvent(self, event):
		self.running=False
		self.timer.stop()
		self.finished=True
		

	def __del__(self):
		self.timer.stop()
		print ('bye')

if __name__ == "__main__":
    from SEEL import interface
    app = QtGui.QApplication(sys.argv)
    myapp = AppWindow(I=interface.connect())
    myapp.show()
    sys.exit(app.exec_())

			print ('Writing DAC offsets and tables....',name)
			if name == 'PV1':
				LOCA= self.I.DAC_SHIFTS_PV1A;LOCB= self.I.DAC_SHIFTS_PV1B;
			elif name == 'PV2':
				LOCA= self.I.DAC_SHIFTS_PV2A;LOCB= self.I.DAC_SHIFTS_PV2B;
			elif name == 'PV3':
				LOCA= self.I.DAC_SHIFTS_PV3A;LOCB= self.I.DAC_SHIFTS_PV3B;
			else:
				print ('unknown DAC file',FILE)
				continue
			TABLE = self.atos( self.DAC_TABLES[FILE] )
			print('DAC WRITING',name,LOCA,LOCB,TABLE[:50])
			print('Writing DAC shifts to Flash.....(first half)')
			self.I.write_bulk_flash(LOCA,TABLE[:2048])
			print('Writing DAC shifts to Flash.....(second half)')
			self.I.write_bulk_flash(LOCB,TABLE[2048:])
		
		self.setWindowTitle(self.I.generic_name + ' : '+self.I.H.version_string.decode("utf-8")+' : FINISHED CALIBRATION WRITE')
		

	def __del__(self):
		print('bye')

if __name__ == "__main__":
    from SEEL import interface
    app = QtGui.QApplication(sys.argv)
    myapp = AppWindow(I=interface.connect(load_calibration=False))
    myapp.show()
    sys.exit(app.exec_())

        pos = evt[0].scenePos(
        )  ## using signal proxy turns original arguments into a tuple
        if plot.sceneBoundingRect().contains(pos):
            plot.mousePoint = plot.getPlotItem().vb.mapSceneToView(pos)
            plot.vLine.setPos(plot.mousePoint.x())
            plot.hLine.setPos(plot.mousePoint.y())
            self.displayCrossHairData(
                plot, False, self.samples, self.I.timebase,
                [self.I.achans[0].get_yaxis(), self.I.achans[1].get_yaxis()],
                [(0, 255, 0), (255, 0, 0)])

    def saveData(self):
        self.saveDataWindow([self.curve1, self.curve2], self.plot)

    def closeEvent(self, event):
        self.running = False
        self.timer.stop()
        self.finished = True

    def __del__(self):
        self.timer.stop()
        print('bye')


if __name__ == "__main__":
    from SEEL import interface
    app = QtGui.QApplication(sys.argv)
    myapp = AppWindow(I=interface.connect())
    myapp.show()
    sys.exit(app.exec_())
Beispiel #6
0
        vals = self.I2C.readBulk(self.ADDRESS, addr, bytes)
        return vals

    def getRaw(self):
        vals = self.getVals(0x03, 6)
        if vals:
            if len(vals) == 6:
                return [
                    int16(vals[a * 2] << 8 | vals[a * 2 + 1]) /
                    self.scaling[self.gainValue] for a in range(3)
                ]
            else:
                return False
        else:
            return False


if __name__ == "__main__":
    from SEEL import interface
    I = interface.connect()
    I.set_sine1(.5)
    A = connect(I.I2C)
    A.setGain(2)
    t, x, y, z = I.I2C.capture(A.ADDRESS, 0x03, 6, 400, 10000, 'int')
    #print (t,x,y,z)
    from pylab import *
    plot(t, x)
    plot(t, y)
    plot(t, z)
    show()
			for a in self.statics:
				w = self.statics[a]
				if w.isChecked():
					FL.write('\tSTANDARD\n')
					FL.write('\t\t%s\n'%(w.text()))



			FL.close()	



	
	def __del__(self):
		self.timer.stop()
		print ('bye')

	def closeEvent(self, event):
		self.timer.stop()
		self.finished=True
		

if __name__ == "__main__":
	from SEEL import interface
	import sys
	app = QtGui.QApplication(sys.argv)
	#P=[{'name':'res','cmd':'CH1'}]  #An array of dictionaries defining custom functions
	myapp = AppWindow(I=interface.connect())#,preset = P)
	myapp.show()
	sys.exit(app.exec_())
Beispiel #8
0
		try:
			self.I.__fetch_channel__(1)
			self.I.__fetch_channel__(2)
			
			self.plot.curves[0].setData(self.I.achans[0].get_xaxis()*1e-6,self.I.achans[0].get_yaxis(),connect='finite')
			self.plot.curves[1].setData(self.I.achans[1].get_xaxis()*1e-6,self.I.achans[1].get_yaxis(),connect='finite')
			self.plot.updateCrossHairs()
			
			self.I.capture_traces(2,self.plot.samples,self.plot.tg)
			if self.running:self.timer.singleShot(self.plot.samples*self.I.timebase*1e-3+100,self.run)
		except Exception,e:
			print (e)

	def closeEvent(self, event):
		self.timer.stop()
		self.running=False

	def __del__(self):
		self.timer.stop()
		print('bye')


if __name__ == "__main__":
    from SEEL import interface
    app = QtGui.QApplication(sys.argv)
    I = interface.connect()
    myapp = AppWindow(I=I)
    myapp.show()
    sys.exit(app.exec_())

Beispiel #9
0
        self.table.item(2, 1).setText('%.3e' % cap)
        actual = float(self.table.item(2, 0).text())
        self.table.item(6 + CR, 2).setText('%.3e' % (cap / actual))

    def cal100(self):  #Cap calibration
        CR = 3
        cap = self.get_capacitance(CR)
        self.table.item(3, 1).setText('%.3e' % cap)
        actual = float(self.table.item(3, 0).text())
        self.table.item(6 + CR, 2).setText('%.3e' % (cap / actual))

        CR = 0
        cap = self.get_capacitance(CR)
        self.table.item(3, 1).setText('%.3e' % cap)
        actual = float(self.table.item(3, 0).text())
        self.table.item(6 + CR, 2).setText('%.3e' % (cap / actual))

    def calPCS(self):
        v = self.I.set_pcs(1.0e-3)
        rv = self.I.get_average_voltage('CH3')
        print(v, rv)
        pass


if __name__ == "__main__":
    from SEEL import interface
    app = QtGui.QApplication(sys.argv)
    myapp = AppWindow(I=interface.connect(verbose=True))
    myapp.show()
    sys.exit(app.exec_())
Beispiel #10
0
		if cap_and_pcs[:5]=='READY':
			scalers = struct.unpack('8f',cap_and_pcs[5:])
			print(cap_and_pcs,scalers)
			#self.__calibrate_ctmu__(self,scalers[:4])
			#self.DAC.CHANS['PCS'].load_calibration_twopoint(scalers[4],scalers[5]) #Slope and offset for current source
			#self.aboutArray.append(['Capacitance scaling']+scalers[:4])
			#self.aboutArray.append(['PCS slope,offset']+scalers[4:])
		else:
			self.displayDialog('Cap and PCS calibration invalid')

	def upload(self):
		vals = [self.I.SOCKET_CAPACITANCE]
		for a in range(7):
			item = self.table.item(a+4,2)
			vals.append(float(item.text()))
		cap_and_pcs=self.I.write_bulk_flash(self.I.CAP_AND_PCS,self.stoa('READY'+struct.pack('8f',*vals)))  #READY+calibration_string
		self.I.SOCKET_CAPACITANCE = vals[0]
		self.I.__calibrate_ctmu__(vals[4:])
		self.I.DAC.CHANS['PCS'].load_calibration_twopoint(vals[1],vals[2]) #Slope and offset for current source
		self.I.resistanceScaling = vals[3]



if __name__ == "__main__":
    from SEEL import interface
    app = QtGui.QApplication(sys.argv)
    myapp = AppWindow(I=interface.connect(load_calibration=False,verbose=True))
    myapp.show()
    sys.exit(app.exec_())