def __init__(self, parent=None,**kwargs):
super(AppWindow, self).__init__(parent)
self.setupUi(self)
self.I=kwargs.get('I',None)
self.I.__ignoreCalibration__()
self.table = myTable()
self.tableLayout.addWidget(self.table)
#Reset existing calibration in software!
self.reset()
self.hexid = hex(self.I.device_id())
self.setWindowTitle(self.I.generic_name + ' : '+self.I.H.version_string.decode("utf-8")+' : '+self.hexid)
#Check DIO and freq counter
for a in ['SQR1','SQR2','SQR3','SQR4']:
x = {'SQR1':0,'SQR2':0,'SQR3':0,'SQR4':0}
x[a]=1
self.I.set_state(**x)
time.sleep(0.1)
self.I.sqrPWM(10000,0.5,0,0.5,0,0.5,0,0.5)
for a in ['ID1','ID2','ID3','ID4','CNTR']:
if abs(self.I.get_freq(a,0.2)-10000)>2:
self.setWindowTitle('D/IO error!!!!!!!!!!!!!!!!!!!!!!!' + ' : '+self.hexid)
self.I.set_state(SQR1=0,SQR2=0,SQR3=0,SQR4=0)
self.plot=self.add2DPlot(self.plot_area)
self.plot=self.add2DPlot(self.plot_area)
labelStyle = {'color': 'rgb(255,255,255)', 'font-size': '11pt'}
self.plot.setLabel('left','Error -->', units='V',**labelStyle)
self.plot.setLabel('bottom','Actual Voltage -->', units='V',**labelStyle)
self.plot.setYRange(-.06,.06)
self.region = pg.LinearRegionItem([-1.,1.])
self.region.setZValue(-10)
self.plot.addItem(self.region)
self.opendir = QtGui.QPushButton('open')
self.opendir.clicked.connect(self.loadDir)
self.WidgetLayout.addWidget(self.opendir)
self.uploadButton = QtGui.QPushButton('Upload')
self.uploadButton.clicked.connect(self.uploadCalibration)
self.WidgetLayout.addWidget(self.uploadButton)
self.results={}
self.DAC_POLYS=[]
self.INL_SLOPE=0
self.INL_INTERCEPT=0
self.adc_shifts=[]
self.DAC_FILES=[]
self.DAC_TABLES=[]
self.dirname = ''
self.ADDITIONAL_FILE = 'CAP_PCS.csv'
评论列表
文章目录