Пример #1
0
 def showSave(self):
     fname = QtGui.QFileDialog.getSaveFileName(self, "Save Graphics",
                                               os.getcwd(), "FILE")
     if (fname != ""):
         print 'test' + fname
         try:
             Write.SaveFile(fname).saveData(
                 self.tab.currentWidget().getData())
         except:
             self.showError("This file is not correct or no file open")
Пример #2
0
 def showExport(self):
     try:
         fname = QtGui.QFileDialog.getSaveFileName(self,"Export data in xyz format",Var.path(), "XYZ file (*.xyz)")
         if (fname !=""):
             if 'xyz' in fname.split('.'):
                 pass
             else:
                 fname += '.xyz'
             pos   = self.file1.getXCart()   * 0.5291772085936 # Angstrom
             acell = self.file1.getAcell() * 0.5291772085936 # Angstrom
             typat = self.file1.getTypat()
             znucl = self.file1.getZnucl()
             Write.SaveFile(fname).xyzFormat(pos,acell,typat,znucl)
             self.showMessage("file save in "+ str(fname))
     except:
         self.showError("Unable to save in xyz format ")
Пример #3
0
 def showExport(self):
     try:
         fname = QtGui.QFileDialog.getSaveFileName(self, "Export data",
                                                   os.getcwd(),
                                                   "XYZ file (*.xyz)")
         if (fname != ""):
             if 'xyz' in fname.split('.'):
                 pass
             else:
                 fname += '.xyz'
             pos = (self.tab.currentWidget().getFile()
                    ).getXCart() * 0.5291772085936  # Angstrom
             acell = (self.tab.currentWidget().getFile()
                      ).getAcell() * 0.5291772085936  # Angstrom
             typat = (self.tab.currentWidget().getFile()).getTypat()
             znucl = (self.tab.currentWidget().getFile()).getZnucl()
             Write.SaveFile(fname).xyzFormat(pos, acell, typat, znucl)
     except:
         self.showError("This file is not molecular dynamics file")
Пример #4
0
 def showDialog(self):
     fname = QtGui.QFileDialog.getSaveFileName(self, "Save Graphics",
                                               os.getcwd())
     if fname != "":
         Write.SaveFile(fname).saveGraph(self.x, self.y, self.xlabel,
                                         self.ylabel)
Пример #5
0
             pass; 
         if nf <= MD_file.getNbTime() and ni < nf : 
             MD_file.setNf(int(nf))
             break;            
     MD_file.setNf(int(nf))
     clear()
     
 elif choice == 3:
     try:    
         fname = saveFile('xyz')
         pos   = MD_file.getPos()
         acell = MD_file.getAcell()
         typat = MD_file.getTypat()
         znucl = MD_file.getZnucl()
         print "Saving File, please wait..."
         Write.SaveFile(fname).xyzFormat(pos,acell,typat,znucl)
         print  fname 
         print 'File save sucessful!'
     except:
         print 'Unable to save file'
         
         
 elif choice == 4:
     while j < size_calculation:
         choiceQuantitie = 0
         name_quantitie=""
         if input_file == False:
             print " "
             print "your options are:"
             print " "
             print "1  => Total Energy"