def __init__ ( self, parent=None ) : QtGui.QWidget.__init__(self, parent) self.setGeometry(200, 400, 530, 30) self.setWindowTitle('Flat field file') self.setFrame() self.parent = parent self.cbx_use = QtGui.QCheckBox('Use flat field correction', self) self.cbx_use.setChecked( cp.ccdcorr_flatfield.value() ) self.edi_path = QtGui.QLineEdit( fnm.path_flat() ) self.edi_path.setReadOnly( True ) self.but_path = QtGui.QPushButton('File:') self.but_plot = QtGui.QPushButton('Plot') self.but_brow = QtGui.QPushButton('View') self.grid = QtGui.QGridLayout() self.grid_row = 1 #self.grid.addWidget(self.tit_path, self.grid_row, 0) self.grid.addWidget(self.cbx_use, self.grid_row, 0, 1, 6) self.grid.addWidget(self.but_path, self.grid_row+1, 0) self.grid.addWidget(self.edi_path, self.grid_row+1, 1, 1, 6) self.grid.addWidget(self.but_plot, self.grid_row+2, 0) self.grid.addWidget(self.but_brow, self.grid_row+2, 1) self.connect(self.cbx_use, QtCore.SIGNAL('stateChanged(int)'), self.onCBox ) self.connect(self.but_path, QtCore.SIGNAL('clicked()'), self.on_but_path ) self.connect(self.but_plot, QtCore.SIGNAL('clicked()'), self.on_but_plot ) self.connect(self.but_brow, QtCore.SIGNAL('clicked()'), self.on_but_browser ) self.setLayout(self.grid) self.showToolTips() self.setStyle()
def setTableInfoItems(self): self.item_data_file.setText(os.path.basename(fnm.path_data_xtc_cond())) if cp.bat_dark_is_used.value(): self.item_dark_file.setText( os.path.basename(fnm.path_pedestals_ave())) else: self.item_dark_file.setText('is not used') if cp.ccdcorr_flatfield.value(): self.item_flat_file.setText(os.path.basename(fnm.path_flat())) else: self.item_flat_file.setText('is not used') if cp.ccdcorr_blemish.value(): self.item_blem_file.setText(os.path.basename(fnm.path_blem())) else: self.item_blem_file.setText('is not used') self.item_data_start.setText(str(cp.bat_data_start.value())) self.item_data_end.setText(str(cp.bat_data_end.value())) self.item_data_total.setText(str(cp.bat_data_total.value())) self.item_data_time.setText( str(cp.bat_data_dt_ave.value()) + u'\u00B1' + str(cp.bat_data_dt_rms.value()))
def __init__ ( self, parent=None ) : QtGui.QWidget.__init__(self, parent) self.setGeometry(200, 400, 530, 30) self.setWindowTitle('Flat field file') self.setFrame() self.parent = parent self.cbx_use = QtGui.QCheckBox('Use flat field correction', self) self.cbx_use.setChecked( cp.ccdcorr_flatfield.value() ) self.edi_path = QtGui.QLineEdit( fnm.path_flat() ) self.edi_path.setReadOnly( True ) self.but_path = QtGui.QPushButton('File:') self.but_plot = QtGui.QPushButton('Plot') self.but_brow = QtGui.QPushButton('Browse') self.grid = QtGui.QGridLayout() self.grid_row = 1 #self.grid.addWidget(self.tit_path, self.grid_row, 0) self.grid.addWidget(self.cbx_use, self.grid_row, 0, 1, 6) self.grid.addWidget(self.but_path, self.grid_row+1, 0) self.grid.addWidget(self.edi_path, self.grid_row+1, 1, 1, 6) self.grid.addWidget(self.but_plot, self.grid_row+2, 0) self.grid.addWidget(self.but_brow, self.grid_row+2, 1) self.connect(self.cbx_use, QtCore.SIGNAL('stateChanged(int)'), self.onCBox ) self.connect(self.but_path, QtCore.SIGNAL('clicked()'), self.on_but_path ) self.connect(self.but_plot, QtCore.SIGNAL('clicked()'), self.on_but_plot ) self.connect(self.but_brow, QtCore.SIGNAL('clicked()'), self.on_but_browser ) self.setLayout(self.grid) self.showToolTips() self.setStyle()
def on_but_browser (self): logger.debug('on_but_browser', __name__) try : cp.guifilebrowser.close() except : cp.guifilebrowser = GUIFileBrowser(None, [fnm.path_flat()]) cp.guifilebrowser.move(cp.guimain.pos().__add__(QtCore.QPoint(720,120))) # self.parentWidget() cp.guifilebrowser.show()
def on_but_plot(self): logger.debug('on_but_plot', __name__) try : cp.plotimgspe.close() try : del cp.plotimgspe except : pass except : arr = gu.get_array_from_file(fnm.path_flat()) if arr is None : return logger.debug('Array shape: ' + str(arr.shape), __name__) cp.plotimgspe = PlotImgSpe(None, arr, ofname=fnm.path_flat_plot()) cp.plotimgspe.move(cp.guimain.pos().__add__(QtCore.QPoint(740,140))) # self.parentWidget() cp.plotimgspe.show()
def on_but_plot(self): logger.debug('on_but_plot', __name__) try : cp.plotimgspe.close() try : del cp.plotimgspe except : pass except : arr = gu.get_array_from_file(fnm.path_flat()) if arr == None : return logger.debug('Array shape: ' + str(arr.shape), __name__) cp.plotimgspe = PlotImgSpe(None, arr, ofname=fnm.path_flat_plot()) cp.plotimgspe.move(cp.guimain.pos().__add__(QtCore.QPoint(740,140))) # self.parentWidget() cp.plotimgspe.show()
def on_but_path(self): logger.debug('Flat field file browser', __name__ ) path = str(self.edi_path.text()) path = str( QtGui.QFileDialog.getOpenFileName(self,'Select file',path) ) dname, fname = os.path.split(path) if dname == '' or fname == '' : logger.info('Input directiry name or file name is empty... keep file path unchanged...') return self.edi_path.setText(path) cp.dname_flat.setValue(dname) cp.fname_flat.setValue(fname) logger.info('selected file: ' + str(fnm.path_flat()), __name__ )
def setTableInfoItems(self) : self.item_data_file.setText( os.path.basename(fnm.path_data_xtc_cond()) ) if cp.bat_dark_is_used.value() : self.item_dark_file.setText( os.path.basename(fnm.path_pedestals_ave()) ) else : self.item_dark_file.setText( 'is not used' ) if cp.ccdcorr_flatfield.value() : self.item_flat_file.setText( os.path.basename(fnm.path_flat()) ) else : self.item_flat_file.setText( 'is not used' ) if cp.ccdcorr_blemish.value() : self.item_blam_file.setText( os.path.basename(fnm.path_blam()) ) else : self.item_blam_file.setText( 'is not used' ) self.item_data_start.setText ( str( cp.bat_data_start.value() ) ) self.item_data_end .setText ( str( cp.bat_data_end .value() ) ) self.item_data_total.setText ( str( cp.bat_data_total.value() ) ) self.item_data_time .setText ( str( cp.bat_data_dt_ave.value() ) + u'\u00B1' + str( cp.bat_data_dt_rms.value() ) )