Esempio n. 1
0
    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()))
Esempio n. 2
0
 def on_but_browser(self):
     logger.debug('on_but_browser', __name__)
     try:
         cp.guifilebrowser.close()
     except:
         cp.guifilebrowser = GUIFileBrowser(None, [fnm.path_blam()])
         cp.guifilebrowser.move(cp.guimain.pos().__add__(
             QtCore.QPoint(720, 120)))
         cp.guifilebrowser.show()
Esempio n. 3
0
    def on_but_path(self):
        logger.debug('Blamish 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_blam.setValue(dname)
        cp.fname_blam.setValue(fname)
        logger.info('selected file: ' + str(fnm.path_blam()), __name__)
Esempio n. 4
0
 def on_but_plot(self):
     logger.debug('on_but_plot', __name__)
     try:
         logger.debug('try to close', __name__)
         cp.plotimgspe.close()
         try:
             del cp.plotimgspe
         except:
             pass
         #but.setStyleSheet(cp.styleButtonBad)
     except:
         logger.debug('except and open', __name__)
         arr = gu.get_array_from_file(fnm.path_blam())
         if arr == None: return
         logger.debug('Array shape: ' + str(arr.shape), __name__)
         cp.plotimgspe = PlotImgSpe(None, arr, ofname=fnm.path_blam_plot())
         cp.plotimgspe.move(cp.guimain.pos().__add__(QtCore.QPoint(
             740, 140)))  # self.parentWidget().pos()
         cp.plotimgspe.show()
Esempio n. 5
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.setGeometry(200, 400, 530, 30)
        self.setWindowTitle('Blamish file')
        self.setFrame()

        self.cbx_use = QtGui.QCheckBox('Use blemish correction', self)
        self.cbx_use.setChecked(cp.ccdcorr_blemish.value())

        self.edi_path = QtGui.QLineEdit(fnm.path_blam())
        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()
Esempio n. 6
0
    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() ) )