Esempio n. 1
0
class DisplayForm(QtGui.QDialog):

    def __init__(self, parent=None, search=None, app=None):
        QtGui.QWidget.__init__(self,parent)
        self.ui = Ui_DialogSearchDisplay()
        self.ui.setupUi(self)
        self.window2=None
        QtCore.QObject.connect(self.ui.button_set_up, QtCore.SIGNAL('clicked()'), self.set_up)
        QtCore.QObject.connect(self.ui.button_run, QtCore.SIGNAL('clicked()'), self.run)
        if (search != None):
            self.search = search
    
    def set_up(self):
        if self.window2 is None:
            self.window2 = SetUpForm(parent = self)
        self.window2.show()
          
    def run(self):
        structure = self.search.run(self.steps)
        self.ui.log.append("Lowest energy found: "+str(structure.energy))
        if (isinstance(structure.lattice, SquareLattice)):
            plot_2d(structure, self.ui.widget.canvas.fig)
        else:
            plot_3d(structure, self.ui.widget.canvas.fig)
        self.ui.widget.canvas.draw()
        plot_contact_map(structure, self.ui.widget_2.canvas.fig)
        self.ui.widget_2.canvas.draw()
Esempio n. 2
0
 def __init__(self, parent=None, search=None, app=None):
     QtGui.QWidget.__init__(self,parent)
     self.ui = Ui_DialogSearchDisplay()
     self.ui.setupUi(self)
     self.window2=None
     QtCore.QObject.connect(self.ui.button_set_up, QtCore.SIGNAL('clicked()'), self.set_up)
     QtCore.QObject.connect(self.ui.button_run, QtCore.SIGNAL('clicked()'), self.run)
     if (search != None):
         self.search = search