Exemplo n.º 1
0
 def EPROpened(self):#{{{
     """ Handling for the EPR file browser button """
     if self.DataDir:
         self.EPRFile = str(QtGui.QFileDialog.getOpenFileName(self, 'Open file',self.DataDir))
     else:
         self.EPRFile = str(QtGui.QFileDialog.getOpenFileName(self, 'Open file',os.getcwd()))
     self.EPRFileDisplay.setText(_translate("Form",str(self.EPRFile),None))#}}}
Exemplo n.º 2
0
 def T1Opened(self):#{{{
     """ Handling for the T1 file browser button """
     if self.DataDir:
         self.T1File = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open file',self.DataDir))
     else:
         self.T1File = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open file',os.getcwd()))
     self.T1Display.setText(_translate("Form",str(self.T1File),None))#}}}
Exemplo n.º 3
0
 def EPRCalOpened(self):#{{{
     """ Handling for the EPR Calibration file browser button """
     if self.DataDir:
         self.EPRCalFile = str(QtGui.QFileDialog.getOpenFileName(self, 'Open file',self.DataDir))
     else:
         self.EPRCalFile = str(QtGui.QFileDialog.getOpenFileName(self, 'Open file',os.getcwd()))
     self.EPRCalFileDisplay.setText(_translate("Form",str(self.EPRCalFile),None))
     self.eprExpBox.setChecked(True)#}}}
Exemplo n.º 4
0
    def __init__(self):
        QDialog.__init__(self)
        # Setup the user interface from designer
        self.setupUi(self)

        # variable definitions#{{{
        self.EPRFile = False
        self.ODNPFile = False
        self.T1File = False
        self.dataBase = False
        self.dataDirFile = 'datadir.txt'
        self.DataDir = None
        self.calSaveFile = 'calFile.txt'
        self.CalFile = None
        self.dataBaseList = ['Select Value','Yes','No']#}}}

        # Find data directory and EPR calibration file#{{{
        # Locate the Data Directory
        if os.path.isfile(self.dataDirFile):
            opened = open(self.dataDirFile,'r')
            self.DataDir =  opened.readline()
            self.DataDirDisplay.setText(_translate("Form",str(self.DataDir),None))
        # Locate the calibration file
        if os.path.isfile(self.calSaveFile):
            opened = open(self.calSaveFile,'r')
            self.CalFile =  opened.readline()
            self.EPRCalFileDisplay.setText(_translate("Form",str(self.CalFile),None))#}}}

        # load the database combo box with choices and make it editable#{{{
        self.databaseComboBox.addItems(self.dataBaseList)
        self.databaseComboBox.setEditable(True)#}}}

        # Links for the gui manipulatable options#{{{
        self.DataDirBrowseButton.clicked.connect(self.DataDirOpened)
        self.NMRBrowseButton.clicked.connect(self.NMROpened)
        self.EPRBrowseButton.clicked.connect(self.EPROpened)
        self.EPRCalBrowseButton.clicked.connect(self.EPRCalOpened)
        # Links to saving the data directory, exiting the GUI, or running the workup.
        self.DataDirSaveButton.clicked.connect(self.saveDataDir)
        self.EPRCalSaveButton.clicked.connect(self.saveCalFile)
        self.ExitButton.clicked.connect(self.exitProgram)
        self.RunWorkupButton.clicked.connect(self.runProgram)
        self.databaseComboBox.currentIndexChanged.connect(self.dbComboChanged)#}}}
Exemplo n.º 5
0
 def runProgram(self):#{{{
     """ Handling for the run program button to launch the return integrals workup program """
     # Read the check boxes to determine the type of experiment and database desire.
     self.runButton.setDisabled(True)
     if self.EPRFile:
         eprName = str(self.EPRFile).split('.')[0]
     else:
         eprName = False
     if self.ODNPFile:
         odnpPath = str(self.ODNPFile)
     else:
         odnpPath = False
     returnToProgram = returnIntegralsDev.workupODNP(self) # Call to work up the script
     self.runButton.setEnabled(True)
     self.databaseComboBox.clear()
     self.databaseComboBox.addItems(self.dataBaseList)
     self.databaseComboBox.setEditable(True)
     self.EPRFile = False
     self.ODNPFile = False
     self.T1File = False
     self.ODNPDisplay.setText(_translate("Form",str("Enter File Name"),None))
     self.T1Display.setText(_translate("Form",str("Enter File Name"),None))
     self.EPRFileDisplay.setText(_translate("Form",str("Enter File Name"),None))
Exemplo n.º 6
0
 def DataDirOpened(self):#{{{
     """ Handling to open the file browser to choose the data directory """
     self.DataDir = QtGui.QFileDialog.getExistingDirectory(self, 'Open file',os.getcwd())
     self.DataDirDisplay.setText(_translate("Form",str(self.DataDir),None))#}}}